summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>2023-05-16 12:14:24 +0200
committerMarge Bot <emma+marge@anholt.net>2023-05-17 07:51:18 +0000
commitf1e339dfd6db7d18ee2262387268aa3f2f8c0f8c (patch)
treecc1f0b02c97d2bc9b5d1c270c27cc325f51dba58
parent9ba416cdc67073cdda9a73fe9d37304b82bdd526 (diff)
downloadmesa-f1e339dfd6db7d18ee2262387268aa3f2f8c0f8c.tar.gz
radv: fix resetting VRS if the graphics pipeline doesn't enable it
Otherwise the VRS state isn't reset and the graphics pipeline might still use the previous VRS state. The VRS state will only be re-emitted if it's different when the pipeline is bound. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9005 Cc: mesa-stable Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23052>
-rw-r--r--src/amd/vulkan/radv_pipeline_graphics.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/amd/vulkan/radv_pipeline_graphics.c b/src/amd/vulkan/radv_pipeline_graphics.c
index 7a4f256abb4..9f7c8e8dd99 100644
--- a/src/amd/vulkan/radv_pipeline_graphics.c
+++ b/src/amd/vulkan/radv_pipeline_graphics.c
@@ -546,7 +546,8 @@ radv_pipeline_is_blend_enabled(const struct radv_graphics_pipeline *pipeline,
}
static uint64_t
-radv_pipeline_needed_dynamic_state(const struct radv_graphics_pipeline *pipeline,
+radv_pipeline_needed_dynamic_state(const struct radv_device *device,
+ const struct radv_graphics_pipeline *pipeline,
const struct vk_graphics_pipeline_state *state)
{
bool has_color_att = radv_pipeline_has_color_attachments(state->rp);
@@ -554,6 +555,9 @@ radv_pipeline_needed_dynamic_state(const struct radv_graphics_pipeline *pipeline
(pipeline->dynamic_states & RADV_DYNAMIC_RASTERIZER_DISCARD_ENABLE);
uint64_t states = RADV_DYNAMIC_ALL;
+ if (device->physical_device->rad_info.gfx_level < GFX10_3)
+ states &= ~RADV_DYNAMIC_FRAGMENT_SHADING_RATE;
+
/* Disable dynamic states that are useless to mesh shading. */
if (radv_pipeline_has_stage(pipeline, MESA_SHADER_MESH)) {
if (!raster_enabled)
@@ -600,9 +604,6 @@ radv_pipeline_needed_dynamic_state(const struct radv_graphics_pipeline *pipeline
!state->rs->line.stipple.enable)
states &= ~RADV_DYNAMIC_LINE_STIPPLE;
- if (!radv_is_vrs_enabled(pipeline, state))
- states &= ~RADV_DYNAMIC_FRAGMENT_SHADING_RATE;
-
if (!has_color_att || !radv_pipeline_is_blend_enabled(pipeline, state->cb))
states &= ~RADV_DYNAMIC_BLEND_CONSTANTS;
@@ -896,11 +897,12 @@ radv_pipeline_uses_ds_feedback_loop(const VkGraphicsPipelineCreateInfo *pCreateI
}
static void
-radv_pipeline_init_dynamic_state(struct radv_graphics_pipeline *pipeline,
+radv_pipeline_init_dynamic_state(const struct radv_device *device,
+ struct radv_graphics_pipeline *pipeline,
const struct vk_graphics_pipeline_state *state,
const VkGraphicsPipelineCreateInfo *pCreateInfo)
{
- uint64_t needed_states = radv_pipeline_needed_dynamic_state(pipeline, state);
+ uint64_t needed_states = radv_pipeline_needed_dynamic_state(device, pipeline, state);
struct radv_dynamic_state *dynamic = &pipeline->dynamic_state;
uint64_t states = needed_states;
@@ -4062,7 +4064,7 @@ radv_graphics_pipeline_init(struct radv_graphics_pipeline *pipeline, struct radv
if (!radv_pipeline_has_stage(pipeline, MESA_SHADER_MESH))
radv_pipeline_init_input_assembly_state(device, pipeline);
- radv_pipeline_init_dynamic_state(pipeline, &state, pCreateInfo);
+ radv_pipeline_init_dynamic_state(device, pipeline, &state, pCreateInfo);
struct radv_blend_state blend = radv_pipeline_init_blend_state(pipeline, &state);