GLSL
GLSL copied to clipboard
Incompatible with NVIDIA NSIGHT
Installed product versions
- Visual Studio: [2019]
- This extension: [example 1.1.21]
Description
all other extensions work fine but glsl extension. It seems something is overriding to use of glsl with the default syntax highlight
Perhaps some change in the window registry to resolve this issue?
Steps to recreate
have followed the install guide
Current behavior
.glsl extension does not highlight
Expected behavior
.glsl syntax highlight
Thanks for your feedback!
Could you please try other shader extensions, like .frag (More discussion on this topic in https://github.com/danielscherzer/GLSL/issues/32) if those are at least working.
all other extensions work fine (such as .comp) but just only .glsl does not recognize. It uses default C++ syntax highlighting
I tried #32 and .fsh works but not .vsh.
.glsl and .vsh must have been associated with other programs. How can I associate them back?
Sorry! I did not understand your original message correctly!
The trouble with .vsh is discussed in issue #32
Why .glsl is not working for you is unknown to me. Could you send me a list of your installed extension and the exact visual studio version.


The only concern is the default .glsl extension does not work with your 'auto detect' GLSL shader type.
Microsoft Visual Studio Community 2019 Version 16.7.6

Somehow, .glsl does not recognized (e.g no highlight for vec3)
tried .glsl -> .gls and it works fine. But I'd like to keep .glsl extension since some Vulkan examples use pre-defined compile option with .glsl
Hm the only extension that could make trouble is the spirv one, but I after installing it myself, I have no problems with glsl. I use Microsoft Visual Studio Enterprise 2019 Version 16.8.3. Maybe an update to 16.8.3 could help grasping at straws.
Tried 16.8.3 but no success.
I have this same issue, however this started happening AFTER I updated Visual Studio to 16.8.3! I also have the issue that even when syntax highlighting shows (when manually setting the file's extension to the appropriate shader type), i still have no auto-completion. I have tried reinstalling the extension and even went as far as resetting visual studio altogether, but the issues persist. Any idea on what might be going wrong?
Found what the problem was, i recently installed the CUDA toolkit and with it came Nsight for visual studio and it was messing with glsl for some reason.
Then removing CUDA toolkit will sort out?
It works after uninstalling all CUDA and NSights. Thanks
By the way, it is possible I can manually add 'rayQueryInitializeEXT', 'rayQueryProceedEXT' etcs to glsl keywords or usertype.dat for syntax highlight?
Thanks for finding the problem!
So you still could use CUDA and NSight if you choose another extension instead of .glsl?
I did not make the glsl keyword definition user changeable, because I found loading external files kind of problematic with VS extensions.
But including 'rayQueryInitializeEXT', 'rayQueryProceedEXT' or other new keywords is straight forward:
For all glsl parsing etc. I created a separate project https://github.com/danielscherzer/GLSLhelper/tree/master/GLSLhelper
Here you can find 3 *.txt files. One for functions (glslFunctions.txt) one for keywords and one for variables.
These contain an unordered list of whitespace separated words. Just add what you want and make a pull request.
I will merge and create a new version of the extension and everyone gets the improved list of functions/variables/keywords.
If you have keywords/function/.. that are specific to you and not of general benefit to other users add them to user kewords1 or 2 in the options.
I didnt need to remove the CUDA toolkit itself, just the Nsight visual studio extension that comes with it. The fact that it was installed broke multiple parts of glsl, for example auto-completion was nowhere to be found even with the right file extensions and syntax highlighting working.
pulled and requested for merging glsl ray tracing (3 files)
new version with your additions
Thanks, it works great. But 'glslVariables.txt' is not updated somehow, please merge this file.
Thanks for the info! -> new version
is this issue resolved?
It still doesn't works. On Visual Studio Community 2019 version 16.8.6 with extension 0.10.124
Also I have installed Nsight extension.
I have files named like this:
But when I open one of this, there is no syntax highlighting. If I change file extension to .vert/.frag it works.
So I think it'll be useful if extension could use some patterns in file name to determine shader type (in my case it's _vp and _fp), rather than just use file extension.
Nsight interferes with my extension; If you set an auto detect extension that works, the shader type should be found automatically, by analysing the source code. Maybe this is already sufficient for you.
Is this issue resolved?
Is this issue resolved?
@danielscherzer no, it's still not fixed in version 0.10.125
When I startup Visual Studio, I see this message in status bar
GLSL language integration: Extension '.glsl' is ignored because it is already registered with the content type 'C/C++'. Please use different extension on the GLSL language integration options page!Following is the detailed exception message ...
So I think it's the reason of this issue
Yes! This is a message I print, when extensions, like Nsight get exclusive domain for an file extension. The only workarround I know is to use a different file extension for the shaders you want to use with my extension. This can be configured in the option menu.
I changed extension to .shader on both options and files, but still no syntax highlighting. But if I use .vert of .frag extension, it works.
Did you do a restart after changing the extensions?
Yes, I did.
пт, 13 авг. 2021 г., 19:59 Daniel Scherzer @.***>:
Did you do a restart after changing the extensions?