Hey fellow DX11 shader programmers.
Here’s a little MonoDevelop addin that might help you out. It adds syntax highlighting for .compute files.
Background info
Syntax highlighting for compute files in MonoDevelop didn’t work for me, so I spent some time learning how to define new language syntax in MonoDevelop. Perhaps that wasn’t necessary, because there’s a chance my installation of Unity4 is simply corrupt, and reinstalling could fix it, but I happen to dislike reinstalling software, and I like learning a new skill.
So I made a basic addin for the Unity4 version of MonoDevelop 2.8 that makes it handle .compute files like the other shader files (mimetype text/x-shader). I didn’t bother making it a proper addin with compatibility checks (it simply assumes you are using the Unity version of MonoDevelop 2.8 ), because I want to get back to working on the DirectX11 contest. But it might still help some of you guys out, so I’ve attached the dll to this post.
Functionality
v1.0
- .compute files are highlighted as if they’re shaderlab shaders.
- Massages your eyes with your chosen syntax highlighting color scheme
- Reduces stress caused by code that is supposed to be commented out, but isn’t
- It also magically makes ‘Toggle Line Comment(s)’ work
v1.2
- Texture1D
- Texture1DArray
- Texture2D
- Texture2DArray
- Texture3D
- RWTexture2D
- TextureCube
- uint, uint2, uint3
v1.3
- uint, dword double matrices
- SM5 Semantics
- SM5 Objects
v1.4
- This version is compiled for MonoDevelop 4.0.1
Installation
Download the latest zipfile. It contains a dll file inside a bunch of folders which, if you’re using Windows 7, need to go into the %USERPROFILE%/AppData/Local/MonoDevelop-Unity-2.8
folder. So the actual dll file ends up here: %USERPROFILE%/AppData/Local/MonoDevelop-Unity-2.8/LocalInstall/Addins/MonoDevelop.DirectComputeSyntax/MonoDevelop.DirectComputeSyntax.dll
Since Unity 4.3 uses Mono Develop 4.0.1, the correct location is:
%USERPROFILE%/AppData/Local/MonoDevelop-Unity-4.0
If you happen to be using MonoDevelop 4 on OS X, this should be the install location:
~/Library/Application Support/XamarinStudio-4.0/LocalInstall/Addins
Downloads
version 1.4 (for MonoDevelop 4.0.1)
version 1.3 (for MonoDevelop 2.8 )
version 1.2 was not released
version 1.1
version 1.0(only default shaderlab syntax)
Or create it yourself
If you distrust dll files, here’s the xml file you need to create the addin yourself:
DirectComputeSyntax.addin.xml:
<Addin namespace = "MonoDevelop"
id = "DirectComputeSyntax"
name = "DirectCompute Syntax Mode"
author = "Laurens Mathot"
copyright = "MIT X11"
url = "http://codeanimo.com"
description = "Adds basic Syntax Highlighting support for DirectCompute .compute files"
category = "Language bindings"
version = "1.0">
<Dependencies>
<Addin id="Core" version="2.8" />
<Addin id="Ide" version="2.8" />
<Addin id="SourceEditor2" version="2.8" />
</Dependencies>
<Extension path="/MonoDevelop/Core/MimeTypes">
<MimeType id="text/x-shader" _description="DirectCompute file" isText="true">
<File pattern="*.compute" />
</MimeType>
</Extension>
</Addin>
That probably still has some remains from the experiments with custom Syntax Highlighting, but it should do the trick.
Good luck with the DX11 contest, please make something that is awesome, but somehow does not win, and gives me a chance
1127569–74253–$MonoDevelop DirectCompute Highlighting 1.4.zip (3.26 KB)