Skylake has separate controls for enabling the Z Clip Test for the near
and far planes. For now, maintain the legacy behavior by setting both.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
#define _3DSTATE_RASTER 0x7850 /* GEN8+ */
/* DW1 */
+# define GEN9_RASTER_VIEWPORT_Z_FAR_CLIP_TEST_ENABLE (1 << 26)
# define GEN8_RASTER_FRONT_WINDING_CCW (1 << 21)
# define GEN8_RASTER_CULL_BOTH (0 << 16)
# define GEN8_RASTER_CULL_NONE (1 << 16)
# define GEN8_RASTER_LINE_AA_ENABLE (1 << 2)
# define GEN8_RASTER_SCISSOR_ENABLE (1 << 1)
# define GEN8_RASTER_VIEWPORT_Z_CLIP_TEST_ENABLE (1 << 0)
+# define GEN9_RASTER_VIEWPORT_Z_NEAR_CLIP_TEST_ENABLE (1 << 0)
/* Gen8 BLEND_STATE */
/* DW0 */
dw1 |= GEN8_RASTER_SCISSOR_ENABLE;
/* _NEW_TRANSFORM */
- if (!ctx->Transform.DepthClamp)
- dw1 |= GEN8_RASTER_VIEWPORT_Z_CLIP_TEST_ENABLE;
+ if (!ctx->Transform.DepthClamp) {
+ if (brw->gen >= 9) {
+ dw1 |= GEN9_RASTER_VIEWPORT_Z_NEAR_CLIP_TEST_ENABLE |
+ GEN9_RASTER_VIEWPORT_Z_FAR_CLIP_TEST_ENABLE;
+ } else {
+ dw1 |= GEN8_RASTER_VIEWPORT_Z_CLIP_TEST_ENABLE;
+ }
+ }
BEGIN_BATCH(5);
OUT_BATCH(_3DSTATE_RASTER << 16 | (5 - 2));