Apply SH_TIMING_RESTRICTIONS to all samplers.
Issue: 332
Review URL: https://codereview.appspot.com/6273044/
git-svn-id: https://angleproject.googlecode.com/svn/trunk@1131 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/compiler/Compiler.cpp b/src/compiler/Compiler.cpp
index c6fcb41..245bf35 100644
--- a/src/compiler/Compiler.cpp
+++ b/src/compiler/Compiler.cpp
@@ -165,12 +165,8 @@
if (success && (compileOptions & SH_VALIDATE_LOOP_INDEXING))
success = validateLimitations(root);
- // FIXME(mvujovic): For now, we only consider "u_texture" to be a potentially unsafe symbol.
- // If we end up using timing restrictions in WebGL and CSS Shaders, we should expose an API
- // to pass in the names of other potentially unsafe symbols (e.g. uniforms referencing
- // cross-domain textures).
if (success && (compileOptions & SH_TIMING_RESTRICTIONS))
- success = enforceTimingRestrictions(root, "u_texture", (compileOptions & SH_DEPENDENCY_GRAPH) != 0);
+ success = enforceTimingRestrictions(root, (compileOptions & SH_DEPENDENCY_GRAPH) != 0);
// Unroll for-loop markup needs to happen after validateLimitations pass.
if (success && (compileOptions & SH_UNROLL_FOR_LOOP_WITH_INTEGER_INDEX))
@@ -252,9 +248,7 @@
return validate.numErrors() == 0;
}
-bool TCompiler::enforceTimingRestrictions(TIntermNode* root,
- const TString& restrictedSymbol,
- bool outputGraph)
+bool TCompiler::enforceTimingRestrictions(TIntermNode* root, bool outputGraph)
{
if (shaderSpec != SH_WEBGL_SPEC) {
infoSink.info << "Timing restrictions must be enforced under the WebGL spec.";
@@ -265,7 +259,7 @@
TDependencyGraph graph(root);
// Output any errors first.
- bool success = enforceFragmentShaderTimingRestrictions(graph, restrictedSymbol);
+ bool success = enforceFragmentShaderTimingRestrictions(graph);
// Then, output the dependency graph.
if (outputGraph) {
@@ -276,22 +270,20 @@
return success;
}
else {
- return enforceVertexShaderTimingRestrictions(root, restrictedSymbol);
+ return enforceVertexShaderTimingRestrictions(root);
}
}
-bool TCompiler::enforceFragmentShaderTimingRestrictions(const TDependencyGraph& graph,
- const TString& restrictedSymbol)
+bool TCompiler::enforceFragmentShaderTimingRestrictions(const TDependencyGraph& graph)
{
- RestrictFragmentShaderTiming restrictor(infoSink.info, restrictedSymbol);
+ RestrictFragmentShaderTiming restrictor(infoSink.info);
restrictor.enforceRestrictions(graph);
return restrictor.numErrors() == 0;
}
-bool TCompiler::enforceVertexShaderTimingRestrictions(TIntermNode* root,
- const TString& restrictedSymbol)
+bool TCompiler::enforceVertexShaderTimingRestrictions(TIntermNode* root)
{
- RestrictVertexShaderTiming restrictor(infoSink.info, restrictedSymbol);
+ RestrictVertexShaderTiming restrictor(infoSink.info);
restrictor.enforceRestrictions(root);
return restrictor.numErrors() == 0;
}