mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-13 14:00:09 +00:00
gsk/vulkan/renderpass: Don't scale scissor and render area
The rects passed to the clip region are in buffer coordinates, and must not be scaled. Consider the following scenario: Wayland, with a 1024x768@2 window. That gives us a 2048x1536 raw image. To setup the Vulkan render pass code, we'd scale 2048x1536 *again*, to an unreasonable 4196x3072, which is (1) incorrect and (2) really incorrect and (3) can lead to crashes at best, full GPU resets at worst - and a GPU reset is incredibly not fun! Now that we pass the right clip regions at the right coordinates at all times, remove the extra scaling from the render pass.
This commit is contained in:
parent
dde029c3d1
commit
db1d278100
@ -2258,8 +2258,8 @@ gsk_vulkan_render_pass_draw (GskVulkanRenderPass *self,
|
||||
0,
|
||||
1,
|
||||
&(VkRect2D) {
|
||||
{ rect.x * self->scale_x, rect.y * self->scale_y },
|
||||
{ rect.width * self->scale_x, rect.height * self->scale_y }
|
||||
{ rect.x, rect.y },
|
||||
{ rect.width, rect.height }
|
||||
});
|
||||
|
||||
vkCmdBeginRenderPass (command_buffer,
|
||||
@ -2268,8 +2268,8 @@ gsk_vulkan_render_pass_draw (GskVulkanRenderPass *self,
|
||||
.renderPass = self->render_pass,
|
||||
.framebuffer = gsk_vulkan_render_get_framebuffer (render, self->target),
|
||||
.renderArea = {
|
||||
{ rect.x * self->scale_x, rect.y * self->scale_y },
|
||||
{ rect.width * self->scale_x, rect.height * self->scale_y }
|
||||
{ rect.x, rect.y },
|
||||
{ rect.width, rect.height }
|
||||
},
|
||||
.clearValueCount = 1,
|
||||
.pClearValues = (VkClearValue [1]) {
|
||||
|
Loading…
Reference in New Issue
Block a user