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

Incompatible with NVIDIA NSIGHT #76

Open
UHFT opened this issue Jan 7, 2021 · 30 comments
Open

Incompatible with NVIDIA NSIGHT #76

UHFT opened this issue Jan 7, 2021 · 30 comments

Comments

@UHFT
Copy link

UHFT commented Jan 7, 2021

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

@danielscherzer
Copy link
Owner

Thanks for your feedback!
Could you please try other shader extensions, like .frag (More discussion on this topic in #32) if those are at least working.

@UHFT
Copy link
Author

UHFT commented Jan 8, 2021

all other extensions work fine (such as .comp) but just only .glsl does not recognize. It uses default C++ syntax highlighting

@UHFT
Copy link
Author

UHFT commented Jan 8, 2021

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?

@danielscherzer
Copy link
Owner

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.

@UHFT
Copy link
Author

UHFT commented Jan 8, 2021

Screenshot 2021-01-08 at 09 55 02

Screenshot 2021-01-08 at 09 56 22

The only concern is the default .glsl extension does not work with your 'auto detect' GLSL shader type.

@UHFT
Copy link
Author

UHFT commented Jan 8, 2021

Microsoft Visual Studio Community 2019
Version 16.7.6

@UHFT
Copy link
Author

UHFT commented Jan 8, 2021

Screenshot 2021-01-08 at 09 59 30

Somehow, .glsl does not recognized (e.g no highlight for vec3)

@UHFT
Copy link
Author

UHFT commented Jan 8, 2021

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

@danielscherzer
Copy link
Owner

danielscherzer commented Jan 8, 2021

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.

@UHFT
Copy link
Author

UHFT commented Jan 8, 2021

Tried 16.8.3 but no success.

@joaopat98
Copy link

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?

@joaopat98
Copy link

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.

@UHFT
Copy link
Author

UHFT commented Jan 11, 2021

Then removing CUDA toolkit will sort out?

@UHFT
Copy link
Author

UHFT commented Jan 11, 2021

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?

@danielscherzer
Copy link
Owner

danielscherzer commented Jan 11, 2021

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.

@joaopat98
Copy link

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.

@UHFT
Copy link
Author

UHFT commented Jan 11, 2021

pulled and requested for merging glsl ray tracing (3 files)

@danielscherzer
Copy link
Owner

new version with your additions

@UHFT
Copy link
Author

UHFT commented Jan 11, 2021

Thanks, it works great.
But 'glslVariables.txt' is not updated somehow, please merge this file.

@danielscherzer
Copy link
Owner

Thanks for the info! -> new version

@danielscherzer
Copy link
Owner

is this issue resolved?

@SNMetamorph
Copy link

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.

@danielscherzer
Copy link
Owner

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.

@danielscherzer
Copy link
Owner

Is this issue resolved?

@SNMetamorph
Copy link

SNMetamorph commented May 13, 2021

Is this issue resolved?

@danielscherzer no, it's still not fixed in version 0.10.125

@SNMetamorph
Copy link

SNMetamorph commented Jul 27, 2021

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

@danielscherzer
Copy link
Owner

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.

@SNMetamorph
Copy link

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.

@danielscherzer
Copy link
Owner

Did you do a restart after changing the extensions?

@SNMetamorph
Copy link

SNMetamorph commented Aug 13, 2021 via email

@danielscherzer danielscherzer changed the title glsl highlight Incompatible with NVIDIA NSIGHT Aug 16, 2022
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