tgjones / HlslTools

A Visual Studio extension that provides enhanced support for editing High Level Shading Language (HLSL) files
http://timjones.io/blog/archive/2016/04/25/hlsl-tools-for-visual-studio-v1.0-released
Other
561 stars 97 forks source link

Macro argument in UNITY_FOG_COORDS(1) disappear when formatting #197

Closed emilberwald closed 3 years ago

emilberwald commented 3 years ago

Macro argument for UNITY_FOG_COORDS(1) disappears for some reason after pressing Ctrl K + Ctrl D

Minimal example should be something like:

shadertoolsconfig.json: { "hlsl.preprocessorDefinitions": { }, "hlsl.additionalIncludeDirectories": [ "C:/Program Files/Unity/Hub/Editor/2020.1.9f1/Editor/Data/CGIncludes" ] }

`#include "UnityCG.cginc"

struct OUTPUT { UNITY_FOG_COORDS(1) };`

tgjones commented 3 years ago

Thanks for reporting this 👍

Ph0t0nX commented 3 years ago

How are you guys getting it working with the .shader files?

emilberwald commented 3 years ago

How are you guys getting it working with the .shader files?

I #include .hlsl files to be able to separate unity-specific stuff with general shader stuff. I think it worked out of the box for me when I did that, had to update the shader tools config file when I updated Unity is all. Haven't tried with this bugfix yet but it sounds great to have it solved.