From 3c1a12c6771c2a289652ef9d660a50de0fc695a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 16 Mar 2019 13:26:52 +0100 Subject: [PATCH] GL: new "intel-windows-broken-dsa-indexed-queries" workaround. --- doc/changelog.dox | 2 ++ src/Magnum/GL/Implementation/QueryState.cpp | 7 ++++++- src/Magnum/GL/Implementation/driverSpecific.cpp | 5 +++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/doc/changelog.dox b/doc/changelog.dox index a3a37e6a6..408ca3295 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -89,6 +89,8 @@ See also: @ref GL::CubeMapTextureArray - @cpp "intel-windows-broken-dsa-framebuffer-clear" @ce fixing @ref GL::Framebuffer::clearColor() + - @cpp "intel-windows-broken-dsa-indexed-queries" @ce fixing + @ref GL::PrimitiveQuery::begin(UnsignedInt) - 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/Implementation/QueryState.cpp b/src/Magnum/GL/Implementation/QueryState.cpp index 851924010..e0d8b30ce 100644 --- a/src/Magnum/GL/Implementation/QueryState.cpp +++ b/src/Magnum/GL/Implementation/QueryState.cpp @@ -34,7 +34,12 @@ namespace Magnum { namespace GL { namespace Implementation { QueryState::QueryState(Context& context, std::vector& extensions) { /* Create implementation */ #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-indexed-queries")) + #endif + ) { extensions.emplace_back(Extensions::ARB::direct_state_access::string()); createImplementation = &AbstractQuery::createImplementationDSA; diff --git a/src/Magnum/GL/Implementation/driverSpecific.cpp b/src/Magnum/GL/Implementation/driverSpecific.cpp index fdb8053a3..65e4d1dd2 100644 --- a/src/Magnum/GL/Implementation/driverSpecific.cpp +++ b/src/Magnum/GL/Implementation/driverSpecific.cpp @@ -234,6 +234,11 @@ namespace { /* 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", + + /* Using DSA glCreateQueries() on Intel Windows drivers breaks + glBeginQueryIndexed(). Using the non-DSA glGenQueries() instead + makes it work properly. See TransformFeedbackGLTest for a test. */ + "intel-windows-broken-dsa-indexed-queries", #endif #ifndef MAGNUM_TARGET_GLES