Fix advanced blend dynamic state Test: ANGLE tests Change-Id: If81eb2642596c1c2a0d5a020d5c37310c3a407fd Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/77948 Tested-by: Shahbaz Youssefi <syoussefi@google.com> Reviewed-by: Jason Macnak <natsu@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@google.com>
diff --git a/src/Device/Context.cpp b/src/Device/Context.cpp index 32e953c..55956bd 100644 --- a/src/Device/Context.cpp +++ b/src/Device/Context.cpp
@@ -1246,17 +1246,17 @@ blendState[i].destBlendFactor = dynamicState.colorBlendEquations[i].dstColorBlendFactor; blendState[i].sourceBlendFactorAlpha = dynamicState.colorBlendEquations[i].srcAlphaBlendFactor; blendState[i].destBlendFactorAlpha = dynamicState.colorBlendEquations[i].dstAlphaBlendFactor; - blendState[i].blendOperationAlpha = dynamicState.colorBlendEquations[i].alphaBlendOp; } } // colorBlendOp may be set either by COLOR_BLEND_EQUATION or COLOR_BLEND_ADVANCED dynamic - // states + // states. In SwiftShader, alphaBlendOp is set equal to colorBlendOp for advanced blend. if(dynamicStateFlags.dynamicColorBlendEquation || dynamicStateFlags.dynamicColorBlendAdvanced) { for(uint32_t i = 0; i < sw::MAX_COLOR_BUFFERS; ++i) { blendState[i].blendOperation = dynamicState.colorBlendEquations[i].colorBlendOp; + blendState[i].blendOperationAlpha = dynamicState.colorBlendEquations[i].alphaBlendOp; } }
diff --git a/src/Vulkan/VkCommandBuffer.cpp b/src/Vulkan/VkCommandBuffer.cpp index c61e132..6a6b0f4 100644 --- a/src/Vulkan/VkCommandBuffer.cpp +++ b/src/Vulkan/VkCommandBuffer.cpp
@@ -1111,6 +1111,7 @@ UNSUPPORTED("VkColorBlendAdvancedEXT::clampResults"); } executionState.dynamicState.colorBlendEquations[firstAttachment + i].colorBlendOp = colorBlendAdvanced[i].advancedBlendOp; + executionState.dynamicState.colorBlendEquations[firstAttachment + i].alphaBlendOp = colorBlendAdvanced[i].advancedBlendOp; } }