VS2010 - HLSL Intellisense?
Asked Answered
S

5

12

Are there any free components out there that will give highlighting and/or intellisense for HLSL?

I've seen mentions of something called "InteliSense.Net," but the author's site is down and I can't find a download anywhere.

Swanky answered 24/11, 2010 at 17:21 Comment(3)
The trouble with this is that HLSL changes between D3D versions. If you developed an HLSL Intellisense plugin, you wouldn't know if a construct is valid or not.Northumbria
Isn't that a concern with any language? VS does quite well telling the difference between different versions of C#, for instance. If this isn't the way to go, is there a dedicated hlsl editor that might provide this functionality?Swanky
You don't use multiple versions of C# in the same project changed by an #ifdef, which you can with HLSL. You also can't change the compiled C# files at runtime, which you also can with HLSL.Northumbria
C
14

Not a direct answer to your question, but this is what I do to solve the same problem:

I set Visual Studio to open *.fx files in Notepad++. (Right click the file, Open With, Add Notepad++, Set Default). Of course, you can use any editor you like.

I use a HLSL syntax highlighting file for Notepad++ that I found on Google. I think it's this one.

And finally, I keep this MSDN page open in my browser: Intrinsic Functions (DirectX HLSL). Because HLSL is so simple - with no way to mess around defining classes and such - and the programs are usually quite small and self-contained, I find that this is sufficient.

Christoperchristoph answered 25/11, 2010 at 5:1 Comment(4)
Exactly what I needed, though not what I asked for. Thanks!Swanky
Found out yesterday that HLSL does support classes. Who knew?!Swanky
Its so sad that developers have to use Notepad++ to get syntax highlighting for HLSL. You hear me MSFT?? SAD!!Lugworm
Note:VS11 provides shader syntax highlighting.Swanky
L
12

Try NShader that is a VS2012/2010/2008 extension for HLSL/CG/GLSL syntax highlighting.

Loco answered 22/12, 2010 at 18:56 Comment(1)
+1 Thanks for the link. I already have syntax highlighting working; was really looking for intellisense.Swanky
Z
3

With a little effort you can configure manually MSVC2010 IDE in a way it will highlight HLSL files and will do partial auto-completion/intelisense:

Part 1)

  1. In 'Tools' menu click 'Options'
  2. In the 'Options' dialog box expand to 'Text Editor' node and select 'File Extension'
  3. Now on the right side you can add extensions and configure editor for them
  4. Add extensions: hlsl and fx with 'Editor' field set to 'Microsoft Visual C++'
  5. Check 'Map extensions files to' and set it to 'Microsoft Visual C++'

Part 2)

Create 'usertype.dat' text file beside VCExpress.exe or devenv.exe (typically located "c:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\"). Populate 'usertype.dat' file with hlsl keywords you want highlighted i.e:

float2
float3
float4
float4x4
matrix
cbuffer
tbuffer

Part 3) Restart MSVC

Part 4) In VC Open 'Tools'\'Options' dialog box again and navigate to 'Environment'\'Fonts and Colors' and configure it to your liking. Color of user keywords added via 'usertype.dat' is controlled through 'C/C++ User Keywords' display item (Personally I matched it with 'Keyword' settings).

Part 4a) In VC 'Tools'\'Options'\'Text Editor'\'C/C++'\'Advanced' on the right side you might want to consider setting field 'Disable Squiggles' to true (since hlsl is not a valid C++ code VC would normally underline C++ compile errors in your shader code)

Zingg answered 15/3, 2012 at 6:22 Comment(0)
M
2

ShaderSense project seems to solve syntax highlighting and some kind of intellisense for HLSL files

Mesocarp answered 1/11, 2012 at 9:50 Comment(1)
You must build ShaderSense yourself using MSVC 2008 which requires MSVC 2008 SP1 and the Visual Studio SDK.Casuist
T
2

HLSL Tools for Visual Studio brings IntelliSense to HLSL in Visual Studio. It includes statement completion, signature help, live errors, quick info, and more.

HLSL Tools screenshot

Disclaimer - I'm the author of HLSL Tools.

Thoughtful answered 13/1, 2017 at 10:16 Comment(2)
I don't know if it's a coincidence or not, but after I install this add-on for my Visual Studio 2015, the Rundll32.exe consumes my Ram memory (up to 3Gb) and Disk usage (100%), then wicainventory. exe make my Disk usage 100% - even I restart, turn off, turn on - won't fix it. After I uninstall this add-on, my laptop run fine again (don't see Rundll32.exe & wicainventory. exe anymore).Celestyn
Although this add-on for VS is very very great, but because the problem I mention in the previous comment, I think it's better if it's for Notepad++.Celestyn

© 2022 - 2024 — McMap. All rights reserved.