1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/angle/angle-default-clamp-strat.patch Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,52 @@ 1.4 +From: Jeff Gilbert <jgilbert@mozilla.com> 1.5 + 1.6 +diff --git a/gfx/angle/src/compiler/Compiler.cpp b/gfx/angle/src/compiler/Compiler.cpp 1.7 +--- a/gfx/angle/src/compiler/Compiler.cpp 1.8 ++++ b/gfx/angle/src/compiler/Compiler.cpp 1.9 +@@ -130,18 +130,21 @@ bool TCompiler::Init(const ShBuiltInReso 1.10 + TScopedPoolAllocator scopedAlloc(&allocator, false); 1.11 + 1.12 + // Generate built-in symbol table. 1.13 + if (!InitBuiltInSymbolTable(resources)) 1.14 + return false; 1.15 + InitExtensionBehavior(resources, extensionBehavior); 1.16 + fragmentPrecisionHigh = resources.FragmentPrecisionHigh == 1; 1.17 + 1.18 +- arrayBoundsClamper.SetClampingStrategy(resources.ArrayIndexClampingStrategy); 1.19 +- clampingStrategy = resources.ArrayIndexClampingStrategy; 1.20 ++ // ArrayIndexClampingStrategy's enum starts at 1, so 0 is 'default'. 1.21 ++ if (resources.ArrayIndexClampingStrategy) { 1.22 ++ clampingStrategy = resources.ArrayIndexClampingStrategy; 1.23 ++ } 1.24 ++ arrayBoundsClamper.SetClampingStrategy(clampingStrategy); 1.25 + 1.26 + hashFunction = resources.HashFunction; 1.27 + 1.28 + return true; 1.29 + } 1.30 + 1.31 + bool TCompiler::compile(const char* const shaderStrings[], 1.32 + size_t numStrings, 1.33 +diff --git a/gfx/angle/src/third_party/compiler/ArrayBoundsClamper.cpp b/gfx/angle/src/third_party/compiler/ArrayBoundsClamper.cpp 1.34 +--- a/gfx/angle/src/third_party/compiler/ArrayBoundsClamper.cpp 1.35 ++++ b/gfx/angle/src/third_party/compiler/ArrayBoundsClamper.cpp 1.36 +@@ -72,16 +72,19 @@ private: 1.37 + ArrayBoundsClamper::ArrayBoundsClamper() 1.38 + : mClampingStrategy(SH_CLAMP_WITH_CLAMP_INTRINSIC) 1.39 + , mArrayBoundsClampDefinitionNeeded(false) 1.40 + { 1.41 + } 1.42 + 1.43 + void ArrayBoundsClamper::SetClampingStrategy(ShArrayIndexClampingStrategy clampingStrategy) 1.44 + { 1.45 ++ ASSERT(clampingStrategy == SH_CLAMP_WITH_CLAMP_INTRINSIC || 1.46 ++ clampingStrategy == SH_CLAMP_WITH_USER_DEFINED_INT_CLAMP_FUNCTION); 1.47 ++ 1.48 + mClampingStrategy = clampingStrategy; 1.49 + } 1.50 + 1.51 + void ArrayBoundsClamper::MarkIndirectArrayBoundsForClamping(TIntermNode* root) 1.52 + { 1.53 + ASSERT(root); 1.54 + 1.55 + ArrayBoundsClamperMarker clamper;