aboutsummaryrefslogtreecommitdiff
path: root/render/vulkan
diff options
context:
space:
mode:
authorAlexander Orzechowski <alex@ozal.ski>2023-06-05 16:01:21 -0400
committerAlexander Orzechowski <alex@ozal.ski>2023-06-16 19:20:04 -0400
commit3623005858348594e6e32d95024cccc3f4270d85 (patch)
tree5421035321ff2c63bb10dce6a633a50782d74fb7 /render/vulkan
parent9d31372930eb061e1a5f43fa7e0cb27e2ffa197a (diff)
render/vulkan/pipeline_key: Add blending
This will become necessary when we switch away from scissoring. For the time being, this cleans things up a bit and allows for a trivial blending implementation for textures when that comes.
Diffstat (limited to 'render/vulkan')
-rw-r--r--render/vulkan/renderer.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/render/vulkan/renderer.c b/render/vulkan/renderer.c
index 064f5055..039f6ef7 100644
--- a/render/vulkan/renderer.c
+++ b/render/vulkan/renderer.c
@@ -2100,6 +2100,10 @@ static bool pipeline_key_equals(const struct wlr_vk_pipeline_key *a,
return false;
}
+ if (a->blend_mode != b->blend_mode) {
+ return false;
+ }
+
if (a->source != b->source) {
return false;
}
@@ -2194,7 +2198,7 @@ struct wlr_vk_pipeline *setup_get_or_create_pipeline(
};
VkPipelineColorBlendAttachmentState blend_attachment = {
- .blendEnable = true,
+ .blendEnable = key->blend_mode == WLR_RENDER_BLEND_MODE_PREMULTIPLIED,
// we generally work with pre-multiplied alpha
.srcColorBlendFactor = VK_BLEND_FACTOR_ONE,
.dstColorBlendFactor = VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA,