summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineOpenGL
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2020-08-11 05:51:05 +0000
committerassiduous <assiduous@diligentgraphics.com>2020-08-11 05:51:05 +0000
commit9a1c196f3dd5d14a3a8c101ea96d26e41bb0507e (patch)
tree075511958de9879352a95e0d46f2849e3b940d1d /Graphics/GraphicsEngineOpenGL
parentOpenGL backend: enabled handling of default framebuffer in render passes (diff)
downloadDiligentCore-9a1c196f3dd5d14a3a8c101ea96d26e41bb0507e.tar.gz
DiligentCore-9a1c196f3dd5d14a3a8c101ea96d26e41bb0507e.zip
OpenGL backend: enabled copying textures to default framebuffer
Diffstat (limited to 'Graphics/GraphicsEngineOpenGL')
-rw-r--r--Graphics/GraphicsEngineOpenGL/src/TextureBaseGL.cpp5
1 files changed, 4 insertions, 1 deletions
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;