Commit 571ceb5f by shrekshao Committed by Commit Bot

Turn on clampArrayAccess globally but off for compute shaders

out-of-bounds-uniform-array-access.html could fail on Linux Nvidia OpenGL even if GL_KHR_robust_buffer_access_behavior is available. Turning clampArrayAccess on globally but turn it off for Compute Shader, which is not used by WebGL so should be okay. FYI: The failures when turning this on globally are all in compute shaders. One could be fixed by using int cast instead of float for the clamp modifier. The other is due to array.length() couldn't return correct result for array in SSBO. Bug: chromium:1042252 Change-Id: Ic6f7adae4600d35207646881b18990a0c25a889a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2020463 Commit-Queue: Shrek Shao <shrekshao@google.com> Reviewed-by: 's avatarKenneth Russell <kbr@chromium.org>
parent cc414d57
...@@ -617,7 +617,7 @@ bool TCompiler::checkAndSimplifyAST(TIntermBlock *root, ...@@ -617,7 +617,7 @@ bool TCompiler::checkAndSimplifyAST(TIntermBlock *root,
} }
// Clamping uniform array bounds needs to happen after validateLimitations pass. // Clamping uniform array bounds needs to happen after validateLimitations pass.
if (compileOptions & SH_CLAMP_INDIRECT_ARRAY_BOUNDS) if (compileOptions & SH_CLAMP_INDIRECT_ARRAY_BOUNDS && mShaderType != GL_COMPUTE_SHADER)
{ {
mArrayBoundsClamper.MarkIndirectArrayBoundsForClamping(root); mArrayBoundsClamper.MarkIndirectArrayBoundsForClamping(root);
} }
......
...@@ -1599,9 +1599,9 @@ void InitializeFeatures(const FunctionsGL *functions, angle::FeaturesGL *feature ...@@ -1599,9 +1599,9 @@ void InitializeFeatures(const FunctionsGL *functions, angle::FeaturesGL *feature
// The WebGL conformance/uniforms/out-of-bounds-uniform-array-access test has been seen to fail // The WebGL conformance/uniforms/out-of-bounds-uniform-array-access test has been seen to fail
// on AMD and Android devices. // on AMD and Android devices.
ANGLE_FEATURE_CONDITION( // This test is also flaky on Linux Nvidia. So we just turn it on everywhere and don't rely on
features, clampArrayAccess, // driver since security is important.
IsAndroid() || isAMD || !functions->hasExtension("GL_KHR_robust_buffer_access_behavior")); ANGLE_FEATURE_CONDITION(features, clampArrayAccess, true);
ANGLE_FEATURE_CONDITION(features, resetTexImage2DBaseLevel, ANGLE_FEATURE_CONDITION(features, resetTexImage2DBaseLevel,
IsApple() && isIntel && GetMacOSVersion() >= OSVersion(10, 12, 4)); IsApple() && isIntel && GetMacOSVersion() >= OSVersion(10, 12, 4));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment