Browse Source

GL: "intel-windows-broken-dsa-layered-cubemap-array-framebuffer-attachment".

New workaround. The names are getting too effing long.
pull/331/head
Vladimír Vondruš 7 years ago
parent
commit
89e1c49d2c
  1. 3
      doc/changelog.dox
  2. 2
      src/Magnum/GL/Framebuffer.cpp
  3. 20
      src/Magnum/GL/Implementation/FramebufferState.cpp
  4. 1
      src/Magnum/GL/Implementation/FramebufferState.h
  5. 6
      src/Magnum/GL/Implementation/driverSpecific.cpp

3
doc/changelog.dox

@ -84,6 +84,9 @@ See also:
- @cpp "intel-windows-half-baked-dsa-texture-bind" @ce fixing texture - @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) binding inconsistencies (affected [mosra/magnum-examples#55](https://github.com/mosra/magnum-examples/issues/55)
as well) 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" - New `--magnum-gpu-validation` @ref GL-Context-command-line "command-line option"
and a corresponding environment variable to conveniently enable and a corresponding environment variable to conveniently enable
@gl_extension{KHR,debug} debug output @gl_extension{KHR,debug} debug output

2
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) { 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; return *this;
} }

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

@ -155,6 +155,26 @@ FramebufferState::FramebufferState(Context& context, std::vector<std::string>& e
textureCubeMapImplementation = &Framebuffer::texture2DImplementationDefault; 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<Extensions::ARB::direct_state_access>()
#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 */ /* Framebuffer texture attachment on ES3 */
#if defined(MAGNUM_TARGET_GLES) && !defined(MAGNUM_TARGET_WEBGL) && !defined(MAGNUM_TARGET_GLES2) #if defined(MAGNUM_TARGET_GLES) && !defined(MAGNUM_TARGET_WEBGL) && !defined(MAGNUM_TARGET_GLES2)
if(context.isVersionSupported(Version::GLES320)) if(context.isVersionSupported(Version::GLES320))

1
src/Magnum/GL/Implementation/FramebufferState.h

@ -95,6 +95,7 @@ struct FramebufferState {
void(Framebuffer::*textureCubeMapImplementation)(Framebuffer::BufferAttachment, GLenum, GLuint, GLint); void(Framebuffer::*textureCubeMapImplementation)(Framebuffer::BufferAttachment, GLenum, GLuint, GLint);
#if !defined(MAGNUM_TARGET_WEBGL) && !defined(MAGNUM_TARGET_GLES2) #if !defined(MAGNUM_TARGET_WEBGL) && !defined(MAGNUM_TARGET_GLES2)
void(Framebuffer::*textureImplementation)(Framebuffer::BufferAttachment, GLuint, GLint); void(Framebuffer::*textureImplementation)(Framebuffer::BufferAttachment, GLuint, GLint);
void(Framebuffer::*layeredTextureCubeMapArrayImplementation)(Framebuffer::BufferAttachment, GLuint, GLint);
#endif #endif
#if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2))
void(Framebuffer::*textureLayerImplementation)(Framebuffer::BufferAttachment, GLuint, GLint, GLint); void(Framebuffer::*textureLayerImplementation)(Framebuffer::BufferAttachment, GLuint, GLint, GLint);

6
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 maps. Using the non-DSA code path for unbinding and cube maps as a
workaround. */ workaround. */
"intel-windows-half-baked-dsa-texture-bind", "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 #endif
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES

Loading…
Cancel
Save