mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-09 12:48:32 +09:00
[Fix] (MG_Backend/DirectVulkan): use proper scissor state to fix menu
This commit is contained in:
@@ -547,9 +547,16 @@ namespace MobileGL::MG_Backend::DirectVulkan {
|
||||
viewport.maxDepth = 1.0f;
|
||||
vkCmdSetViewport(frame.commandBuffer, 0, 1, &viewport);
|
||||
|
||||
Bool scissorEnabled = MG_State::pGLContext->IsCapabilityEnabled(CapabilityInput::ScissorTest);
|
||||
VkRect2D scissor{};
|
||||
scissor.offset = {0, 0};
|
||||
scissor.extent = { (Uint)renderPassEntry.extent.x(), (Uint)renderPassEntry.extent.y() };
|
||||
if (scissorEnabled) {
|
||||
const auto& scissorBox = MG_State::pGLContext->GetScissorBox();
|
||||
scissor.offset = { scissorBox[0], scissorBox[1] };
|
||||
scissor.extent = { (Uint)scissorBox[2], (Uint)scissorBox[3] };
|
||||
} else {
|
||||
scissor.offset = {0, 0};
|
||||
scissor.extent = { (Uint)renderPassEntry.extent.x(), (Uint)renderPassEntry.extent.y() };
|
||||
}
|
||||
vkCmdSetScissor(frame.commandBuffer, 0, 1, &scissor);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user