diff --git a/Test/400.frag b/Test/400.frag index bda588ad31145ebd7cd1534b6def4dfcde87e9b4..7ca965fb35dee1c61525b1a36b37c6352d1f4c7f 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 3a20dabc1fadf04bc47b4d7363a20e83c23a97a8..2a352af453e7a23f172b7fdad2c4811eaff2efa1 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 6de68c70eefbdc1ed660394afb84f2d6686a452b..f24baed384170cdeb36839c7fc53ec3ec78a0f0f 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 35be93b847001f801b21b0a8a999a9d61f1dde2b..7e4a160c580e6af10b534b890e20737ff7ced70e 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();