HLSL linter for VSCode
Setup
- Compile or download a build of DirectX Shader Compiler:
https://github.com/Microsoft/DirectXShaderCompiler
- Add
dxc executable to PATH or set hlsl.linter.executablePath .
- Add your shader include directories to
hlsl.linter.includeDirs (Optional)
Usage
Use INPUTS or INPUTS(type) comments to tell the linter what variables are defined outside the scope:
// INPUTS(float2): uv
// INPUTS(Texture2D): Tex1
// INPUTS(SamplerState): LinearClamp
float4 color = Tex1.Sample(LinearClamp, uv);
Use @nolint inside a // comment to disable linting for a single line:
float a = some_function(); // @nolint
| |