From 9a1c196f3dd5d14a3a8c101ea96d26e41bb0507e Mon Sep 17 00:00:00 2001 From: assiduous Date: Mon, 10 Aug 2020 22:51:05 -0700 Subject: OpenGL backend: enabled copying textures to default framebuffer --- Graphics/GraphicsEngineOpenGL/src/TextureBaseGL.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Graphics/GraphicsEngineOpenGL') diff --git a/Graphics/GraphicsEngineOpenGL/src/TextureBaseGL.cpp b/Graphics/GraphicsEngineOpenGL/src/TextureBaseGL.cpp index 06e49cd6..86b5ef40 100644 --- a/Graphics/GraphicsEngineOpenGL/src/TextureBaseGL.cpp +++ b/Graphics/GraphicsEngineOpenGL/src/TextureBaseGL.cpp @@ -579,7 +579,10 @@ void TextureBaseGL::CopyData(DeviceContextGLImpl* pDeviceCtxGL, } #if GL_ARB_copy_image - if (glCopyImageSubData) + const bool IsDefaultBackBuffer = GetGLHandle() == 0; + // We can't use glCopyImageSubData with the proxy texture of a default framebuffer + // because we don't have the texture handle. Resort to quad rendering in this case. + if (glCopyImageSubData && !IsDefaultBackBuffer) { GLint SrcSliceY = (SrcTexDesc.Type == RESOURCE_DIM_TEX_1D_ARRAY) ? SrcSlice : 0; GLint SrcSliceZ = (SrcTexDesc.Type == RESOURCE_DIM_TEX_2D_ARRAY) ? SrcSlice : 0; -- cgit v1.2.3