1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-31 14:52:11 +01:00

[d3d11] Validate viewport parameters

And skip invalid calls. Fixes Senran Kagura Peach Ball.
This commit is contained in:
Philip Rebohle 2024-08-23 14:39:56 +02:00
parent 6da1ba7cff
commit 1c30bc92bb

View File

@ -2422,6 +2422,17 @@ namespace dxvk {
if (unlikely(NumViewports > m_state.rs.viewports.size()))
return;
for (uint32_t i = 0; i < NumViewports; i++) {
const D3D11_VIEWPORT& vp = pViewports[i];
bool valid = vp.Width >= 0.0f && vp.Height >= 0.0f
&& vp.MinDepth >= 0.0f && vp.MaxDepth <= 1.0f
&& vp.MinDepth <= vp.MaxDepth;
if (!valid)
return;
}
bool dirty = m_state.rs.numViewports != NumViewports;
m_state.rs.numViewports = NumViewports;