Browse Source

Work around a bug with DSA glNamedBufferData() in SVGA3D driver.

For some reason a buffer *allocated* with this function caused
Mesh::draw() to draw nothing. I gave up on investigating the root cause
-- using non-DSA glBufferData() "just works", so in case of this driver
the "svga3d-broken-dsa-bufferdata" workaround uses the non-DSA code
path.
pull/203/merge
Vladimír Vondruš 9 years ago
parent
commit
5d3e2e4223
  1. 9
      src/Magnum/Implementation/BufferState.cpp
  2. 9
      src/Magnum/Implementation/driverSpecific.cpp

9
src/Magnum/Implementation/BufferState.cpp

@ -178,6 +178,15 @@ BufferState::BufferState(Context& context, std::vector<std::string>& extensions)
} }
#endif #endif
#ifndef MAGNUM_TARGET_GLES
if(context.isExtensionSupported<Extensions::GL::ARB::direct_state_access>() &&
(context.detectedDriver() & Context::DetectedDriver::Svga3D) &&
!context.isDriverWorkaroundDisabled("svga3d-broken-dsa-bufferdata"))
{
dataImplementation = &Buffer::dataImplementationDefault;
}
#endif
#ifdef MAGNUM_TARGET_GLES #ifdef MAGNUM_TARGET_GLES
static_cast<void>(context); static_cast<void>(context);
static_cast<void>(extensions); static_cast<void>(extensions);

9
src/Magnum/Implementation/driverSpecific.cpp

@ -88,7 +88,14 @@ namespace {
/* NaCl advertises some additional extensions but the GLESv2 library /* NaCl advertises some additional extensions but the GLESv2 library
does not have any entrypoints for them and there is no GetProcAddress does not have any entrypoints for them and there is no GetProcAddress
equivalent, thus marking them as unsupported. */ equivalent, thus marking them as unsupported. */
"nacl-missing-extension-entrypoints" "nacl-missing-extension-entrypoints",
#endif
#ifndef MAGNUM_TARGET_GLES
/* SVGA3D (VMware host GL driver) glDrawArrays() draws nothing when the
vertex buffer memory is initialized using glNamedBufferData() from
ARB_DSA. Using the non-DSA glBufferData() works. */
"svga3d-broken-dsa-bufferdata",
#endif #endif
}; };
} }

Loading…
Cancel
Save