From 53dc5f774d43ba022627ec5e4ec970b0d472d1cf Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Mon, 7 Feb 2022 11:31:13 +0100 Subject: [PATCH] radv: only emit the per-vertex VRS state if the pipeline forced it If the primitive shading rate is not written by the last VGT stage (like if no FS), it's useless to emit the VRS state. Signed-off-by: Samuel Pitoiset Reviewed-by: Bas Nieuwenhuizen Part-of: --- src/amd/vulkan/radv_pipeline.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c index 2bb40363c34..b372079c37b 100644 --- a/src/amd/vulkan/radv_pipeline.c +++ b/src/amd/vulkan/radv_pipeline.c @@ -5753,7 +5753,8 @@ gfx103_pipeline_generate_vrs_state(struct radeon_cmdbuf *ctx_cs, mode = V_028064_VRS_COMB_MODE_OVERRIDE; rate_x = rate_y = 1; } else if (!vk_find_struct_const(pCreateInfo->pNext, PIPELINE_FRAGMENT_SHADING_RATE_STATE_CREATE_INFO_KHR) && - pipeline->device->force_vrs != RADV_FORCE_VRS_NONE) { + pipeline->device->force_vrs != RADV_FORCE_VRS_NONE && + get_vs_output_info(pipeline)->writes_primitive_shading_rate) { /* Otherwise, if per-draw VRS is not enabled statically, try forcing per-vertex VRS if * requested by the user. Note that vkd3d-proton always has to declare VRS as dynamic because * in DX12 it's fully dynamic.