Mesa (main): radv: only emit the per-vertex VRS state if the pipeline forced it

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Feb 9 19:41:19 UTC 2022


Module: Mesa
Branch: main
Commit: 53dc5f774d43ba022627ec5e4ec970b0d472d1cf
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=53dc5f774d43ba022627ec5e4ec970b0d472d1cf

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Mon Feb  7 11:31:13 2022 +0100

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 <samuel.pitoiset at gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14907>

---

 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.



More information about the mesa-commit mailing list