Skip to content

Commit

Permalink
Always clamp render pass to frame buffer size.
Browse files Browse the repository at this point in the history
  • Loading branch information
mcourteaux committed Nov 21, 2024
1 parent 6e0881a commit ea54a9c
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions src/renderer_vk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8599,20 +8599,17 @@ VK_DESTROY
restoreScissor = false;

// Clamp the rect to what's valid according to Vulkan.
if (NULL != fb.m_nwh)
rect.m_width = bx::min(rect.m_width, fb.m_width - rect.m_x);
rect.m_height = bx::min(rect.m_height, fb.m_height - rect.m_y);
if (_render->m_view[view].m_rect.m_width != rect.m_width
|| _render->m_view[view].m_rect.m_height != rect.m_height)
{
rect.m_width = bx::min(rect.m_width, fb.m_width - rect.m_x);
rect.m_height = bx::min(rect.m_height, fb.m_height - rect.m_y);
if (_render->m_view[view].m_rect.m_width != rect.m_width
|| _render->m_view[view].m_rect.m_height != rect.m_height)
{
BX_TRACE(
"Clamp render pass from %dx%d to %dx%d",
_render->m_view[view].m_rect.m_width,
_render->m_view[view].m_rect.m_height,
rect.m_width, rect.m_height
);
}
BX_TRACE(
"Clamp render pass from %dx%d to %dx%d",
_render->m_view[view].m_rect.m_width,
_render->m_view[view].m_rect.m_height,
rect.m_width, rect.m_height
);
}

rpbi.framebuffer = fb.m_currentFramebuffer;
Expand Down

0 comments on commit ea54a9c

Please sign in to comment.