From 0e38db01460ce5d40fdedaa18f9d3c76db156bc5 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 19 Jul 2022 15:14:06 +1000 Subject: [PATCH] gallium: add a rasterizer state bit for unrestricted depth values. This tells the drivers to expect depth values outside the 0..1 range. This is used for support VK_EXT_depth_range_unrestricted, but could also be used for GL_NV_depth_buffer_float in GL. Reviewed-by: Roland Scheidegger Part-of: --- src/gallium/include/pipe/p_state.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h index 64904dbd9b0..d96d24e4b10 100644 --- a/src/gallium/include/pipe/p_state.h +++ b/src/gallium/include/pipe/p_state.h @@ -184,6 +184,14 @@ struct pipe_rasterizer_state */ unsigned offset_units_unscaled:1; + /** + * Depth values output from fragment shader may be outside 0..1. + * These have to be clamped for use with UNORM buffers. + * Vulkan can allow this with an extension, + * GL could with NV_depth_buffer_float, but GLES doesn't. + */ + unsigned unclamped_fragment_depth_values:1; + /** * Enable bits for clipping half-spaces. * This applies to both user clip planes and shader clip distances.