KHR_vulkan_glsl: name mangle distinguish pure textures.
authorJohn Kessenich <cepheus@frii.com>
Fri, 20 May 2016 22:59:27 +0000 (16:59 -0600)
committerJohn Kessenich <cepheus@frii.com>
Fri, 20 May 2016 22:59:27 +0000 (16:59 -0600)
Fixes issue #252.

Test/baseResults/vulkan.frag.out
Test/vulkan.frag
glslang/MachineIndependent/SymbolTable.cpp

index b5b9d91af7acc93255463379000cc9aabf0dcd78..fe8b045b3b2b76938071abbd2832e944d5a6d25d 100644 (file)
@@ -31,7 +31,9 @@ ERROR: 0:66: 'non-opaque uniforms outside a block' : not allowed when using GLSL
 ERROR: 0:67: 'subroutine' : not allowed when generating SPIR-V 
 ERROR: 0:67: 'uniform' : no qualifiers allowed for function return 
 ERROR: 0:69: 'non-opaque uniforms outside a block' : not allowed when using GLSL for Vulkan 
-ERROR: 31 compilation errors.  No code generated.
+ERROR: 0:73: 'texture' : no matching overloaded function found 
+ERROR: 0:74: 'imageStore' : no matching overloaded function found 
+ERROR: 33 compilation errors.  No code generated.
 
 
 
index b96647c7678061559f05c4640e2b84061621432a..0148507f9a41e2e0318432fe0edbc867fee1b041 100644 (file)
@@ -67,3 +67,9 @@ subroutine int fooS;                              // ERROR, not in SPV
 subroutine int fooSub();                          // ERROR, not in SPV\r
 \r
 uniform vec4 dv4;                                 // ERROR, no default uniforms\r
+\r
+void fooTex()\r
+{\r
+    texture(t2d, vec2(1.0));                 // ERROR, need a sampler, not a pure texture\r
+    imageStore(t2d, ivec2(4, 5), vec4(1.2)); // ERROR, need an image, not a pure texture\r
+}
\ No newline at end of file
index 4c9b0e2c66f67428c33658ec1cf8248dbe791b50..bf0f1f9fa74862876e91a1298099ec061c85a0be 100644 (file)
@@ -73,9 +73,13 @@ void TType::buildMangledName(TString& mangledName)
         default: break; // some compilers want this
         }
         if (sampler.image)
-            mangledName += "I";
+            mangledName += "I";  // a normal image
+        else if (sampler.sampler)
+            mangledName += "p";  // a "pure" sampler
+        else if (!sampler.combined)
+            mangledName += "t";  // a "pure" texture
         else
-            mangledName += "s";
+            mangledName += "s";  // traditional combined sampler
         if (sampler.arrayed)
             mangledName += "A";
         if (sampler.shadow)