Browse Source

GL: new amd-windows-broken-dsa-cubemap-copy workaround.

pull/388/head
Vladimír Vondruš 7 years ago
parent
commit
3629af231b
  1. 2
      doc/changelog.dox
  2. 24
      src/Magnum/GL/Implementation/FramebufferState.cpp
  3. 4
      src/Magnum/GL/Implementation/driverSpecific.cpp

2
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

24
src/Magnum/GL/Implementation/FramebufferState.cpp

@ -124,18 +124,26 @@ FramebufferState::FramebufferState(Context& context, std::vector<std::string>& 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<Extensions::ARB::direct_state_access>()
if(context.isExtensionSupported<Extensions::ARB::direct_state_access>()) {
#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
{

4
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

Loading…
Cancel
Save