diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c index 60887d6ae5d..9c72eee48f1 100644 --- a/src/amd/vulkan/radv_cmd_buffer.c +++ b/src/amd/vulkan/radv_cmd_buffer.c @@ -4124,15 +4124,8 @@ radv_emit_null_ds_state(struct radv_cmd_buffer *cmd_buffer) const struct radv_physical_device *pdev = radv_device_physical(device); const enum amd_gfx_level gfx_level = pdev->info.gfx_level; unsigned db_render_control = 0; - unsigned num_samples = 0; - /* On GFX11, the hw intentionally looks at DB_Z_INFO.NUM_SAMPLES when there is no bound - * depth/stencil buffer and it clamps the number of samples like MIN2(DB_Z_INFO.NUM_SAMPLES, - * PA_SC_AA_CONFIG.MSAA_EXPOSED_SAMPLES). Use 8x for DB_Z_INFO.NUM_SAMPLES to make sure it's not - * the constraining factor. This affects VRS, occlusion queries and POPS. - */ if (gfx_level == GFX11) { - num_samples = 3; radv_gfx11_set_db_render_control(device, 1, &db_render_control); } @@ -4142,7 +4135,13 @@ radv_emit_null_ds_state(struct radv_cmd_buffer *cmd_buffer) 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) | S_028040_NUM_SAMPLES(num_samples)); + /* On GFX11+, the hw intentionally looks at DB_Z_INFO.NUM_SAMPLES when there is no bound + * depth/stencil buffer and it clamps the number of samples like MIN2(DB_Z_INFO.NUM_SAMPLES, + * PA_SC_AA_CONFIG.MSAA_EXPOSED_SAMPLES). Use 8x for DB_Z_INFO.NUM_SAMPLES to make sure it's not + * the constraining factor. This affects VRS, occlusion queries and POPS. + */ + radeon_emit(cmd_buffer->cs, + S_028040_FORMAT(V_028040_Z_INVALID) | S_028040_NUM_SAMPLES(pdev->info.gfx_level >= GFX11 ? 3 : 0)); radeon_emit(cmd_buffer->cs, S_028044_FORMAT(V_028044_STENCIL_INVALID)); radeon_set_context_reg(cmd_buffer->cs, R_028000_DB_RENDER_CONTROL, db_render_control);