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

Add support for Vulkan's GLSL... maybe #26

Open
godlikepanos opened this issue Mar 6, 2019 · 3 comments
Open

Add support for Vulkan's GLSL... maybe #26

godlikepanos opened this issue Mar 6, 2019 · 3 comments

Comments

@godlikepanos
Copy link

Adding new keywords introduced by Vulkan to the syntax highlighter is the easy part but there is a problem.

At the moment, vscode-shader's syntax highlighter contains some archaic GLSL constructs that don't quite align with Vulkan. One example is the keyword texture2D. At the very beginning texture2D was a function (GLSL 1.10), then it got deprecated and finally it got reintroduced in Vulkan as a type. At the moment the syntax highlighter thinks texture2D is a function.

I'm not sure what is the best course of action here. texture2D and co are functions in WebGL but types in Vulkan. Any idea how to solve this issue? Maybe have a config option to control this?

@Ternvein
Copy link

Probably it can be resolved by the #version header. Does Vulkan's GLSL have such header?

@godlikepanos
Copy link
Author

Unfortunately Vulkan's GLSL doesn't have a special #version. But the #version can be used to distinguish the "archaic GLSL" (<=1.10) and the more modern versions. The modern versions can include the extra Vulkan keywords.

@Makogan
Copy link

Makogan commented May 19, 2021

I don't think this merits a new issue so I will add it to this thread.

As it stands this extension gets confused by vulkan glsl dialects. For example using scalar gives this error:

'scalar' : only allowed when using GLSL for Vulkan

And using 'scalar' : only allowed when using GLSL for Vulkan also produces an error.

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

3 participants