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@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14907>
This commit is contained in:
Samuel Pitoiset 2022-02-07 11:31:13 +01:00
parent d0171dffe1
commit 53dc5f774d

View File

@ -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.