AlexAltea / glslang.js

Real-time GLSL to SPIR-V, powered by Glslang
https://alexaltea.github.io/glslang.js
27 stars 5 forks source link

compile fragment shader fail. #2

Open yukunxie opened 4 years ago

yukunxie commented 4 years ago

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;
}
AlexAltea commented 4 years ago

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.