diff --git a/Test/400.frag b/Test/400.frag index bda588ad..7ca965fb 100644 --- a/Test/400.frag +++ b/Test/400.frag @@ -126,7 +126,7 @@ void interp() interpolateAtSample(sampInArray, 1); // ERROR interpolateAtSample(sampInArray[i], 0); - interpolateAtSample(s1.x, 2); // ERROR + interpolateAtSample(s1.x, 2); interpolateAtSample(scalarIn, 1); interpolateAtOffset(sampInArray, vec2(0.2)); // ERROR diff --git a/Test/440.frag b/Test/440.frag index 3a20dabc..2a352af4 100644 --- a/Test/440.frag +++ b/Test/440.frag @@ -144,4 +144,5 @@ sample in vec3 sampInArray[4]; void interp() { interpolateAtCentroid(sampInArray[2].xy); + interpolateAtSample(sampInArray[2].x.x, 2); } diff --git a/Test/baseResults/440.frag.out b/Test/baseResults/440.frag.out index 6de68c70..f24baed3 100644 --- a/Test/baseResults/440.frag.out +++ b/Test/baseResults/440.frag.out @@ -67,6 +67,16 @@ ERROR: node is still EOpNull! 0:146 0 (const int) 0:146 Constant: 0:146 1 (const int) +0:147 interpolateAtSample (global float) +0:147 direct index (temp float) +0:147 direct index (smooth sample temp 3-component vector of float) +0:147 'sampInArray' (smooth sample in 4-element array of 3-component vector of float) +0:147 Constant: +0:147 2 (const int) +0:147 Constant: +0:147 0 (const int) +0:147 Constant: +0:147 2 (const int) 0:? Linker Objects 0:? 'a' (layout(location=4 component=2 ) smooth in 2-component vector of float) 0:? 'b' (layout(location=4 component=1 ) smooth in float) @@ -125,6 +135,16 @@ ERROR: node is still EOpNull! 0:146 0 (const int) 0:146 Constant: 0:146 1 (const int) +0:147 interpolateAtSample (global float) +0:147 direct index (temp float) +0:147 direct index (smooth sample temp 3-component vector of float) +0:147 'sampInArray' (smooth sample in 4-element array of 3-component vector of float) +0:147 Constant: +0:147 2 (const int) +0:147 Constant: +0:147 0 (const int) +0:147 Constant: +0:147 2 (const int) 0:? Linker Objects 0:? 'a' (layout(location=4 component=2 ) smooth in 2-component vector of float) 0:? 'b' (layout(location=4 component=1 ) smooth in float) diff --git a/glslang/MachineIndependent/Intermediate.cpp b/glslang/MachineIndependent/Intermediate.cpp index 35be93b8..7e4a160c 100644 --- a/glslang/MachineIndependent/Intermediate.cpp +++ b/glslang/MachineIndependent/Intermediate.cpp @@ -882,7 +882,9 @@ const TIntermTyped* TIntermediate::findLValueBase(const TIntermTyped* node, bool if (! swizzleOkay) { if (op == EOpVectorSwizzle) return nullptr; - if ((op == EOpIndexDirect || op == EOpIndexIndirect) && binary->getLeft()->getType().isVector() && ! binary->getLeft()->getType().isArray()) + if ((op == EOpIndexDirect || op == EOpIndexIndirect) && + (binary->getLeft()->getType().isVector() || binary->getLeft()->getType().isScalar()) && + ! binary->getLeft()->getType().isArray()) return nullptr; } node = node->getAsBinaryNode()->getLeft();