resharper-unity icon indicating copy to clipboard operation
resharper-unity copied to clipboard

HLSL autocomplete missing common semantics

Open jamesplease opened this issue 2 years ago • 2 comments

What I'm seeing

Common semantics are missing from autocomplete in Rider. A list of missing semantics are:

  • TEXCOORD0 (more generally, TEXCOORD{n})
  • SV_POSITION
  • POSITION
  • INTERNALTESSPOS
  • SV_TESSFACTOR
  • SV_INSIDETESSFACTOR

though there may be others. The following screenshot shows the autocomplete suggestions when beginning to type SV_POSITION.

image

If it would be helpful I can provide more screenshots of what appears when I start typing those other semantics.

Expected behavior

These common semantics would be included as autocomplete suggestions.

Environmental Setup

  • Rider version: 2022.3.1
  • Unity version: 2021.3.16f1 (LTS)
  • Jetbrains Rider Editor package: 3.0.18

The shaders are included in the .csproj file in the following way:

<None Include="Assets\Materials\Shaders\Plot.shader" />

Other features are functioning correctly, including code formatting, syntax highlighting, and context-aware features such as recognizing when #include'd files are used or not.

Lastly, these shaders are being written in ShaderLab files with a .shader extension and are within HLSLPROGRAM and ENDHLSL.

Other Notes

Tested on 2 different PCs running Windows 11 and on several different Unity projects.


Originally asked here: https://github.com/JetBrains/resharper-unity/issues/216#issuecomment-1384092151

jamesplease avatar Jan 16 '23 16:01 jamesplease

Thanks. After investigation, these are intrinsics that are automatically defined, rather than defined in files that are added to the context via #include. As such, the system doesn't know about them unless we also add them to the parse context.

citizenmatt avatar Jan 23 '23 09:01 citizenmatt

Thanks so much for looking into this! If there’s a way for me to PR adding these to the parse context I’d be happy to.

jamesplease avatar Jan 23 '23 14:01 jamesplease