From de1e2b65dbbd2fa27de41054aa0dd314b5bc459b Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Fri, 9 Dec 2022 11:16:53 +0100 Subject: [PATCH] radv: fix detecting that blend is enabled when all CB states are dynamic It's allowed to be NULL. Signed-off-by: Samuel Pitoiset Part-of: --- 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;