Skip to content

Commit bd850bd

Browse files
committed
OpenGL: re-added depth buffer size check in set render targets
1 parent 8a690ea commit bd850bd

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,10 +1222,16 @@ private void SetRenderTargetsImpl(Texture depthStencilBuffer, int renderTargetCo
12221222
// ensure size is coherent
12231223
var expectedWidth = renderTargets[0].Width;
12241224
var expectedHeight = renderTargets[0].Height;
1225+
if (depthStencilBuffer != null)
1226+
{
1227+
System.Diagnostics.Debug.Assert(expectedWidth == depthStencilBuffer.Width && expectedHeight == depthStencilBuffer.Height, "Depth buffer is not the same size as the render target");
1228+
}
12251229
for (int i = 1; i < renderTargetCount; ++i)
12261230
{
1227-
if (renderTargets[i] != null && (expectedWidth != renderTargets[i].Width || expectedHeight != renderTargets[i].Height))
1228-
throw new Exception("Render targets do not have the same size");
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+
}
12291235
}
12301236
}
12311237

0 commit comments

Comments
 (0)