Browse Source

GL: new amd-windows-dsa-createquery-except-xfb-overflow workaround.

pull/388/head
Vladimír Vondruš 7 years ago
parent
commit
9fa87652e6
  1. 11
      doc/changelog.dox
  2. 7
      src/Magnum/GL/AbstractQuery.cpp
  3. 1
      src/Magnum/GL/AbstractQuery.h
  4. 18
      src/Magnum/GL/Implementation/QueryState.cpp
  5. 6
      src/Magnum/GL/Implementation/driverSpecific.cpp

11
doc/changelog.dox

@ -188,9 +188,14 @@ See also:
- @cpp "intel-windows-broken-dsa-integer-vertex-attributes" @ce fixing - @cpp "intel-windows-broken-dsa-integer-vertex-attributes" @ce fixing
@ref GL::Mesh::addVertexBuffer() with @ref Magnum::Short "Short" @ref GL::Mesh::addVertexBuffer() with @ref Magnum::Short "Short"
attributes attributes
- New @cpp "amd-windows-cubemap-image3d-slice-by-slice" @ce workaround for - New AMD Windows driver workarounds, related to
broken handling of cube map image download and upload in DSA APIs on AMD @gl_extension{ARB,direct_state_access} as well --- see
Windows drivers @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-dsa-createquery-except-xfb-overflow" @ce using a
non-DSA code path for creating
@ref PrimitiveQuery::Target::TransformFeedbackOverflow queries
- New @cpp "arm-mali-timer-queries-oom-in-shell" @ce workaround for - New @cpp "arm-mali-timer-queries-oom-in-shell" @ce workaround for
@ref GL::Context::DetectedDriver::ArmMali "ARM Mali" drivers on Android @ref GL::Context::DetectedDriver::ArmMali "ARM Mali" drivers on Android
disabling the @gl_extension{EXT,disjoint_timer_query} extension in Android disabling the @gl_extension{EXT,disjoint_timer_query} extension in Android

7
src/Magnum/GL/AbstractQuery.cpp

@ -64,6 +64,13 @@ void AbstractQuery::createImplementationDefault() {
void AbstractQuery::createImplementationDSA() { void AbstractQuery::createImplementationDSA() {
glCreateQueries(_target, 1, &_id); glCreateQueries(_target, 1, &_id);
} }
void AbstractQuery::createImplementationDSAExceptXfbOverflow() {
if(_target == GL_TRANSFORM_FEEDBACK_OVERFLOW || _target == GL_TRANSFORM_FEEDBACK_STREAM_OVERFLOW)
createImplementationDefault();
else
createImplementationDSA();
}
#endif #endif
#ifndef MAGNUM_TARGET_WEBGL #ifndef MAGNUM_TARGET_WEBGL

1
src/Magnum/GL/AbstractQuery.h

@ -190,6 +190,7 @@ class MAGNUM_GL_EXPORT AbstractQuery: public AbstractObject {
void MAGNUM_GL_LOCAL createImplementationDefault(); void MAGNUM_GL_LOCAL createImplementationDefault();
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
void MAGNUM_GL_LOCAL createImplementationDSA(); void MAGNUM_GL_LOCAL createImplementationDSA();
void MAGNUM_GL_LOCAL createImplementationDSAExceptXfbOverflow();
#endif #endif
ObjectFlags _flags; ObjectFlags _flags;

18
src/Magnum/GL/Implementation/QueryState.cpp

@ -34,15 +34,19 @@ namespace Magnum { namespace GL { namespace Implementation {
QueryState::QueryState(Context& context, std::vector<std::string>& extensions) { QueryState::QueryState(Context& context, std::vector<std::string>& extensions) {
/* Create implementation */ /* Create implementation */
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
if(context.isExtensionSupported<Extensions::ARB::direct_state_access>() if(context.isExtensionSupported<Extensions::ARB::direct_state_access>()) {
#ifdef CORRADE_TARGET_WINDOWS #ifdef CORRADE_TARGET_WINDOWS
&& (!(context.detectedDriver() & Context::DetectedDriver::IntelWindows) || if((context.detectedDriver() & Context::DetectedDriver::IntelWindows) && !context.isDriverWorkaroundDisabled("intel-windows-broken-dsa-indexed-queries")) {
context.isDriverWorkaroundDisabled("intel-windows-broken-dsa-indexed-queries")) createImplementation = &AbstractQuery::createImplementationDefault;
} else if((context.detectedDriver() & Context::DetectedDriver::Amd) && !context.isDriverWorkaroundDisabled("amd-windows-dsa-createquery-except-xfb-overflow")) {
extensions.emplace_back(Extensions::ARB::direct_state_access::string());
createImplementation = &AbstractQuery::createImplementationDSAExceptXfbOverflow;
} else
#endif #endif
) { {
extensions.emplace_back(Extensions::ARB::direct_state_access::string()); extensions.emplace_back(Extensions::ARB::direct_state_access::string());
createImplementation = &AbstractQuery::createImplementationDSA; createImplementation = &AbstractQuery::createImplementationDSA;
}
} else } else
#endif #endif
{ {

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

@ -57,6 +57,12 @@ namespace {
download is affected as well, but we lack APIs for easy format-dependent download is affected as well, but we lack APIs for easy format-dependent
slicing and offset calculation, so those currently still fail. */ slicing and offset calculation, so those currently still fail. */
"amd-windows-cubemap-image3d-slice-by-slice", "amd-windows-cubemap-image3d-slice-by-slice",
/* 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
instead. */
"amd-windows-dsa-createquery-except-xfb-overflow",
#endif #endif
#if !defined(MAGNUM_TARGET_GLES) && !defined(CORRADE_TARGET_APPLE) #if !defined(MAGNUM_TARGET_GLES) && !defined(CORRADE_TARGET_APPLE)

Loading…
Cancel
Save