Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use this extension with vulkan glsl files #1

Closed
SoulsD opened this issue Jul 6, 2018 · 7 comments
Closed

Cannot use this extension with vulkan glsl files #1

SoulsD opened this issue Jul 6, 2018 · 7 comments

Comments

@SoulsD
Copy link

SoulsD commented Jul 6, 2018

To have glslangValidator work properly for vulkan shader, additional arguments needs to be passed.
I propose to add an option to the extension to add arguments :

"glsllint.glslangValidatorPath": "path/to/glslangValidator",
"glsllint.glslangValidatorAdditionalArguments": [
    "-V"
]

Additionnaly, it seems there is currently no way to execute glslangValidator -V without generating the binary result of the compilation to spirv shader. Maybe an option to set the output dir (-o <dir>/<filename>.spv) could do the trick. (a workaround is to add -o /tmp/tmp.spv to the arguments)

@ghost
Copy link

ghost commented Nov 6, 2018

This should be working now with glsllint.glslangValidatorArgs

@ghost ghost closed this as completed Nov 6, 2018
@DavidMedin
Copy link

I am trying to specify descriptor sets in GLSL using Vulkan. I have -V set in glsllint.glslangValidatorArgs.
Here is my GLSL code:

#version 460

layout(location=0) in vec2 pos;
layout(location=1) in vec3 color;

layout(binding=0,set=0) uniform Transformation{
    mat4 model;
    mat4 proj;
    mat4 view;
}camera;
layout(binding=0,set=1) uniform test{
    int testInt;
    float testFloat;
}tester;

layout(location=0) out vec3 vertColor;

void main(){
    gl_Position = camera.proj * camera.view * camera.model * vec4(pos,0,1);
    vertColor = color; 
}

I am getting an error at layout(binding=0,set=1) uniform saying 'descriptor set' : only allowed when using GLSL for Vulkan and '' : compilation terminated .

these are the only settings I changed for the GLSL Lint extension in settings.json:

"glsllint.glslangValidatorPath": "C:\\VulkanSDK\\1.2.141.2\\Bin\\glslangValidator.exe",
 "glsllint.glslangValidatorArgs": "-V",

What I have tried:

  • I downloaded the newest release from glslang and set glsllint.glslangValidatorPath to that path. It didn't change anything.
  • using #define VULKAN 100 instead and with -V. Got no different results.
  • used --spirv-val instead of -V, didn't work.
  • When I call in my terminal:
    C:\Users\david\Downloads\glslang-master-windows-x64-Release\bin\glslangValidator.exe -V mainShad.vert
    It returns mainShad.vert and no errors.
  • When I remove the everything from glslangValidatorArgs and #define VULKAN 100, I get the same result.

@hsimpson
Copy link
Owner

@DavidMedin I will have a look into this issue and try to reproduce your problem

@hsimpson
Copy link
Owner

@DavidMedin the -V (ensure uppercase 'V') parameter needs to write out the SPIR-V byte code. This file will be written into the root of your workspace by default.
If this does not work correctly then you can create a "temp" directory and use the -o SPIRV_OUTPUT_FILE parameter. Example:

"glsllint.glslangValidatorArgs": "-V -o ./temp/out.spv"

Please ensure to restart VSCode after you change the settings. Configuration reload is not yet supported see: #21

I also have tested this with 3 different glslangValdiator.exe version on Windows 10 64bit

If you still have any issues then describe them.

@DavidMedin
Copy link

That works great. Thanks!

@MouseChannel
Copy link

i have copied what you did,but did not work;
Im using vulkan 1.3 and glslang 12.0.0

@hsimpson
Copy link
Owner

i have copied what you did,but did not work; Im using vulkan 1.3 and glslang 12.0.0

Can you describe your problem in more detail?

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants