danielscherzer / GLSL

VSIX Project that provides GLSL language integration.
258 stars 28 forks source link

Feature request: Native support for float16_t and related types #102

Closed smileyofoz closed 1 year ago

smileyofoz commented 2 years ago

Installed product versions

Description

This is a feature request for native support for intellisence for the float16_t (and related types).

Steps to recreate

  1. Replace this
  2. text with
  3. the steps
  4. to recreate

Current behavior

I'm using the glsl extension GL_AMD_gpu_shader_half_float. Although the shader happily compiles to spir-v using glslangValidator, I get squiggly lines and VS2022 intellisense complains about the type with a syntax error. The shader program also executes flawlessly.

Expected behavior

It would be wonderful to have the float16_t (and f16vec2 et. al.) supported natively.

danielscherzer commented 2 years ago

Thanks for your feedback! Could you provide me with a short example shader that produces these errors?

smileyofoz commented 2 years ago

Hello Daniel!

Thanks so much for your reply. May I first start by saying how much I love this tool and how it changed my shader development experience overnight!

A code fragment that causes this behaviour is:

version 460 core

extension GL_AMD_gpu_shader_half_float : enable

extension GL_AMD_gpu_shader_int16 : enable

layout (location = 0) out vec4 colour;

void main() { //Some meaningless declarations but it will reproduce the issue //Leave this next line uncommented to see it on uint16_t uint16_t ui16; //Comment this line to see the squiggles on float16_t instead float16_t f16;

vec4 colour = vec4(1., 0., 0., 1.); }

I have some screenshots of the behaviour also. You'll notice that as I comment out the first uint16_t variable declaration, the squiggles show up on the float16_t. Also, it may be that a file that is included and makes use of the //? syntax causes the error to present differently (the image with the "Characteristic" struct demonstrates this).

[image: float16_t.png] [image: Included_uin16_t.png] [image: uint16_t.png]

Again, my shaders compile to spir-v just fine. I'm using:

Thank you so much for your help, Shane

On Thu, Apr 21, 2022 at 4:12 PM Daniel Scherzer @.***> wrote:

Thanks for your feedback! Could you provide me with a short example shader that produces these errors?

— Reply to this email directly, view it on GitHub https://github.com/danielscherzer/GLSL/issues/102#issuecomment-1105764755, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXVB3AAM5MAHOXZZYCKEXMDVGHACXANCNFSM5UAA7M4A . You are receiving this because you authored the thread.Message ID: @.***>

danielscherzer commented 2 years ago

Thanks for the praise!

Ah ok I see the problem and the solution: As a default the extension tries to compile your shader with the glsl compiler of the OpenGL driver of your graphics card. For instance my graphic driver (and it seems yours too) (NV2080) does not support the uint16_t for OpenGL. Solution: Use an external compiler like glslangValidator. Info on how to: https://github.com/danielscherzer/GLSL#external-compiler

Short version: set the path to glslangvalidator in the extension options and specify arguments. For my setup: Arguments: -v External compiler: D:\Tools_Programming\glslang\bin\glslangValidator.exe

Then the squiggles disappear for me. Does this help?

smileyofoz commented 2 years ago

Hello Daniel, thanks again for the reply mate. I've tried setting the external compiler up and I'm not convinced that it's being invoked: [image: image.png] The squiggles are still there. If I try to misname the glslangValidator executable to see if it complains (to see if it's being invoked) it seems to fall back to the driver compiler, if it's trying to invoke it at all.

I normally invoke the compiler using this command: glslangValidator %(FullPath) -G -o $(TargetDir)Shaders\%(Filename)%(Extension).spv

Do I have this set up correctly?

Cheers, Shane

On Fri, Apr 22, 2022 at 12:01 PM Daniel Scherzer @.***> wrote:

Thanks for the praise!

Ah ok I see the problem and the solution: As a default the extension tries to compile your shader with the glsl compiler of the OpenGL driver of your graphics card. For instance my graphic driver (and it seems yours too) (NV2080) does not support the uint16_t for OpenGL. Solution: Use an external compiler like glslangValidator. Info on how to: https://github.com/danielscherzer/GLSL#external-compiler

Short version: set the path to glslangvalidator in the extension options and specify arguments. For my setup: Arguments: -v External compiler: D:\Tools_Programming\glslang\bin\glslangValidator.exe

Then the squiggles disappear for me. Does this help?

— Reply to this email directly, view it on GitHub https://github.com/danielscherzer/GLSL/issues/102#issuecomment-1106698742, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXVB3ADR5SFKT3UU5HJGHQDVGLLPFANCNFSM5UAA7M4A . You are receiving this because you authored the thread.Message ID: @.***>

smileyofoz commented 2 years ago

So as I continue to dig, it seems that the squiggles (or any real-time feedback) disappear altogether now because the external compiler is being aborted. Sorry to keep bugging you - just trying to arm you with useful information :)

Cheers, Shane

On Sun, Apr 24, 2022 at 2:27 PM Shane Cheary @.***> wrote:

Actually I see this in the bottom left hand side of the IDE: [image: image.png] I imagine this is related... Cheers

On Sun, Apr 24, 2022 at 2:24 PM Shane Cheary @.***> wrote:

Hello Daniel, thanks again for the reply mate. I've tried setting the external compiler up and I'm not convinced that it's being invoked: [image: image.png] The squiggles are still there. If I try to misname the glslangValidator executable to see if it complains (to see if it's being invoked) it seems to fall back to the driver compiler, if it's trying to invoke it at all.

I normally invoke the compiler using this command: glslangValidator %(FullPath) -G -o $(TargetDir)Shaders\%(Filename)%(Extension).spv

Do I have this set up correctly?

Cheers, Shane

On Fri, Apr 22, 2022 at 12:01 PM Daniel Scherzer < @.***> wrote:

Thanks for the praise!

Ah ok I see the problem and the solution: As a default the extension tries to compile your shader with the glsl compiler of the OpenGL driver of your graphics card. For instance my graphic driver (and it seems yours too) (NV2080) does not support the uint16_t for OpenGL. Solution: Use an external compiler like glslangValidator. Info on how to: https://github.com/danielscherzer/GLSL#external-compiler

Short version: set the path to glslangvalidator in the extension options and specify arguments. For my setup: Arguments: -v External compiler: D:\Tools_Programming\glslang\bin\glslangValidator.exe

Then the squiggles disappear for me. Does this help?

— Reply to this email directly, view it on GitHub https://github.com/danielscherzer/GLSL/issues/102#issuecomment-1106698742, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXVB3ADR5SFKT3UU5HJGHQDVGLLPFANCNFSM5UAA7M4A . You are receiving this because you authored the thread.Message ID: @.***>

smileyofoz commented 2 years ago

If I ctrl-B the file to build it individually, the executable does its job pretty expeditiously. It just seems to have issues when it's doing it "intellisense" style. Cheers

On Sun, Apr 24, 2022 at 2:30 PM Shane Cheary @.***> wrote:

So as I continue to dig, it seems that the squiggles (or any real-time feedback) disappear altogether now because the external compiler is being aborted. Sorry to keep bugging you - just trying to arm you with useful information :)

Cheers, Shane

On Sun, Apr 24, 2022 at 2:27 PM Shane Cheary @.***> wrote:

Actually I see this in the bottom left hand side of the IDE: [image: image.png] I imagine this is related... Cheers

On Sun, Apr 24, 2022 at 2:24 PM Shane Cheary @.***> wrote:

Hello Daniel, thanks again for the reply mate. I've tried setting the external compiler up and I'm not convinced that it's being invoked: [image: image.png] The squiggles are still there. If I try to misname the glslangValidator executable to see if it complains (to see if it's being invoked) it seems to fall back to the driver compiler, if it's trying to invoke it at all.

I normally invoke the compiler using this command: glslangValidator %(FullPath) -G -o $(TargetDir)Shaders\%(Filename)%(Extension).spv

Do I have this set up correctly?

Cheers, Shane

On Fri, Apr 22, 2022 at 12:01 PM Daniel Scherzer < @.***> wrote:

Thanks for the praise!

Ah ok I see the problem and the solution: As a default the extension tries to compile your shader with the glsl compiler of the OpenGL driver of your graphics card. For instance my graphic driver (and it seems yours too) (NV2080) does not support the uint16_t for OpenGL. Solution: Use an external compiler like glslangValidator. Info on how to: https://github.com/danielscherzer/GLSL#external-compiler

Short version: set the path to glslangvalidator in the extension options and specify arguments. For my setup: Arguments: -v External compiler: D:\Tools_Programming\glslang\bin\glslangValidator.exe

Then the squiggles disappear for me. Does this help?

— Reply to this email directly, view it on GitHub https://github.com/danielscherzer/GLSL/issues/102#issuecomment-1106698742, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXVB3ADR5SFKT3UU5HJGHQDVGLLPFANCNFSM5UAA7M4A . You are receiving this because you authored the thread.Message ID: @.***>

danielscherzer commented 2 years ago

Could you try: Argument: -v External compiler: full path to external compiler.

smileyofoz commented 2 years ago

Hi Daniel, I did so and the result I get is that the tool never seems to end, but it does not complain about the 10s timeout and abort, either: [image: image.png]

PS I applied the update that was released today, if that is of interest :)

Cheers and thank you so much for continuing to work with me!

On Sun, Apr 24, 2022 at 3:01 PM Daniel Scherzer @.***> wrote:

Could you try: Argument: -v External compiler: full path to external compiler.

— Reply to this email directly, view it on GitHub https://github.com/danielscherzer/GLSL/issues/102#issuecomment-1107908513, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXVB3ADNVGE3LM5TVRGIVQLVGWSCNANCNFSM5UAA7M4A . You are receiving this because you authored the thread.Message ID: @.***>

smileyofoz commented 2 years ago

Hello again Daniel!

I'd like to make a feature request please. When typing comments, the keyword completion remains active, causing the plugin to insert keywords from its list when I hit enter, instead of just entering a new line. I then need to go back and delete the inserted keyword. Would it be possible to switch off auto-suggest when in comments or comment blocks?

Thank you, Shane

On Sun, Apr 24, 2022 at 4:37 PM Shane Cheary @.***> wrote:

Hi Daniel, I did so and the result I get is that the tool never seems to end, but it does not complain about the 10s timeout and abort, either: [image: image.png]

PS I applied the update that was released today, if that is of interest :)

Cheers and thank you so much for continuing to work with me!

On Sun, Apr 24, 2022 at 3:01 PM Daniel Scherzer @.***> wrote:

Could you try: Argument: -v External compiler: full path to external compiler.

— Reply to this email directly, view it on GitHub https://github.com/danielscherzer/GLSL/issues/102#issuecomment-1107908513, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXVB3ADNVGE3LM5TVRGIVQLVGWSCNANCNFSM5UAA7M4A . You are receiving this because you authored the thread.Message ID: @.***>

danielscherzer commented 2 years ago

just switching it off could be problematic if you want auto complete in comments, maybe an option switch would be ok for you too?

smileyofoz commented 2 years ago

Yes thank you Daniel - that would fulfill my needs perfectly! Cheers and thanks again for such a great tool!

Shane

On Thu, Jun 16, 2022, 14:32 Daniel Scherzer @.***> wrote:

just switching it off could be problematic if you want auto complete in comments, maybe an option switch would be ok for you too?

— Reply to this email directly, view it on GitHub https://github.com/danielscherzer/GLSL/issues/102#issuecomment-1158006858, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXVB3AAC3FUNHDJIVH4VHH3VPNXKVANCNFSM5UAA7M4A . You are receiving this because you authored the thread.Message ID: @.***>

smileyofoz commented 2 years ago

Actually I see this in the bottom left hand side of the IDE: [image: image.png] I imagine this is related... Cheers

On Sun, Apr 24, 2022 at 2:24 PM Shane Cheary @.***> wrote:

Hello Daniel, thanks again for the reply mate. I've tried setting the external compiler up and I'm not convinced that it's being invoked: [image: image.png] The squiggles are still there. If I try to misname the glslangValidator executable to see if it complains (to see if it's being invoked) it seems to fall back to the driver compiler, if it's trying to invoke it at all.

I normally invoke the compiler using this command: glslangValidator %(FullPath) -G -o $(TargetDir)Shaders\%(Filename)%(Extension).spv

Do I have this set up correctly?

Cheers, Shane

On Fri, Apr 22, 2022 at 12:01 PM Daniel Scherzer @.***> wrote:

Thanks for the praise!

Ah ok I see the problem and the solution: As a default the extension tries to compile your shader with the glsl compiler of the OpenGL driver of your graphics card. For instance my graphic driver (and it seems yours too) (NV2080) does not support the uint16_t for OpenGL. Solution: Use an external compiler like glslangValidator. Info on how to: https://github.com/danielscherzer/GLSL#external-compiler

Short version: set the path to glslangvalidator in the extension options and specify arguments. For my setup: Arguments: -v External compiler: D:\Tools_Programming\glslang\bin\glslangValidator.exe

Then the squiggles disappear for me. Does this help?

— Reply to this email directly, view it on GitHub https://github.com/danielscherzer/GLSL/issues/102#issuecomment-1106698742, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXVB3ADR5SFKT3UU5HJGHQDVGLLPFANCNFSM5UAA7M4A . You are receiving this because you authored the thread.Message ID: @.***>