Skip to content
This repository has been archived by the owner on Jan 29, 2025. It is now read-only.

with naga-10, from glsl to glsl target, compile error: names containing consecutive underscores are reserved #2234

Closed
ghost opened this issue Feb 1, 2023 · 1 comment · Fixed by #2510
Labels
area: back-end Outputs of shader conversion kind: bug Something isn't working lang: GLSL OpenGL Shading Language

Comments

@ghost
Copy link

ghost commented Feb 1, 2023

with naga-10, compile glsl code to glsl target, when type name is ends with number, occus compile error

compile error with glsl source code in vertex shader

Error: 0:38: 'M01__block_1Vetrtex' : identifiers containing two consecutive underscores (__) are reserved as possible future keywords

Error: 0:40: 'M02__block_2Vetrtex' : identifiers containing two consecutive underscores (__) are reserved as possible future keywords

source code

#version 450

precision highp float;

layout(location=0) in vec2 position;

layout(set=0,binding=0) uniform M01 { 
    mat4 project;
    mat4 view;
};

layout(set=2,binding=0) uniform M02 {
    mat4 world;
};

void main() {
        gl_Position = project * view * world * vec4(position.x, position.y, 1.0, 1.0);
}

specs of gles 3.0

By convention, all macro names containing two consecutive underscores ( __ ) are reserved for use by underlying software layers. Defining such a name in a shader does not itself result in an error, but may result in unintended behaviors that stem from having multiple definitions of the same name

@ghost ghost changed the title compilenames containing consecutive underscores are reserved from glsl to webgl2 compile glsl in wasm platform error: names containing consecutive underscores are reserved Feb 1, 2023
@ghost
Copy link
Author

ghost commented Feb 1, 2023

first underscore

when type name is ends with number, it put the underscore

image

last underscore in code:

in naga\src\back\glsl\mod.rs, write_interface_block function, as follow:

image

@ghost ghost changed the title compile glsl in wasm platform error: names containing consecutive underscores are reserved in naga 10.0, compile glsl in wasm platform error: names containing consecutive underscores are reserved Feb 1, 2023
@ghost ghost changed the title in naga 10.0, compile glsl in wasm platform error: names containing consecutive underscores are reserved in naga 10.0, compile glsl in webgl2 backend error: names containing consecutive underscores are reserved Feb 1, 2023
@ghost ghost changed the title in naga 10.0, compile glsl in webgl2 backend error: names containing consecutive underscores are reserved with wgpu-14 / naga-10, compile glsl in webgl2 backend error: names containing consecutive underscores are reserved Feb 1, 2023
@ghost ghost changed the title with wgpu-14 / naga-10, compile glsl in webgl2 backend error: names containing consecutive underscores are reserved with naga-10, from glsl to glsl target, compile error: names containing consecutive underscores are reserved Feb 1, 2023
@teoxoy teoxoy added kind: bug Something isn't working area: back-end Outputs of shader conversion lang: GLSL OpenGL Shading Language labels Feb 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: back-end Outputs of shader conversion kind: bug Something isn't working lang: GLSL OpenGL Shading Language
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant