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
@ref GL::Mesh::addVertexBuffer() with @ref Magnum::Short "Short"
attributes
- New @cpp "amd-windows-cubemap-image3d-slice-by-slice" @ce workaround for
broken handling of cube map image download and upload in DSA APIs on AMD
Windows drivers
- New AMD Windows driver workarounds, related to
@gl_extension{ARB,direct_state_access} as well --- see
@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
@ref GL::Context::DetectedDriver::ArmMali "ARM Mali" drivers on 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() {
glCreateQueries(_target, 1, &_id);
}
void AbstractQuery::createImplementationDSAExceptXfbOverflow() {
if(_target == GL_TRANSFORM_FEEDBACK_OVERFLOW || _target == GL_TRANSFORM_FEEDBACK_STREAM_OVERFLOW)
createImplementationDefault();
else
createImplementationDSA();
}
#endif
#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();
#ifndef MAGNUM_TARGET_GLES
void MAGNUM_GL_LOCAL createImplementationDSA();
void MAGNUM_GL_LOCAL createImplementationDSAExceptXfbOverflow();
#endif
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) {
/* Create implementation */
#ifndef MAGNUM_TARGET_GLES
if(context.isExtensionSupported<Extensions::ARB::direct_state_access>()
if(context.isExtensionSupported<Extensions::ARB::direct_state_access>()) {
#ifdef CORRADE_TARGET_WINDOWS
&& (!(context.detectedDriver() & Context::DetectedDriver::IntelWindows) ||
context.isDriverWorkaroundDisabled("intel-windows-broken-dsa-indexed-queries"))
if((context.detectedDriver() & Context::DetectedDriver::IntelWindows) && !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
) {
extensions.emplace_back(Extensions::ARB::direct_state_access::string());
createImplementation = &AbstractQuery::createImplementationDSA;
{
extensions.emplace_back(Extensions::ARB::direct_state_access::string());
createImplementation = &AbstractQuery::createImplementationDSA;
}
} else
#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
slicing and offset calculation, so those currently still fail. */
"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
#if !defined(MAGNUM_TARGET_GLES) && !defined(CORRADE_TARGET_APPLE)

Loading…
Cancel
Save