summaryrefslogtreecommitdiffstats
path: root/gfx/angle/src/compiler/translator
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2020-01-16 01:31:47 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2020-01-16 01:31:47 +0100
commit058105eec0564943dd872a7ae43cd8a5b94f0abf (patch)
treeed85f6708c7cc4a42dabd07d855f1e8f38ffc23c /gfx/angle/src/compiler/translator
parent82804d200236658ba6dfaa814d6e71661781fe19 (diff)
downloadUXP-058105eec0564943dd872a7ae43cd8a5b94f0abf.tar
UXP-058105eec0564943dd872a7ae43cd8a5b94f0abf.tar.gz
UXP-058105eec0564943dd872a7ae43cd8a5b94f0abf.tar.lz
UXP-058105eec0564943dd872a7ae43cd8a5b94f0abf.tar.xz
UXP-058105eec0564943dd872a7ae43cd8a5b94f0abf.zip
Issue #1354 - Cherry-pick ANGLE update for broken drivers that support
required indexing but not the extensions.
Diffstat (limited to 'gfx/angle/src/compiler/translator')
-rwxr-xr-xgfx/angle/src/compiler/translator/TranslatorGLSL.cpp20
1 files changed, 7 insertions, 13 deletions
diff --git a/gfx/angle/src/compiler/translator/TranslatorGLSL.cpp b/gfx/angle/src/compiler/translator/TranslatorGLSL.cpp
index 0ee96f590..0d72e2bbb 100755
--- a/gfx/angle/src/compiler/translator/TranslatorGLSL.cpp
+++ b/gfx/angle/src/compiler/translator/TranslatorGLSL.cpp
@@ -240,20 +240,14 @@ void TranslatorGLSL::writeExtensionBehavior(TIntermNode *root)
}
// Need to enable gpu_shader5 to have index constant sampler array indexing
- if (getOutputType() != SH_ESSL_OUTPUT && getOutputType() < SH_GLSL_400_CORE_OUTPUT)
+ if (getOutputType() != SH_ESSL_OUTPUT && getOutputType() < SH_GLSL_400_CORE_OUTPUT &&
+ getShaderVersion() == 100)
{
- sink << "#extension GL_ARB_gpu_shader5 : ";
-
- // Don't use "require" on WebGL 1 to avoid breaking WebGL on drivers that silently
- // support index constant sampler array indexing, but don't have the extension.
- if (getShaderVersion() >= 300)
- {
- sink << "require\n";
- }
- else
- {
- sink << "enable\n";
- }
+ // Don't use "require" to avoid breaking WebGL 1 on drivers that silently
+ // support index constant sampler array indexing, but don't have the extension or
+ // on drivers that don't have the extension at all as it would break WebGL 1 for
+ // some users.
+ sink << "#extension GL_ARB_gpu_shader5 : enable\n";
}
TExtensionGLSL extensionGLSL(getOutputType());