- Revision
- 160199
- Author
- [email protected]
- Date
- 2013-12-05 15:45:28 -0800 (Thu, 05 Dec 2013)
Log Message
[WebGL] Make sure we satisfy uniform and varying packing restrictions.
https://bugs.webkit.org/show_bug.cgi?id=125124.
<rdar://problem/15203291>
Reviewed by Brent Fulgham.
Tests covered by WebGL Khronos conformance tests:
webgl/1.0.2/conformance/glsl/misc/shader-uniform-packing-restrictions.html
webgl/1.0.2/conformance/glsl/misc/shader-varying-packing-restrictions.html
* platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
(WebCore::Extensions3DOpenGLCommon::getTranslatedShaderSourceANGLE):
* src/compiler/Compiler.cpp:
Add a check to enforcePackingRestrictions to ensure we make sure packing restrictions for varyings are satisfied as well.
(TCompiler::TCompiler):
(TCompiler::Init):
(TCompiler::compile):
(TCompiler::enforcePackingRestrictions):
* src/compiler/ShHandle.h: Keep track of maximum varying vectors.
* platform/mac/TestExpectations: Unskip some 1.0.2 WebGL conformance tests that should now be passing.
Skip conformance/ogles/GL/build/build_009_to_016.html which is a faulty test and has too many varyings in one shader.
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (160198 => 160199)
--- trunk/LayoutTests/ChangeLog 2013-12-05 23:37:08 UTC (rev 160198)
+++ trunk/LayoutTests/ChangeLog 2013-12-05 23:45:28 UTC (rev 160199)
@@ -1,3 +1,14 @@
+2013-12-05 Roger Fong <[email protected]>
+
+ [WebGL] Make sure we satisfy uniform and varying packing restrictions.
+ https://bugs.webkit.org/show_bug.cgi?id=125124.
+ <rdar://problem/15203291>
+
+ Reviewed by Brent Fulgham.
+
+ * platform/mac/TestExpectations: Unskip some 1.0.2 WebGL conformance tests that should now be passing.
+ Skip conformance/ogles/GL/build/build_009_to_016.html which is a faulty test and has too many varyings in one shader.
+
2013-12-05 Alexandru Chiculita <[email protected]>
Web Inspector: [CSS Regions] Show a list of containing regions when clicking a node that is part of a flow
Modified: trunk/LayoutTests/platform/mac/TestExpectations (160198 => 160199)
--- trunk/LayoutTests/platform/mac/TestExpectations 2013-12-05 23:37:08 UTC (rev 160198)
+++ trunk/LayoutTests/platform/mac/TestExpectations 2013-12-05 23:45:28 UTC (rev 160199)
@@ -695,11 +695,8 @@
# Currently working on 1.0.2 conformance, skip currently known failing tests, <rdar://problem/12099869>
webgl/1.0.2/conformance/glsl/misc/shader-with-too-many-uniforms.html [ Failure ]
-webgl/1.0.2/conformance/extensions/webgl-compressed-texture-s3tc.html [ Failure ]
-webgl/1.0.2/conformance/glsl/misc/shader-uniform-packing-restrictions.html [ Failure Timeout ]
-webgl/1.0.2/conformance/glsl/misc/shader-varying-packing-restrictions.html [ Failure ]
+webgl/1.0.2/conformance/glsl/misc/shader-uniform-packing-restrictions.html [ Timeout ]
webgl/1.0.2/conformance/glsl/misc/shader-with-global-variable-precision-mismatch.html [ Failure ]
-webgl/1.0.2/conformance/glsl/misc/shader-with-short-circuiting-operators.html [ Failure ]
webgl/1.0.2/conformance/glsl/misc/shaders-with-varyings.html [ Failure ]
webgl/1.0.2/conformance/ogles/GL/biuDepthRange/biuDepthRange_001_to_002.html [ Failure ]
webgl/1.0.2/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_001_to_003.html [ Failure ]
@@ -708,6 +705,9 @@
webgl/1.0.2/conformance/typedarrays/array-unit-tests.html [ Failure ]
webgl/1.0.2/conformance/typedarrays/data-view-test.html [ Failure ]
+# Test is faulty, skipping for now
+webgl/1.0.2/conformance/ogles/GL/build/build_009_to_016.html [ Failure ]
+
# Skipping all webgl conformance tests on trunk
webgl/conformance
Modified: trunk/Source/ThirdParty/ANGLE/ChangeLog (160198 => 160199)
--- trunk/Source/ThirdParty/ANGLE/ChangeLog 2013-12-05 23:37:08 UTC (rev 160198)
+++ trunk/Source/ThirdParty/ANGLE/ChangeLog 2013-12-05 23:45:28 UTC (rev 160199)
@@ -1,3 +1,19 @@
+2013-12-05 Roger Fong <[email protected]>
+
+ [WebGL] Make sure we satisfy uniform and varying packing restrictions.
+ https://bugs.webkit.org/show_bug.cgi?id=125124.
+ <rdar://problem/15203291>
+
+ Reviewed by Brent Fulgham.
+
+ * src/compiler/Compiler.cpp:
+ Add a check to enforcePackingRestrictions to ensure we make sure packing restrictions for varyings are satisfied as well.
+ (TCompiler::TCompiler):
+ (TCompiler::Init):
+ (TCompiler::compile):
+ (TCompiler::enforcePackingRestrictions):
+ * src/compiler/ShHandle.h: Keep track of maximum varying vectors.
+
2013-12-05 Matthew Hanson <[email protected]>
Fix ANGLE build failures by re-comitting the changes in http://trac.webkit.org/changeset/154223
Modified: trunk/Source/ThirdParty/ANGLE/src/compiler/Compiler.cpp (160198 => 160199)
--- trunk/Source/ThirdParty/ANGLE/src/compiler/Compiler.cpp 2013-12-05 23:37:08 UTC (rev 160198)
+++ trunk/Source/ThirdParty/ANGLE/src/compiler/Compiler.cpp 2013-12-05 23:45:28 UTC (rev 160199)
@@ -74,6 +74,7 @@
: shaderType(type),
shaderSpec(spec),
maxUniformVectors(0),
+ maxVaryingVectors(0),
maxExpressionComplexity(0),
maxCallStackDepth(0),
fragmentPrecisionHigh(false),
@@ -94,6 +95,7 @@
maxUniformVectors = (shaderType == SH_VERTEX_SHADER) ?
resources.MaxVertexUniformVectors :
resources.MaxFragmentUniformVectors;
+ maxVaryingVectors = resources.MaxVaryingVectors;
maxExpressionComplexity = resources.MaxExpressionComplexity;
maxCallStackDepth = resources.MaxCallStackDepth;
@@ -203,13 +205,8 @@
if (success && (compileOptions & SH_VARIABLES)) {
collectVariables(root);
- if (compileOptions & SH_ENFORCE_PACKING_RESTRICTIONS) {
+ if (compileOptions & SH_ENFORCE_PACKING_RESTRICTIONS)
success = enforcePackingRestrictions();
- if (!success) {
- infoSink.info.prefix(EPrefixError);
- infoSink.info << "too many uniforms";
- }
- }
}
if (success && (compileOptions & SH_INTERMEDIATE_TREE))
@@ -399,7 +396,22 @@
bool TCompiler::enforcePackingRestrictions()
{
VariablePacker packer;
- return packer.CheckVariablesWithinPackingLimits(maxUniformVectors, uniforms);
+ bool success = packer.CheckVariablesWithinPackingLimits(maxUniformVectors, uniforms);
+ if (!success) {
+ infoSink.info.prefix(EPrefixError);
+ infoSink.info << "too many uniforms";
+ return false;
+ }
+
+ success = packer.CheckVariablesWithinPackingLimits(maxVaryingVectors, varyings);
+
+ if (!success) {
+ infoSink.info.prefix(EPrefixError);
+ infoSink.info << "too many varyings";
+ return false;
+ }
+
+ return true;
}
void TCompiler::mapLongVariableNames(TIntermNode* root)
Modified: trunk/Source/ThirdParty/ANGLE/src/compiler/ShHandle.h (160198 => 160199)
--- trunk/Source/ThirdParty/ANGLE/src/compiler/ShHandle.h 2013-12-05 23:37:08 UTC (rev 160198)
+++ trunk/Source/ThirdParty/ANGLE/src/compiler/ShHandle.h 2013-12-05 23:45:28 UTC (rev 160199)
@@ -98,7 +98,7 @@
// Translate to object code.
virtual void translate(TIntermNode* root) = 0;
// Returns true if, after applying the packing rules in the GLSL 1.017 spec
- // Appendix A, section 7, the shader does not use too many uniforms.
+ // Appendix A, section 7, the shader does not use too many uniforms or varyings.
bool enforcePackingRestrictions();
// Returns true if the shader passes the restrictions that aim to prevent timing attacks.
bool enforceTimingRestrictions(TIntermNode* root, bool outputGraph);
@@ -123,6 +123,7 @@
ShShaderSpec shaderSpec;
int maxUniformVectors;
+ int maxVaryingVectors;
int maxExpressionComplexity;
int maxCallStackDepth;
Modified: trunk/Source/WebCore/ChangeLog (160198 => 160199)
--- trunk/Source/WebCore/ChangeLog 2013-12-05 23:37:08 UTC (rev 160198)
+++ trunk/Source/WebCore/ChangeLog 2013-12-05 23:45:28 UTC (rev 160199)
@@ -1,3 +1,18 @@
+2013-12-05 Roger Fong <[email protected]>
+
+ [WebGL] Make sure we satisfy uniform and varying packing restrictions.
+ https://bugs.webkit.org/show_bug.cgi?id=125124.
+ <rdar://problem/15203291>
+
+ Reviewed by Brent Fulgham.
+
+ Tests covered by WebGL Khronos conformance tests:
+ webgl/1.0.2/conformance/glsl/misc/shader-uniform-packing-restrictions.html
+ webgl/1.0.2/conformance/glsl/misc/shader-varying-packing-restrictions.html
+
+ * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
+ (WebCore::Extensions3DOpenGLCommon::getTranslatedShaderSourceANGLE):
+
2013-12-05 Laszlo Vidacs <[email protected]>
32bit buildfix after r160151
Modified: trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp (160198 => 160199)
--- trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp 2013-12-05 23:37:08 UTC (rev 160198)
+++ trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp 2013-12-05 23:45:28 UTC (rev 160199)
@@ -170,7 +170,7 @@
String translatedShaderSource;
String shaderInfoLog;
- int extraCompileOptions = SH_MAP_LONG_VARIABLE_NAMES | SH_CLAMP_INDIRECT_ARRAY_BOUNDS | SH_UNFOLD_SHORT_CIRCUIT;
+ int extraCompileOptions = SH_MAP_LONG_VARIABLE_NAMES | SH_CLAMP_INDIRECT_ARRAY_BOUNDS | SH_UNFOLD_SHORT_CIRCUIT | SH_ENFORCE_PACKING_RESTRICTIONS;
if (m_requiresBuiltInFunctionEmulation)
extraCompileOptions |= SH_EMULATE_BUILT_IN_FUNCTIONS;