Browse Source

GL: new "intel-windows-broken-dsa-framebuffer-clear" workaround.

I'm too lazy to write the commit messages now.
pull/331/head
Vladimír Vondruš 7 years ago
parent
commit
174e63e8d0
  1. 2
      doc/changelog.dox
  2. 38
      src/Magnum/GL/Implementation/FramebufferState.cpp
  3. 4
      src/Magnum/GL/Implementation/driverSpecific.cpp

2
doc/changelog.dox

@ -87,6 +87,8 @@ See also:
- @cpp "intel-windows-broken-dsa-layered-cubemap-array-framebuffer-attachment" @ce - @cpp "intel-windows-broken-dsa-layered-cubemap-array-framebuffer-attachment" @ce
fixing @ref GL::Framebuffer::attachLayeredTexture() with fixing @ref GL::Framebuffer::attachLayeredTexture() with
@ref GL::CubeMapTextureArray @ref GL::CubeMapTextureArray
- @cpp "intel-windows-broken-dsa-framebuffer-clear" @ce
fixing @ref GL::Framebuffer::clearColor()
- 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

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

@ -65,11 +65,6 @@ FramebufferState::FramebufferState(Context& context, std::vector<std::string>& e
checkStatusImplementation = &AbstractFramebuffer::checkStatusImplementationDSA; checkStatusImplementation = &AbstractFramebuffer::checkStatusImplementationDSA;
clearIImplementation = &AbstractFramebuffer::clearImplementationDSA;
clearUIImplementation = &AbstractFramebuffer::clearImplementationDSA;
clearFImplementation = &AbstractFramebuffer::clearImplementationDSA;
clearFIImplementation = &AbstractFramebuffer::clearImplementationDSA;
drawBuffersImplementation = &AbstractFramebuffer::drawBuffersImplementationDSA; drawBuffersImplementation = &AbstractFramebuffer::drawBuffersImplementationDSA;
drawBufferImplementation = &AbstractFramebuffer::drawBufferImplementationDSA; drawBufferImplementation = &AbstractFramebuffer::drawBufferImplementationDSA;
readBufferImplementation = &AbstractFramebuffer::readBufferImplementationDSA; readBufferImplementation = &AbstractFramebuffer::readBufferImplementationDSA;
@ -94,13 +89,6 @@ FramebufferState::FramebufferState(Context& context, std::vector<std::string>& e
{ {
checkStatusImplementation = &AbstractFramebuffer::checkStatusImplementationDefault; checkStatusImplementation = &AbstractFramebuffer::checkStatusImplementationDefault;
#ifndef MAGNUM_TARGET_GLES2
clearIImplementation = &AbstractFramebuffer::clearImplementationDefault;
clearUIImplementation = &AbstractFramebuffer::clearImplementationDefault;
clearFImplementation = &AbstractFramebuffer::clearImplementationDefault;
clearFIImplementation = &AbstractFramebuffer::clearImplementationDefault;
#endif
#ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES2
drawBuffersImplementation = &AbstractFramebuffer::drawBuffersImplementationDefault; drawBuffersImplementation = &AbstractFramebuffer::drawBuffersImplementationDefault;
#endif #endif
@ -175,6 +163,32 @@ FramebufferState::FramebufferState(Context& context, std::vector<std::string>& e
} }
#endif #endif
/* DSA/non-DSA implementation for framebuffer clearing. Yes, it's because
Intel Windows drivers are shit. */
#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-framebuffer-clear"))
#endif
) {
/* Extension name added above */
clearIImplementation = &AbstractFramebuffer::clearImplementationDSA;
clearUIImplementation = &AbstractFramebuffer::clearImplementationDSA;
clearFImplementation = &AbstractFramebuffer::clearImplementationDSA;
clearFIImplementation = &AbstractFramebuffer::clearImplementationDSA;
} else
#endif
{
#ifndef MAGNUM_TARGET_GLES2
clearIImplementation = &AbstractFramebuffer::clearImplementationDefault;
clearUIImplementation = &AbstractFramebuffer::clearImplementationDefault;
clearFImplementation = &AbstractFramebuffer::clearImplementationDefault;
clearFIImplementation = &AbstractFramebuffer::clearImplementationDefault;
#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))

4
src/Magnum/GL/Implementation/driverSpecific.cpp

@ -230,6 +230,10 @@ namespace {
non-array cube map attachment works. Using the non-DSA code path as non-array cube map attachment works. Using the non-DSA code path as
a workaround. */ a workaround. */
"intel-windows-broken-dsa-layered-cubemap-array-framebuffer-attachment", "intel-windows-broken-dsa-layered-cubemap-array-framebuffer-attachment",
/* DSA glClearNamedFramebuffer*() on Intel Windows drivers doesn't do
anything. Using the non-DSA code path as a workaournd. */
"intel-windows-broken-dsa-framebuffer-clear",
#endif #endif
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES

Loading…
Cancel
Save