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

Author: Samuel Pitoiset <[email protected]>
Date:   Fri Dec  9 11:16:53 2022 +0100

radv: fix detecting that blend is enabled when all CB states are dynamic

It's allowed to be NULL.

Signed-off-by: Samuel Pitoiset <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20281>

---

 src/amd/vulkan/radv_pipeline.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c
index ae9023d8f65..42c707eec34 100644
--- a/src/amd/vulkan/radv_pipeline.c
+++ b/src/amd/vulkan/radv_pipeline.c
@@ -691,6 +691,15 @@ radv_pipeline_is_blend_enabled(const struct 
radv_graphics_pipeline *pipeline,
          if (cb->attachments[i].write_mask && cb->attachments[i].blend_enable)
             return true;
       }
+   } else {
+      const uint64_t cb_dynamic_states =
+         RADV_DYNAMIC_LOGIC_OP_ENABLE | RADV_DYNAMIC_LOGIC_OP | 
RADV_DYNAMIC_COLOR_WRITE_ENABLE |
+         RADV_DYNAMIC_COLOR_WRITE_MASK | RADV_DYNAMIC_COLOR_BLEND_ENABLE |
+         RADV_DYNAMIC_COLOR_BLEND_EQUATION | RADV_DYNAMIC_BLEND_CONSTANTS;
+
+      /* When all color blend states are dynamic, it's allowed to be NULL. */
+      if ((pipeline->dynamic_states & cb_dynamic_states) == cb_dynamic_states)
+         return true;
    }
 
    return false;

Reply via email to