diff -r 000000000000 -r 6474c204b198 gfx/angle/angle-default-clamp-strat.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gfx/angle/angle-default-clamp-strat.patch Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,52 @@ +From: Jeff Gilbert + +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 +@@ -130,18 +130,21 @@ bool TCompiler::Init(const ShBuiltInReso + 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;