Skip to content

Instantly share code, notes, and snippets.

@jbevain
Last active January 7, 2016 19:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jbevain/3215321cd869ca66f6e5 to your computer and use it in GitHub Desktop.
Save jbevain/3215321cd869ca66f6e5 to your computer and use it in GitHub Desktop.

#The hacky way of getting VS to provide syntax highlighting for Unity's compute shaders.

  1. Turn off Visual Studio

  2. 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.

  1. 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}"
  1. Open a Visual Studio 2015 Developer Prompt, and input devenv /updateconfiguration

  2. Open Visual Studio 2015, compute shaders will be colorized as HLSL in VS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment