Module: Mesa
Branch: master
Commit: 3720c6a6f6196a0c9bb78e734993fce3e1b1d938
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=3720c6a6f6196a0c9bb78e734993fce3e1b1d938

Author: Samuel Pitoiset <[email protected]>
Date:   Mon Apr 12 18:00:51 2021 +0200

radv: fix needed dynamic state for VRS

If the pipeline struct isn't found, the state might still be dynamic.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10193>

---

 src/amd/vulkan/radv_pipeline.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c
index eef7a2b5947..2ea36b6c063 100644
--- a/src/amd/vulkan/radv_pipeline.c
+++ b/src/amd/vulkan/radv_pipeline.c
@@ -1407,7 +1407,8 @@ radv_pipeline_needed_dynamic_state(const 
VkGraphicsPipelineCreateInfo *pCreateIn
       states &= ~RADV_DYNAMIC_LINE_STIPPLE;
 
    if (!vk_find_struct_const(pCreateInfo->pNext,
-                             
PIPELINE_FRAGMENT_SHADING_RATE_STATE_CREATE_INFO_KHR))
+                             
PIPELINE_FRAGMENT_SHADING_RATE_STATE_CREATE_INFO_KHR) &&
+       !radv_is_state_dynamic(pCreateInfo, 
VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR))
       states &= ~RADV_DYNAMIC_FRAGMENT_SHADING_RATE;
 
    /* TODO: blend constants & line width. */
@@ -1717,7 +1718,7 @@ radv_pipeline_init_dynamic_state(struct radv_pipeline 
*pipeline,
 
    const VkPipelineFragmentShadingRateStateCreateInfoKHR *shading_rate = 
vk_find_struct_const(
       pCreateInfo->pNext, 
PIPELINE_FRAGMENT_SHADING_RATE_STATE_CREATE_INFO_KHR);
-   if (needed_states & RADV_DYNAMIC_FRAGMENT_SHADING_RATE) {
+   if (states & RADV_DYNAMIC_FRAGMENT_SHADING_RATE) {
       dynamic->fragment_shading_rate.size = shading_rate->fragmentSize;
       for (int i = 0; i < 2; i++)
          dynamic->fragment_shading_rate.combiner_ops[i] = 
shading_rate->combinerOps[i];

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to