From 59a692916ca251db995050f7fc0bb7b4e6e4780b Mon Sep 17 00:00:00 2001 From: Axel Davy Date: Mon, 13 Jun 2016 22:28:32 +0200 Subject: gallium: Add a cap for offset_units_unscaled MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit D3D9 has a different behaviour for depth bias. For OGL/D3D1X, the depth bias unit is the minimal resolvable value for the depth buffer, which depends on the format (and has different behaviour for float depth buffers). For D3D9, the depth bias unit is 1.0f. Signed-off-by: Axel Davy Reviewed-by: Marek Olšák --- src/gallium/include/pipe/p_defines.h | 1 + src/gallium/include/pipe/p_state.h | 7 +++++++ 2 files changed, 8 insertions(+) (limited to 'src/gallium/include') diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h index c46ac5a6a63..62fa67374f2 100644 --- a/src/gallium/include/pipe/p_defines.h +++ b/src/gallium/include/pipe/p_defines.h @@ -731,6 +731,7 @@ enum pipe_cap PIPE_CAP_PRIMITIVE_RESTART_FOR_PATCHES, PIPE_CAP_TGSI_VOTE, PIPE_CAP_MAX_WINDOW_RECTANGLES, + PIPE_CAP_POLYGON_OFFSET_UNITS_UNSCALED, }; #define PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_NV50 (1 << 0) diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h index 9c693555c7e..1543e90972e 100644 --- a/src/gallium/include/pipe/p_state.h +++ b/src/gallium/include/pipe/p_state.h @@ -139,6 +139,13 @@ struct pipe_rasterizer_state */ unsigned clip_halfz:1; + /** + * When true do not scale offset_units and use same rules for unorm and + * float depth buffers (D3D9). When false use GL/D3D1X behaviour. + * This depends on PIPE_CAP_POLYGON_OFFSET_UNITS_UNSCALED. + */ + unsigned offset_units_unscaled:1; + /** * Enable bits for clipping half-spaces. * This applies to both user clip planes and shader clip distances. -- cgit v1.2.3