mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Vulkan: Disable viewport and scissor
This commit is contained in:
parent
00d941a309
commit
8f27be1804
|
@ -3309,6 +3309,19 @@ protected:
|
|||
else
|
||||
{
|
||||
ExecBuffer.m_HasDynamicState = false;
|
||||
VkViewport Viewport;
|
||||
Viewport.x = 0.0f;
|
||||
Viewport.y = 0.0f;
|
||||
Viewport.width = (float)m_VKSwapImgAndViewportExtent.m_SwapImageViewport.width;
|
||||
Viewport.height = (float)m_VKSwapImgAndViewportExtent.m_SwapImageViewport.height;
|
||||
Viewport.minDepth = 0.0f;
|
||||
Viewport.maxDepth = 1.0f;
|
||||
VkRect2D Scissor;
|
||||
auto ScissorViewport = m_VKSwapImgAndViewportExtent.GetPresentedImageViewport();
|
||||
Scissor.offset = {0, 0};
|
||||
Scissor.extent = {ScissorViewport.width, ScissorViewport.height};
|
||||
ExecBuffer.m_Viewport = Viewport;
|
||||
ExecBuffer.m_Scissor = Scissor;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3320,12 +3333,8 @@ protected:
|
|||
m_vLastPipeline[RenderThreadIndex] = BindingPipe;
|
||||
}
|
||||
|
||||
size_t DynamicStateIndex = GetDynamicModeIndexFromExecBuffer(ExecBuffer);
|
||||
if(DynamicStateIndex == VULKAN_BACKEND_CLIP_MODE_DYNAMIC_SCISSOR_AND_VIEWPORT)
|
||||
{
|
||||
vkCmdSetViewport(CommandBuffer, 0, 1, &ExecBuffer.m_Viewport);
|
||||
vkCmdSetScissor(CommandBuffer, 0, 1, &ExecBuffer.m_Scissor);
|
||||
}
|
||||
vkCmdSetViewport(CommandBuffer, 0, 1, &ExecBuffer.m_Viewport);
|
||||
vkCmdSetScissor(CommandBuffer, 0, 1, &ExecBuffer.m_Scissor);
|
||||
}
|
||||
|
||||
/**************************
|
||||
|
|
Loading…
Reference in a new issue