2013-05-13 05:12:37 -07:00
|
|
|
From: Jeff Gilbert <jgilbert@mozilla.com>
|
|
|
|
|
|
|
|
diff --git a/gfx/angle/src/compiler/Compiler.cpp b/gfx/angle/src/compiler/Compiler.cpp
|
|
|
|
--- a/gfx/angle/src/compiler/Compiler.cpp
|
|
|
|
+++ b/gfx/angle/src/compiler/Compiler.cpp
|
2013-09-06 17:24:36 -07:00
|
|
|
@@ -130,18 +130,21 @@ bool TCompiler::Init(const ShBuiltInReso
|
2013-05-13 05:12:37 -07:00
|
|
|
TScopedPoolAllocator scopedAlloc(&allocator, false);
|
|
|
|
|
|
|
|
// Generate built-in symbol table.
|
|
|
|
if (!InitBuiltInSymbolTable(resources))
|
|
|
|
return false;
|
|
|
|
InitExtensionBehavior(resources, extensionBehavior);
|
|
|
|
fragmentPrecisionHigh = resources.FragmentPrecisionHigh == 1;
|
|
|
|
|
|
|
|
- arrayBoundsClamper.SetClampingStrategy(resources.ArrayIndexClampingStrategy);
|
|
|
|
- clampingStrategy = resources.ArrayIndexClampingStrategy;
|
|
|
|
+ // ArrayIndexClampingStrategy's enum starts at 1, so 0 is 'default'.
|
|
|
|
+ if (resources.ArrayIndexClampingStrategy) {
|
|
|
|
+ clampingStrategy = resources.ArrayIndexClampingStrategy;
|
|
|
|
+ }
|
|
|
|
+ arrayBoundsClamper.SetClampingStrategy(clampingStrategy);
|
|
|
|
|
|
|
|
hashFunction = resources.HashFunction;
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool TCompiler::compile(const char* const shaderStrings[],
|
|
|
|
size_t numStrings,
|
|
|
|
diff --git a/gfx/angle/src/third_party/compiler/ArrayBoundsClamper.cpp b/gfx/angle/src/third_party/compiler/ArrayBoundsClamper.cpp
|
|
|
|
--- a/gfx/angle/src/third_party/compiler/ArrayBoundsClamper.cpp
|
|
|
|
+++ b/gfx/angle/src/third_party/compiler/ArrayBoundsClamper.cpp
|
|
|
|
@@ -72,16 +72,19 @@ private:
|
|
|
|
ArrayBoundsClamper::ArrayBoundsClamper()
|
|
|
|
: mClampingStrategy(SH_CLAMP_WITH_CLAMP_INTRINSIC)
|
|
|
|
, mArrayBoundsClampDefinitionNeeded(false)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void ArrayBoundsClamper::SetClampingStrategy(ShArrayIndexClampingStrategy clampingStrategy)
|
|
|
|
{
|
|
|
|
+ ASSERT(clampingStrategy == SH_CLAMP_WITH_CLAMP_INTRINSIC ||
|
|
|
|
+ clampingStrategy == SH_CLAMP_WITH_USER_DEFINED_INT_CLAMP_FUNCTION);
|
|
|
|
+
|
|
|
|
mClampingStrategy = clampingStrategy;
|
|
|
|
}
|
|
|
|
|
|
|
|
void ArrayBoundsClamper::MarkIndirectArrayBoundsForClamping(TIntermNode* root)
|
|
|
|
{
|
|
|
|
ASSERT(root);
|
|
|
|
|
|
|
|
ArrayBoundsClamperMarker clamper;
|