KubaP / glsl-lsp

A language server implementation for the OpenGL Shading Langauge, written in Rust.
12 stars 1 forks source link

invalid invalid layout identifier error #12

Open coolcatcoder opened 7 months ago

coolcatcoder commented 7 months ago

vscode extension version: 0.0.2 glsl-lsp version: Don't know what this is. OS: Windows 10

Describe the bug

This extension immediately starts claiming my layout identifiers are invalid. Yet my shaders compile and run fine. I'm using vulkan, not opengl, in case that makes a difference. Here is my working fragment shader for example:

#version 450

layout(location = 0) in vec2 uv;
layout(location = 1) in vec4 colour;
layout(location = 0) out vec4 f_color;

layout(set = 0, binding = 0) uniform Data { // Syntax error: found an invalid layout identifier
    float scale;
    float camera_scale;
    vec2 camera_position;

    float brightness;
} uniforms;

layout(set = 1, binding = 1) uniform sampler2D textures;  // Syntax error: found an invalid layout identifier

void main() {
    f_color = vec4(colour.x * uniforms.brightness, colour.y * uniforms.brightness, colour.z * uniforms.brightness, texture(textures,uv).w);
}
KubaP commented 7 months ago

Thanks for reporting this issue! I believe this problem comes from the fact that you are using vulkan. This project so far has been wholly centred around GLSL 4.50/4.60 for OpenGL, and if I recall correctly OpenGL doesn't support set as a layout identifier.

Unfortunately, this project is effectively on-hold and I'm not actively working on it at the moment. I hope to come back to this in the future, and support vulkan too, but at this point I cannot say when that may be. I'll leave this issue open anyways so that I don't forget about this when I do resume this work.