diff options
author | Jason Ekstrand <[email protected]> | 2015-11-20 11:53:10 -0800 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2015-11-20 11:53:10 -0800 |
commit | 55d16c090eaf7d5a8a9d7fca870b051f651573cc (patch) | |
tree | d980dda14f15d318f750b4615ee46313067b7db6 /src/vulkan | |
parent | b43ce6768dcaa143f143bda59beb7794cc6bd7b3 (diff) |
gen8/pipeline: Properly handle MIN/MAX blend ops
Diffstat (limited to 'src/vulkan')
-rw-r--r-- | src/vulkan/gen8_pipeline.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/vulkan/gen8_pipeline.c b/src/vulkan/gen8_pipeline.c index 618774eda6e..6e2e65d6344 100644 --- a/src/vulkan/gen8_pipeline.c +++ b/src/vulkan/gen8_pipeline.c @@ -229,6 +229,23 @@ emit_cb_state(struct anv_pipeline *pipeline, .WriteDisableGreen = !(a->channelWriteMask & VK_CHANNEL_G_BIT), .WriteDisableBlue = !(a->channelWriteMask & VK_CHANNEL_B_BIT), }; + + /* Our hardware applies the blend factor prior to the blend function + * regardless of what function is used. Technically, this means the + * hardware can do MORE than GL or Vulkan specify. However, it also + * means that, for MIN and MAX, we have to stomp the blend factor to + * ONE to make it a no-op. + */ + if (a->blendOpColor == VK_BLEND_OP_MIN || + a->blendOpColor == VK_BLEND_OP_MAX) { + blend_state.Entry[i].SourceBlendFactor = BLENDFACTOR_ONE; + blend_state.Entry[i].DestinationBlendFactor = BLENDFACTOR_ONE; + } + if (a->blendOpAlpha == VK_BLEND_OP_MIN || + a->blendOpAlpha == VK_BLEND_OP_MAX) { + blend_state.Entry[i].SourceAlphaBlendFactor = BLENDFACTOR_ONE; + blend_state.Entry[i].DestinationAlphaBlendFactor = BLENDFACTOR_ONE; + } } GEN8_BLEND_STATE_pack(NULL, pipeline->blend_state.map, &blend_state); |