VS2010 - HLSL Intellisense?

前端 未结 5 2015
北荒
北荒 2021-01-04 13:09

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 th

5条回答
  •  借酒劲吻你
    2021-01-04 13:09

    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)

提交回复
热议问题