danielscherzer / GLSL

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

Problem with Custom file extensions .vsh .vshader #32

Open graptis opened 5 years ago

graptis commented 5 years ago

Installed product versions

Description

Custom vertex shader extension not applied (Fragment shader extension is applied normally).

Steps to recreate

  1. Open Options->GLSLangIntegration->Configure
  2. Replace ".vert",".frag" extensions with ".vert;.vsh", ".frag;.fsh"
  3. Save, close and reopen visual studio
  4. Prepare 4 files: 1 vertex shader with name "anyname.vert", a copy of it with name "anyname.vsh", a fragment shader with name "anyname.frag", a copy of it with name "anyname.fsh". Open them in visual studio.

Current behavior

The file anyname.vsh does not have GLSL syntax highlighting and live compilation. The files anyname.vert, anyname.frag, anyname.fsh all have correct GLSL syntax highlighting and live compilation.

Expected behavior

All four files have GLSL syntax highlighting and live compilation.

danielscherzer commented 5 years ago

Hi! Thanks for your feedback! I can reconstruct this behaviour. First: if you change the file extensions you have to restart VS Studio. After this the frag and vert extensions are treated as unknown as expected. Then the problem with vsh (also vshader): These exensions are somehow associated with hsl shader files and Visual Studio ignores my extension in this case (even if you have no DirectX specific VS packages installed). If you for instance use a different vertex shader extension, like vvv (restart) my extension works as expected. I have not found a way to force Visual Studio to forget about these (maybe internal) hlsl extensions, sorry. If you have any idea (insider knowledge) how to solve this I would be happy to include it into the code. Cheers, Daniel

graptis commented 5 years ago

Gotcha. I do not really know how to solve this either, if I come up with any relevant information I'll be happy to share (odds of that are astronomically low though :( ). Close or leave open to avoid other people reporting the same?

danielscherzer commented 5 years ago

Leave it open! Thanks!