#The hacky way of getting VS to provide syntax highlighting for Unity's compute shaders.
-
Turn off Visual Studio
-
In
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\VC
As administrator, remove the read-only flag on the file VC_Pkg_Core_Registration.pkgdef
, and edit it in a evelated text editor.
- Search for .cginc, and for each cginc entry in the file, add a similar entry for .compute. Like this:
"cginc"=dword:00000028
"compute"=dword:00000028
Or
[$RootKey$\Languages\File Extensions\.compute]
"HLSLFile"=dword:00000001
@="{B2F072B0-ABC1-11D0-9D62-00C04FD9DFD9}"
[$RootKey$\Languages\File Extensions\.cginc]
"HLSLFile"=dword:00000001
@="{B2F072B0-ABC1-11D0-9D62-00C04FD9DFD9}"
-
Open a Visual Studio 2015 Developer Prompt, and input devenv /updateconfiguration
-
Open Visual Studio 2015, compute shaders will be colorized as HLSL in VS.