diff --git a/doc/changelog.dox b/doc/changelog.dox index cc8f4a392..7b444441c 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -193,6 +193,8 @@ See also: @ref opengl-workarounds for more information: - @cpp "amd-windows-cubemap-image3d-slice-by-slice" @ce for broken handling of cube map image download and upload in DSA APIs + - @cpp "amd-windows-broken-dsa-cubemap-copy" @ce for broken + framebuffer-to-cubemap copies in DSA APIs - @cpp "amd-windows-dsa-createquery-except-xfb-overflow" @ce using a non-DSA code path for creating @ref PrimitiveQuery::Target::TransformFeedbackOverflow queries diff --git a/src/Magnum/GL/Implementation/FramebufferState.cpp b/src/Magnum/GL/Implementation/FramebufferState.cpp index e6b236f21..d9585e8ac 100644 --- a/src/Magnum/GL/Implementation/FramebufferState.cpp +++ b/src/Magnum/GL/Implementation/FramebufferState.cpp @@ -124,18 +124,26 @@ FramebufferState::FramebufferState(Context& context, std::vector& e } /* DSA/non-DSA implementation for cubemaps, because Intel Windows drivers - have to be broken in a special way */ + have to be broken in a special way. Also reusing this branch for and AMD + workaround for cubemap copy. */ #ifndef MAGNUM_TARGET_GLES - if(context.isExtensionSupported() + if(context.isExtensionSupported()) { #ifdef CORRADE_TARGET_WINDOWS - && (!(context.detectedDriver() & Context::DetectedDriver::IntelWindows) || - context.isDriverWorkaroundDisabled("intel-windows-broken-dsa-for-cubemaps")) + if(context.detectedDriver() & Context::DetectedDriver::IntelWindows && !context.isDriverWorkaroundDisabled("intel-windows-broken-dsa-for-cubemaps")) { + copySubCubeMapImplementation = &AbstractFramebuffer::copySub2DImplementationDefault; + textureCubeMapImplementation = &Framebuffer::texture2DImplementationDefault; + } else if(context.detectedDriver() & Context::DetectedDriver::Amd && !context.isDriverWorkaroundDisabled("amd-windows-broken-dsa-cubemap-copy")) { + copySubCubeMapImplementation = &AbstractFramebuffer::copySub2DImplementationDefault; + /* Cube map attachment is not broken */ + textureCubeMapImplementation = &Framebuffer::texture2DImplementationDSA; + } else #endif - ) { - /* Extension name added above */ + { + /* Extension name added above */ - copySubCubeMapImplementation = &AbstractFramebuffer::copySubCubeMapImplementationDSA; - textureCubeMapImplementation = &Framebuffer::textureCubeMapImplementationDSA; + copySubCubeMapImplementation = &AbstractFramebuffer::copySubCubeMapImplementationDSA; + textureCubeMapImplementation = &Framebuffer::textureCubeMapImplementationDSA; + } } else #endif { diff --git a/src/Magnum/GL/Implementation/driverSpecific.cpp b/src/Magnum/GL/Implementation/driverSpecific.cpp index 2ec1c9cf4..950bcdf08 100644 --- a/src/Magnum/GL/Implementation/driverSpecific.cpp +++ b/src/Magnum/GL/Implementation/driverSpecific.cpp @@ -58,6 +58,10 @@ namespace { slicing and offset calculation, so those currently still fail. */ "amd-windows-cubemap-image3d-slice-by-slice", +/* AMD Windows drivers have broken the DSA glCopyTextureSubImage3D(), returning + GL_INVALID_VALUE. The non-DSA code path works. */ +"amd-windows-broken-dsa-cubemap-copy", + /* AMD Windows glCreateQueries() works for everything except GL_TRANSFORM_FEEDBACK_[STREAM_]OVERFLOW, probably they just forgot to adapt it to this new GL 4.6 addition. Calling the non-DSA code path in that case