Skip to content

Commit

Permalink
TextureBaseGL::CopyData: fixed issue with binding texture to 0 target
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMostDiligent committed Nov 12, 2023
1 parent e4b2513 commit 94ba0dd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Graphics/GraphicsEngineOpenGL/src/GLContextState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ void GLContextState::SetActiveTexture(Int32 Index)

void GLContextState::BindTexture(Int32 Index, GLenum BindTarget, const GLObjectWrappers::GLTextureObj& TexObj)
{
VERIFY_EXPR(BindTarget != 0);

if (Index < 0)
{
Index += m_Caps.MaxCombinedTexUnits;
Expand Down
4 changes: 3 additions & 1 deletion Graphics/GraphicsEngineOpenGL/src/TextureBaseGL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,9 @@ void TextureBaseGL::CopyData(DeviceContextGLImpl* pDeviceCtxGL,
// Invalidate FBO as we used glBindFramebuffer directly
GLState.InvalidateFBO();

GLState.BindTexture(-1, GetBindTarget(), GLObjectWrappers::GLTextureObj::Null());
if (!IsDefaultBackBuffer)
GLState.BindTexture(-1, GetBindTarget(), GLObjectWrappers::GLTextureObj::Null());

pDeviceCtxGL->CommitRenderTargets();
}
}
Expand Down

0 comments on commit 94ba0dd

Please sign in to comment.