diff --git a/doc/changelog.dox b/doc/changelog.dox index 15c8dcff0..dabd9130f 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -84,6 +84,9 @@ See also: - @cpp "intel-windows-half-baked-dsa-texture-bind" @ce fixing texture binding inconsistencies (affected [mosra/magnum-examples#55](https://github.com/mosra/magnum-examples/issues/55) as well) + - @cpp "intel-windows-broken-dsa-layered-cubemap-array-framebuffer-attachment" @ce + fixing @ref GL::Framebuffer::attachLayeredTexture() with + @ref GL::CubeMapTextureArray - New `--magnum-gpu-validation` @ref GL-Context-command-line "command-line option" and a corresponding environment variable to conveniently enable @gl_extension{KHR,debug} debug output diff --git a/src/Magnum/GL/Framebuffer.cpp b/src/Magnum/GL/Framebuffer.cpp index 47da81d98..ee5eff1bb 100644 --- a/src/Magnum/GL/Framebuffer.cpp +++ b/src/Magnum/GL/Framebuffer.cpp @@ -317,7 +317,7 @@ Framebuffer& Framebuffer::attachLayeredTexture(const BufferAttachment attachment } Framebuffer& Framebuffer::attachLayeredTexture(const BufferAttachment attachment, CubeMapTextureArray& texture, const Int level) { - (this->*Context::current().state().framebuffer->textureImplementation)(attachment, texture.id(), level); + (this->*Context::current().state().framebuffer->layeredTextureCubeMapArrayImplementation)(attachment, texture.id(), level); return *this; } diff --git a/src/Magnum/GL/Implementation/FramebufferState.cpp b/src/Magnum/GL/Implementation/FramebufferState.cpp index d5682d80e..96ab2cce7 100644 --- a/src/Magnum/GL/Implementation/FramebufferState.cpp +++ b/src/Magnum/GL/Implementation/FramebufferState.cpp @@ -155,6 +155,26 @@ FramebufferState::FramebufferState(Context& context, std::vector& e textureCubeMapImplementation = &Framebuffer::texture2DImplementationDefault; } + #if !defined(MAGNUM_TARGET_WEBGL) && !defined(MAGNUM_TARGET_GLES2) + /* DSA/non-DSA implementation for attaching layered cubemap arrays, because + ... well, guess why. */ + #ifndef MAGNUM_TARGET_GLES + if(context.isExtensionSupported() + #ifdef CORRADE_TARGET_WINDOWS + && (!(context.detectedDriver() & Context::DetectedDriver::IntelWindows) || + context.isDriverWorkaroundDisabled("intel-windows-broken-dsa-layered-cubemap-array-framebuffer-attachment")) + #endif + ) { + /* Extension name added above */ + + layeredTextureCubeMapArrayImplementation = &Framebuffer::textureImplementationDSA; + } else + #endif + { + layeredTextureCubeMapArrayImplementation = &Framebuffer::textureImplementationDefault; + } + #endif + /* Framebuffer texture attachment on ES3 */ #if defined(MAGNUM_TARGET_GLES) && !defined(MAGNUM_TARGET_WEBGL) && !defined(MAGNUM_TARGET_GLES2) if(context.isVersionSupported(Version::GLES320)) diff --git a/src/Magnum/GL/Implementation/FramebufferState.h b/src/Magnum/GL/Implementation/FramebufferState.h index e27ad72bd..8b0ff0801 100644 --- a/src/Magnum/GL/Implementation/FramebufferState.h +++ b/src/Magnum/GL/Implementation/FramebufferState.h @@ -95,6 +95,7 @@ struct FramebufferState { void(Framebuffer::*textureCubeMapImplementation)(Framebuffer::BufferAttachment, GLenum, GLuint, GLint); #if !defined(MAGNUM_TARGET_WEBGL) && !defined(MAGNUM_TARGET_GLES2) void(Framebuffer::*textureImplementation)(Framebuffer::BufferAttachment, GLuint, GLint); + void(Framebuffer::*layeredTextureCubeMapArrayImplementation)(Framebuffer::BufferAttachment, GLuint, GLint); #endif #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) void(Framebuffer::*textureLayerImplementation)(Framebuffer::BufferAttachment, GLuint, GLint, GLint); diff --git a/src/Magnum/GL/Implementation/driverSpecific.cpp b/src/Magnum/GL/Implementation/driverSpecific.cpp index 80aa2a015..ac5d97aa4 100644 --- a/src/Magnum/GL/Implementation/driverSpecific.cpp +++ b/src/Magnum/GL/Implementation/driverSpecific.cpp @@ -224,6 +224,12 @@ namespace { maps. Using the non-DSA code path for unbinding and cube maps as a workaround. */ "intel-windows-half-baked-dsa-texture-bind", + + /* DSA glNamedFramebufferTexture() on Intel Windows drivers doesn't + work for layered cube map array attachments. Non-layered or + non-array cube map attachment works. Using the non-DSA code path as + a workaround. */ + "intel-windows-broken-dsa-layered-cubemap-array-framebuffer-attachment", #endif #ifndef MAGNUM_TARGET_GLES