|
|
|
@ -34,10 +34,35 @@ namespace Magnum { |
|
|
|
|
|
|
|
|
|
|
|
namespace { |
|
|
|
namespace { |
|
|
|
std::vector<std::string> KnownWorkarounds{ |
|
|
|
std::vector<std::string> KnownWorkarounds{ |
|
|
|
|
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
/* Creating core context with specific version on AMD and NV
|
|
|
|
/* Creating core context with specific version on AMD and NV
|
|
|
|
proprietary drivers causes the context to be forced to given |
|
|
|
proprietary drivers causes the context to be forced to given |
|
|
|
version instead of selecting latest available version */ |
|
|
|
version instead of selecting latest available version */ |
|
|
|
"amd-nv-no-forward-compatible-core-context" |
|
|
|
"amd-nv-no-forward-compatible-core-context", |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Using ARB_explicit_uniform_location on AMD linux drivers 13.251
|
|
|
|
|
|
|
|
caused the GLSL compiler to crash */ |
|
|
|
|
|
|
|
"amd-explicit-uniform-location-crash", |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef CORRADE_TARGET_WINDOWS |
|
|
|
|
|
|
|
/* On Windows Intel drivers ARB_shading_language_420pack is exposed in
|
|
|
|
|
|
|
|
GLSL even though the extension (e.g. binding keyword) is not |
|
|
|
|
|
|
|
supported */ |
|
|
|
|
|
|
|
"intel-windows-glsl-exposes-unsupported-shading-language-420pack", |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Layout qualifier causes compiler error with GLSL 1.20 on Mesa, GLSL
|
|
|
|
|
|
|
|
1.30 on NVidia and 1.40 on Mac OS X. Everything is fine when using |
|
|
|
|
|
|
|
newer GLSL version. */ |
|
|
|
|
|
|
|
"no-layout-qualifiers-on-old-glsl", |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef CORRADE_TARGET_NACL |
|
|
|
|
|
|
|
/* NaCl advertises some additional extensions but the GLESv2 library
|
|
|
|
|
|
|
|
does not have any entrypoints for them and there is no GetProcAddress |
|
|
|
|
|
|
|
equivalent, thus marking them as unsupported. */ |
|
|
|
|
|
|
|
"nacl-missing-extension-entrypoints" |
|
|
|
|
|
|
|
#endif |
|
|
|
}; |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -132,27 +157,23 @@ void Context::setupDriverWorkarounds() { |
|
|
|
_extensionRequiredVersion[Extensions::extension::Index] = Version::version |
|
|
|
_extensionRequiredVersion[Extensions::extension::Index] = Version::version |
|
|
|
|
|
|
|
|
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
/* This extension causes crash in GLSL compiler on AMD linux drivers 13.251 */ |
|
|
|
if((detectedDriver() & DetectedDriver::AMD) && !isDriverWorkaroundDisabled("amd-explicit-uniform-location-crash")) |
|
|
|
if(detectedDriver() & DetectedDriver::AMD) |
|
|
|
|
|
|
|
_setRequiredVersion(GL::ARB::explicit_uniform_location, None); |
|
|
|
_setRequiredVersion(GL::ARB::explicit_uniform_location, None); |
|
|
|
|
|
|
|
|
|
|
|
#ifdef CORRADE_TARGET_WINDOWS |
|
|
|
#ifdef CORRADE_TARGET_WINDOWS |
|
|
|
/* On Windows Intel drivers ARB_shading_language_420pack is exposed in GLSL
|
|
|
|
if((detectedDriver() & DetectedDriver::IntelWindows) && !isExtensionSupported<Extensions::GL::ARB::shading_language_420pack>() && !isDriverWorkaroundDisabled("intel-windows-glsl-exposes-unsupported-shading-language-420pack")) |
|
|
|
even that the extension (e.g. binding keyword) is not supported */ |
|
|
|
|
|
|
|
if((detectedDriver() & DetectedDriver::IntelWindows) && !isExtensionSupported<Extensions::GL::ARB::shading_language_420pack>()) |
|
|
|
|
|
|
|
_setRequiredVersion(GL::ARB::shading_language_420pack, None); |
|
|
|
_setRequiredVersion(GL::ARB::shading_language_420pack, None); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
/* Layout qualifier causes compiler error with GLSL 1.20 on Mesa, GLSL 1.30
|
|
|
|
if(!isDriverWorkaroundDisabled("no-layout-qualifiers-on-old-glsl")) { |
|
|
|
on NVidia and 1.40 on Mac OS X */ |
|
|
|
|
|
|
|
/** @todo Different version on different vendors? */ |
|
|
|
|
|
|
|
_setRequiredVersion(GL::ARB::explicit_attrib_location, GL320); |
|
|
|
_setRequiredVersion(GL::ARB::explicit_attrib_location, GL320); |
|
|
|
_setRequiredVersion(GL::ARB::explicit_uniform_location, GL320); |
|
|
|
_setRequiredVersion(GL::ARB::explicit_uniform_location, GL320); |
|
|
|
_setRequiredVersion(GL::ARB::shading_language_420pack, GL320); |
|
|
|
_setRequiredVersion(GL::ARB::shading_language_420pack, GL320); |
|
|
|
|
|
|
|
} |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
/* Disable extensions not available on NaCl */ |
|
|
|
|
|
|
|
#ifdef CORRADE_TARGET_NACL |
|
|
|
#ifdef CORRADE_TARGET_NACL |
|
|
|
|
|
|
|
if(!isDriverWorkaroundDisabled("nacl-missing-extension-entrypoints")) { |
|
|
|
_setRequiredVersion(GL::EXT::multi_draw_arrays, None); |
|
|
|
_setRequiredVersion(GL::EXT::multi_draw_arrays, None); |
|
|
|
_setRequiredVersion(GL::EXT::debug_label, None); |
|
|
|
_setRequiredVersion(GL::EXT::debug_label, None); |
|
|
|
_setRequiredVersion(GL::EXT::debug_marker, None); |
|
|
|
_setRequiredVersion(GL::EXT::debug_marker, None); |
|
|
|
@ -182,6 +203,7 @@ void Context::setupDriverWorkarounds() { |
|
|
|
_setRequiredVersion(GL::NV::instanced_arrays, None); |
|
|
|
_setRequiredVersion(GL::NV::instanced_arrays, None); |
|
|
|
_setRequiredVersion(GL::OES::texture_3D, None); |
|
|
|
_setRequiredVersion(GL::OES::texture_3D, None); |
|
|
|
_setRequiredVersion(GL::OES::vertex_array_object, None); |
|
|
|
_setRequiredVersion(GL::OES::vertex_array_object, None); |
|
|
|
|
|
|
|
} |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#undef _setRequiredVersion |
|
|
|
#undef _setRequiredVersion |
|
|
|
|