From 3623005858348594e6e32d95024cccc3f4270d85 Mon Sep 17 00:00:00 2001 From: Alexander Orzechowski Date: Mon, 5 Jun 2023 16:01:21 -0400 Subject: 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. --- render/vulkan/renderer.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'render/vulkan') 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, -- cgit v1.2.3