From 30616bcf0cb3f2b15bb9f9ecd71b26f7bfe13481 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Wed, 7 Jun 2023 21:46:08 +0200 Subject: render/vulkan: reset scissor before post-blend subpass Otherwise only the last command's area will be copied over. --- render/vulkan/pass.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/render/vulkan/pass.c b/render/vulkan/pass.c index 0fb8ea50..55e18387 100644 --- a/render/vulkan/pass.c +++ b/render/vulkan/pass.c @@ -82,9 +82,12 @@ static bool render_pass_submit(struct wlr_render_pass *wlr_pass) { // Apply output shader to map blend image to actual output image vkCmdNextSubpass(render_cb->vk, VK_SUBPASS_CONTENTS_INLINE); + int width = pass->render_buffer->wlr_buffer->width; + int height = pass->render_buffer->wlr_buffer->height; + float final_matrix[9] = { - pass->render_buffer->wlr_buffer->width, 0, -1, - 0, pass->render_buffer->wlr_buffer->height, -1, + width, 0, -1, + 0, height, -1, 0, 0, 0, }; struct wlr_vk_vert_pcr_data vert_pcr_data = { @@ -100,6 +103,9 @@ static bool render_pass_submit(struct wlr_render_pass *wlr_pass) { VK_PIPELINE_BIND_POINT_GRAPHICS, renderer->output_pipe_layout, 0, 1, &render_buffer->blend_descriptor_set, 0, NULL); + vkCmdSetScissor(render_cb->vk, 0, 1, &(VkRect2D){ + .extent = { width, height }, + }); vkCmdDraw(render_cb->vk, 4, 1, 0, 0); } -- cgit v1.2.3