GLSL icon indicating copy to clipboard operation
GLSL copied to clipboard

Incompatible with NVIDIA NSIGHT

Open UHFT opened this issue 4 years ago • 30 comments

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

UHFT avatar Jan 07 '21 15:01 UHFT

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.

danielscherzer avatar Jan 08 '21 09:01 danielscherzer

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

UHFT avatar Jan 08 '21 09:01 UHFT

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?

UHFT avatar Jan 08 '21 09:01 UHFT

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.

danielscherzer avatar Jan 08 '21 09:01 danielscherzer

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 avatar Jan 08 '21 09:01 UHFT

Microsoft Visual Studio Community 2019 Version 16.7.6

UHFT avatar Jan 08 '21 09:01 UHFT

Screenshot 2021-01-08 at 09 59 30

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

UHFT avatar Jan 08 '21 10:01 UHFT

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

UHFT avatar Jan 08 '21 10:01 UHFT

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.

danielscherzer avatar Jan 08 '21 10:01 danielscherzer

Tried 16.8.3 but no success.

UHFT avatar Jan 08 '21 15:01 UHFT

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 avatar Jan 11 '21 12:01 joaopat98

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.

joaopat98 avatar Jan 11 '21 13:01 joaopat98

Then removing CUDA toolkit will sort out?

UHFT avatar Jan 11 '21 13:01 UHFT

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?

UHFT avatar Jan 11 '21 13:01 UHFT

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.

danielscherzer avatar Jan 11 '21 14:01 danielscherzer

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.

joaopat98 avatar Jan 11 '21 15:01 joaopat98

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

UHFT avatar Jan 11 '21 16:01 UHFT

new version with your additions

danielscherzer avatar Jan 11 '21 17:01 danielscherzer

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

UHFT avatar Jan 11 '21 18:01 UHFT

Thanks for the info! -> new version

danielscherzer avatar Jan 12 '21 08:01 danielscherzer

is this issue resolved?

danielscherzer avatar Jan 25 '21 12:01 danielscherzer

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.

SNMetamorph avatar Mar 08 '21 07:03 SNMetamorph

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 avatar Mar 10 '21 09:03 danielscherzer

Is this issue resolved?

danielscherzer avatar Apr 28 '21 18:04 danielscherzer

Is this issue resolved?

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

SNMetamorph avatar May 13 '21 13:05 SNMetamorph

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

SNMetamorph avatar Jul 27 '21 18:07 SNMetamorph

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.

danielscherzer avatar Aug 09 '21 06:08 danielscherzer

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.

SNMetamorph avatar Aug 13 '21 10:08 SNMetamorph

Did you do a restart after changing the extensions?

danielscherzer avatar Aug 13 '21 15:08 danielscherzer

Yes, I did.

пт, 13 авг. 2021 г., 19:59 Daniel Scherzer @.***>:

Did you do a restart after changing the extensions?

SNMetamorph avatar Aug 13 '21 16:08 SNMetamorph