glslang.js icon indicating copy to clipboard operation
glslang.js copied to clipboard

compile fragment shader fail.

Open yukunxie opened this issue 5 years ago • 1 comments

The following code snippet comes from //github.com/austinEng/webgpu-samples.git, but when I compile it with glslang, it's failed with the error "Glslang.JS: Could not compile shader"

#version 450
layout(set = 0, binding = 1) uniform sampler mySampler;
layout(set = 0, binding = 2) uniform texture2D myTexture;

layout(location = 0) in vec2 fragUV;
layout(location = 1) in vec4 fragPosition;
layout(location = 0) out vec4 outColor;

void main() {
    outColor =  texture(sampler2D(myTexture, mySampler), fragUV) * fragPosition;
}

yukunxie avatar Dec 02 '19 07:12 yukunxie

Can you check if you can replicate that issue with the pinned Glslang version? https://github.com/KhronosGroup/glslang/tree/c57b2a97fa808970a4809c53de605bbf103fce12

That is, checkout commit c57b2a97, build and test that snippet.

AlexAltea avatar Dec 02 '19 14:12 AlexAltea