Skip to content

Commit 086a4c5

Browse files
committed
Add DEV_CHECK_GL_ERROR for glTexParameteri GL_DEPTH_STENCIL_TEXTURE_MODE.
Add error thrown when format not supported
1 parent 98064f9 commit 086a4c5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Graphics/GraphicsEngineOpenGL/src/TextureBaseGL.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -504,11 +504,15 @@ void TextureBaseGL::CreateViewInternal(const TextureViewDesc& OrigViewDesc, ITex
504504
GLContextState& GLState = pDeviceContext->GetContextState();
505505

506506
GLState.BindTexture(-1, GLViewTarget, pViewOGL->GetHandle());
507-
508507
glTexParameteri(GLViewTarget, GL_DEPTH_STENCIL_TEXTURE_MODE, GL_STENCIL_INDEX);
509-
508+
DEV_CHECK_GL_ERROR("Failed to set GL_DEPTH_STENCIL_TEXTURE_MODE texture parameter");
510509
GLState.BindTexture(-1, GLViewTarget, GLObjectWrappers::GLTextureObj::Null());
511510
}
511+
else
512+
{
513+
// Throw an error if the format is not supported
514+
LOG_ERROR_AND_THROW("Format ", GetTextureFormatAttribs(ViewDesc.Format).Name, " is not supported");
515+
}
512516
}
513517

514518
if (!IsIdentityComponentMapping(ViewDesc.Swizzle))

0 commit comments

Comments
 (0)