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