radv: fix another case of VRS with mipmaps on GFX10.3

When a VRS view is used with a depth/stencil view, the driver is
expected to copy the VRS rates to the HTILE buffer of the depth/stencil
view. Though if the image uses mipmaps and the base level can't support
HTILE there is no way to copy the rates. The workaround is to force VRS
to be 1x1 which is valid in Vulkan.

This fixes old VKCTS failures on RAPHAEL just because it supports
fragmentShadingRateWithShaderDepthStencilWrites compared to other GPUs
in CI (NAVI21/VANGOGH).

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
This commit is contained in:
Samuel Pitoiset 2026-05-07 17:24:42 +02:00
parent 62b890046f
commit defcae86e6
2 changed files with 16 additions and 27 deletions

View file

@ -1,29 +1,3 @@
# Issues specific to the Raphael. The list can be reduced when disabling VRS flat shading
dEQP-VK.fragment_shading_rate.renderpass2.monolithic.fragdepth_baselevel.dynamic.attachment.noshaderrate.keep.replace.1x1.samples1.ms,Fail
dEQP-VK.fragment_shading_rate.renderpass2.monolithic.fragdepth_baselevel.dynamic.attachment.noshaderrate.keep.replace.1x1.samples1.vs,Fail
dEQP-VK.fragment_shading_rate.renderpass2.monolithic.fragdepth_baselevel.dynamic.attachment.noshaderrate.keep.replace.4x4.samples1.ms,Fail
dEQP-VK.fragment_shading_rate.renderpass2.monolithic.fragdepth_baselevel.dynamic.attachment.noshaderrate.keep.replace.4x4.samples1.vs,Fail
dEQP-VK.fragment_shading_rate.renderpass2.monolithic.fragdepth_baselevel.dynamic.attachment.shaderrate.keep.replace.1x1.samples1.ms,Fail
dEQP-VK.fragment_shading_rate.renderpass2.monolithic.fragdepth_baselevel.dynamic.attachment.shaderrate.keep.replace.1x1.samples1.vs,Fail
dEQP-VK.fragment_shading_rate.renderpass2.monolithic.fragdepth_baselevel.dynamic.attachment.shaderrate.keep.replace.4x4.samples1.ms,Fail
dEQP-VK.fragment_shading_rate.renderpass2.monolithic.fragdepth_baselevel.dynamic.attachment.shaderrate.keep.replace.4x4.samples1.vs,Fail
dEQP-VK.fragment_shading_rate.renderpass2.monolithic.fragdepth_baselevel.dynamic.attachment.shaderrate.replace.replace.1x1.samples1.ms,Fail
dEQP-VK.fragment_shading_rate.renderpass2.monolithic.fragdepth_baselevel.dynamic.attachment.shaderrate.replace.replace.1x1.samples1.vs,Fail
dEQP-VK.fragment_shading_rate.renderpass2.monolithic.fragdepth_baselevel.dynamic.attachment.shaderrate.replace.replace.4x4.samples1.ms,Fail
dEQP-VK.fragment_shading_rate.renderpass2.monolithic.fragdepth_baselevel.dynamic.attachment.shaderrate.replace.replace.4x4.samples1.vs,Fail
dEQP-VK.fragment_shading_rate.renderpass2.monolithic.fragstencil_baselevel.dynamic.attachment.noshaderrate.keep.replace.1x1.samples1.ms,Fail
dEQP-VK.fragment_shading_rate.renderpass2.monolithic.fragstencil_baselevel.dynamic.attachment.noshaderrate.keep.replace.1x1.samples1.vs,Fail
dEQP-VK.fragment_shading_rate.renderpass2.monolithic.fragstencil_baselevel.dynamic.attachment.noshaderrate.keep.replace.4x4.samples1.ms,Fail
dEQP-VK.fragment_shading_rate.renderpass2.monolithic.fragstencil_baselevel.dynamic.attachment.noshaderrate.keep.replace.4x4.samples1.vs,Fail
dEQP-VK.fragment_shading_rate.renderpass2.monolithic.fragstencil_baselevel.dynamic.attachment.shaderrate.keep.replace.1x1.samples1.ms,Fail
dEQP-VK.fragment_shading_rate.renderpass2.monolithic.fragstencil_baselevel.dynamic.attachment.shaderrate.keep.replace.1x1.samples1.vs,Fail
dEQP-VK.fragment_shading_rate.renderpass2.monolithic.fragstencil_baselevel.dynamic.attachment.shaderrate.keep.replace.4x4.samples1.ms,Fail
dEQP-VK.fragment_shading_rate.renderpass2.monolithic.fragstencil_baselevel.dynamic.attachment.shaderrate.keep.replace.4x4.samples1.vs,Fail
dEQP-VK.fragment_shading_rate.renderpass2.monolithic.fragstencil_baselevel.dynamic.attachment.shaderrate.replace.replace.1x1.samples1.ms,Fail
dEQP-VK.fragment_shading_rate.renderpass2.monolithic.fragstencil_baselevel.dynamic.attachment.shaderrate.replace.replace.1x1.samples1.vs,Fail
dEQP-VK.fragment_shading_rate.renderpass2.monolithic.fragstencil_baselevel.dynamic.attachment.shaderrate.replace.replace.4x4.samples1.ms,Fail
dEQP-VK.fragment_shading_rate.renderpass2.monolithic.fragstencil_baselevel.dynamic.attachment.shaderrate.replace.replace.4x4.samples1.vs,Fail
# RADV bug
dEQP-VK.api.copy_and_blit.core.use_after_copy.d16_unorm.general.32x32x1_cq_regions,Fail
dEQP-VK.api.copy_and_blit.core.use_after_copy.d16_unorm.general.32x32x2_cq_img2img_msaa,Fail

View file

@ -4319,6 +4319,7 @@ radv_emit_fsr_state(struct radv_cmd_buffer *cmd_buffer)
struct radv_device *device = radv_cmd_buffer_device(cmd_buffer);
const struct radv_physical_device *pdev = radv_device_physical(device);
const struct radv_dynamic_state *d = &cmd_buffer->state.dynamic;
const struct radv_rendering_state *render = &cmd_buffer->state.render;
struct radv_cmd_stream *cs = cmd_buffer->cs;
/* When per-vertex VRS is forced and the dynamic fragment shading rate is a no-op, ignore
@ -4338,7 +4339,7 @@ radv_emit_fsr_state(struct radv_cmd_buffer *cmd_buffer)
assert(pdev->info.gfx_level >= GFX10_3);
if (!cmd_buffer->state.render.vrs_att.iview) {
if (!render->vrs_att.iview) {
/* When the current subpass has no VRS attachment, the VRS rates are expected to be 1x1, so we
* can cheat by tweaking the different combiner modes.
*/
@ -4364,6 +4365,20 @@ radv_emit_fsr_state(struct radv_cmd_buffer *cmd_buffer)
default:
break;
}
} else if (render->ds_att.iview && radv_image_has_vrs_htile(device, render->ds_att.iview->image) &&
!radv_htile_enabled(render->ds_att.iview->image, render->ds_att.iview->vk.base_mip_level)) {
/* Otherwise, adjust the combiners to force VRS rate to 1x1 when the depth/stencil view is
* incompatible with VRS which can happen with mipmaps.
*/
switch (htile_comb_mode) {
case VK_FRAGMENT_SHADING_RATE_COMBINER_OP_MIN_KHR:
case VK_FRAGMENT_SHADING_RATE_COMBINER_OP_REPLACE_KHR:
rate_x = rate_y = 0;
pipeline_comb_mode = V_028848_SC_VRS_COMB_MODE_PASSTHRU;
break;
default:
break;
}
}
/* Disable VRS and use the rates from PS_ITER_SAMPLES if: