Fix sameElementShape test of sampler
authorGreg Fischer <greg@lunarg.com>
Mon, 7 Feb 2022 19:15:31 +0000 (12:15 -0700)
committerGreg Fischer <greg@lunarg.com>
Mon, 7 Feb 2022 19:15:31 +0000 (12:15 -0700)
There is apparently a hole in the initialization of sampler in TType
so that a simple comparison which should pass might fail. Until the
hole is found, also test that both types are samplers before comparing
the sampler field for equality.

Fixes #2875

glslang/Include/Types.h

index 54150fb..91fcd4e 100644 (file)
@@ -2703,7 +2703,7 @@ public:
             *lpidx = -1;
             *rpidx = -1;
         }
-        return    sampler == right.sampler    &&
+        return ((basicType != EbtSampler && right.basicType != EbtSampler) || sampler == right.sampler) &&
                vectorSize == right.vectorSize &&
                matrixCols == right.matrixCols &&
                matrixRows == right.matrixRows &&