Browse Source

SVGA3D: disable GL_ARB_get_texture_sub_image altogether.

In some cases it causes OOB writes, corrupting application memory.
Nasty.
pull/203/merge
Vladimír Vondruš 9 years ago
parent
commit
e255a01ce3
  1. 12
      src/Magnum/Implementation/driverSpecific.cpp

12
src/Magnum/Implementation/driverSpecific.cpp

@ -97,6 +97,11 @@ namespace {
vertex buffer memory is initialized using glNamedBufferData() from
ARB_DSA. Using the non-DSA glBufferData() works. */
"svga3d-broken-dsa-bufferdata",
/* SVGA3D does out-of-bound writes in some cases of glGetTexSubImage(),
leading to memory corruption on client machines. That's nasty, so the
whole ARB_get_texture_sub_image is disabled. */
"svga3d-gettexsubimage-oob-write",
#endif
};
}
@ -257,6 +262,13 @@ void Context::setupDriverWorkarounds() {
}
#endif
#ifndef MAGNUM_TARGET_GLES
if((detectedDriver() & DetectedDriver::Svga3D) &&
isExtensionSupported<Extensions::GL::ARB::get_texture_sub_image>() &&
!isDriverWorkaroundDisabled("svga3d-gettexsubimage-oob-write"))
_setRequiredVersion(GL::ARB::get_texture_sub_image, None);
#endif
#undef _setRequiredVersion
}

Loading…
Cancel
Save