Skip to content

Commit 94c1722

Browse files
GL: fixed comparison in checks for the maximum number of render targets
1 parent effec62 commit 94c1722

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,11 +388,11 @@ void DeviceContextGLImpl::CommitRenderTargets()
388388
VERIFY(m_NumBoundRenderTargets != 0 || m_pBoundDepthStencil, "At least one render target or a depth stencil is expected");
389389

390390
Uint32 NumRenderTargets = m_NumBoundRenderTargets;
391-
VERIFY(NumRenderTargets < MAX_RENDER_TARGETS, "Too many render targets (", NumRenderTargets, ") are being set");
391+
DEV_CHECK_ERR(NumRenderTargets <= MAX_RENDER_TARGETS, "Too many render targets (", NumRenderTargets, ") are being set");
392392
NumRenderTargets = std::min(NumRenderTargets, MAX_RENDER_TARGETS);
393393

394394
const auto& CtxCaps = m_ContextState.GetContextCaps();
395-
VERIFY(NumRenderTargets < static_cast<Uint32>(CtxCaps.MaxDrawBuffers), "This device only supports ", CtxCaps.MaxDrawBuffers, " draw buffers, but ", NumRenderTargets, " are being set");
395+
DEV_CHECK_ERR(NumRenderTargets <= static_cast<Uint32>(CtxCaps.MaxDrawBuffers), "This device only supports ", CtxCaps.MaxDrawBuffers, " draw buffers, but ", NumRenderTargets, " are being set");
396396
NumRenderTargets = std::min(NumRenderTargets, static_cast<Uint32>(CtxCaps.MaxDrawBuffers));
397397

398398
TextureViewGLImpl* pBoundRTVs[MAX_RENDER_TARGETS] = {};

Graphics/GraphicsEngineOpenGL/src/FBOCache.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ const GLObjectWrappers::GLFrameBufferObj& FBOCache::GetFBO(Uint32 Nu
256256

257257
// Construct the key
258258
FBOCacheKey Key;
259-
VERIFY(NumRenderTargets < MAX_RENDER_TARGETS, "Too many render targets are being set");
259+
VERIFY(NumRenderTargets <= MAX_RENDER_TARGETS, "Too many render targets are being set");
260260
NumRenderTargets = std::min(NumRenderTargets, MAX_RENDER_TARGETS);
261261
Key.NumRenderTargets = NumRenderTargets;
262262
for (Uint32 rt = 0; rt < NumRenderTargets; ++rt)

0 commit comments

Comments
 (0)