Skip to content

Commit 31366e0

Browse files
OpenGL: restored previous command list checks
1 parent bd850bd commit 31366e0

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

sources/engine/Stride.Graphics/OpenGL/CommandList.OpenGL.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,14 +1224,13 @@ private void SetRenderTargetsImpl(Texture depthStencilBuffer, int renderTargetCo
12241224
var expectedHeight = renderTargets[0].Height;
12251225
if (depthStencilBuffer != null)
12261226
{
1227-
System.Diagnostics.Debug.Assert(expectedWidth == depthStencilBuffer.Width && expectedHeight == depthStencilBuffer.Height, "Depth buffer is not the same size as the render target");
1227+
if (expectedWidth != depthStencilBuffer.Width || expectedHeight != depthStencilBuffer.Height)
1228+
throw new Exception("Depth buffer is not the same size as the render target");
12281229
}
12291230
for (int i = 1; i < renderTargetCount; ++i)
12301231
{
1231-
if (renderTargets[i] != null)
1232-
{
1233-
System.Diagnostics.Debug.Assert(expectedWidth == renderTargets[i].Width && expectedHeight == renderTargets[i].Height, "Render targets do not have the same size");
1234-
}
1232+
if (renderTargets[i] != null && (expectedWidth != renderTargets[i].Width || expectedHeight != renderTargets[i].Height))
1233+
throw new Exception("Render targets do not have the same size");
12351234
}
12361235
}
12371236

0 commit comments

Comments
 (0)