From: John Kessenich Date: Fri, 20 May 2016 22:59:27 +0000 (-0600) Subject: KHR_vulkan_glsl: name mangle distinguish pure textures. X-Git-Tag: upstream/0.1~166 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2921e0c54a95264a6fd193c79c814f2869ef9a2d;p=platform%2Fupstream%2Fglslang.git KHR_vulkan_glsl: name mangle distinguish pure textures. Fixes issue #252. --- diff --git a/Test/baseResults/vulkan.frag.out b/Test/baseResults/vulkan.frag.out index b5b9d91a..fe8b045b 100644 --- a/Test/baseResults/vulkan.frag.out +++ b/Test/baseResults/vulkan.frag.out @@ -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. diff --git a/Test/vulkan.frag b/Test/vulkan.frag index b96647c7..0148507f 100644 --- a/Test/vulkan.frag +++ b/Test/vulkan.frag @@ -67,3 +67,9 @@ subroutine int fooS; // ERROR, not in SPV subroutine int fooSub(); // ERROR, not in SPV uniform vec4 dv4; // ERROR, no default uniforms + +void fooTex() +{ + texture(t2d, vec2(1.0)); // ERROR, need a sampler, not a pure texture + imageStore(t2d, ivec2(4, 5), vec4(1.2)); // ERROR, need an image, not a pure texture +} \ No newline at end of file diff --git a/glslang/MachineIndependent/SymbolTable.cpp b/glslang/MachineIndependent/SymbolTable.cpp index 4c9b0e2c..bf0f1f9f 100644 --- a/glslang/MachineIndependent/SymbolTable.cpp +++ b/glslang/MachineIndependent/SymbolTable.cpp @@ -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)