diff options
author | Simon Ser <contact@emersion.fr> | 2023-06-07 21:46:08 +0200 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2023-06-07 21:46:08 +0200 |
commit | 30616bcf0cb3f2b15bb9f9ecd71b26f7bfe13481 (patch) | |
tree | 5a8388e51c30dcc362eb103143d71a04c27ec93a | |
parent | 150a88bd03c5ee802edd94326ef391dd0b4f5ac1 (diff) |
render/vulkan: reset scissor before post-blend subpass
Otherwise only the last command's area will be copied over.
-rw-r--r-- | render/vulkan/pass.c | 10 |
1 files 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); } |