radv/gfx9: fixup db/stencil disable.
authorDave Airlie <airlied@redhat.com>
Mon, 21 Aug 2017 05:00:49 +0000 (06:00 +0100)
committerDave Airlie <airlied@redhat.com>
Thu, 24 Aug 2017 00:14:14 +0000 (01:14 +0100)
This fixes disabled Z/stencil.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Cc: "17.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/amd/vulkan/radv_cmd_buffer.c

index 94453094eb68cb1007594c0e4722b3de072ced9f..26a230799ce5bd530f781893eb903bce3a5351a6 100644 (file)
@@ -1247,9 +1247,13 @@ radv_emit_framebuffer_state(struct radv_cmd_buffer *cmd_buffer)
                }
                radv_load_depth_clear_regs(cmd_buffer, image);
        } else {
-               radeon_set_context_reg_seq(cmd_buffer->cs, R_028040_DB_Z_INFO, 2);
-               radeon_emit(cmd_buffer->cs, S_028040_FORMAT(V_028040_Z_INVALID)); /* R_028040_DB_Z_INFO */
-               radeon_emit(cmd_buffer->cs, S_028044_FORMAT(V_028044_STENCIL_INVALID)); /* R_028044_DB_STENCIL_INFO */
+               if (cmd_buffer->device->physical_device->rad_info.chip_class >= GFX9)
+                       radeon_set_context_reg_seq(cmd_buffer->cs, R_028038_DB_Z_INFO, 2);
+               else
+                       radeon_set_context_reg_seq(cmd_buffer->cs, R_028040_DB_Z_INFO, 2);
+
+               radeon_emit(cmd_buffer->cs, S_028040_FORMAT(V_028040_Z_INVALID)); /* DB_Z_INFO */
+               radeon_emit(cmd_buffer->cs, S_028044_FORMAT(V_028044_STENCIL_INVALID)); /* DB_STENCIL_INFO */
        }
        radeon_set_context_reg(cmd_buffer->cs, R_028208_PA_SC_WINDOW_SCISSOR_BR,
                               S_028208_BR_X(framebuffer->width) |