{"id":32127923,"url":"https://github.com/antaalt/shader-validator","last_synced_at":"2026-01-31T19:06:04.239Z","repository":{"id":251491714,"uuid":"595348416","full_name":"antaalt/shader-validator","owner":"antaalt","description":"HLSL / GLSL / WGSL extension for vscode","archived":false,"fork":false,"pushed_at":"2025-11-30T16:56:03.000Z","size":16751,"stargazers_count":50,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-12-30T16:51:58.670Z","etag":null,"topics":["glsl","hlsl","linting","lsp","shader","typescript","wgsl"],"latest_commit_sha":null,"homepage":"https://marketplace.visualstudio.com/items?itemName=antaalt.shader-validator","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/antaalt.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-01-30T22:30:15.000Z","updated_at":"2025-12-29T21:20:58.000Z","dependencies_parsed_at":"2024-09-07T15:49:52.805Z","dependency_job_id":"f017e4f4-ec9e-4d37-848c-0c3c25ae870d","html_url":"https://github.com/antaalt/shader-validator","commit_stats":null,"previous_names":["antaalt/shader-validator"],"tags_count":42,"template":false,"template_full_name":null,"purl":"pkg:github/antaalt/shader-validator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antaalt%2Fshader-validator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antaalt%2Fshader-validator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antaalt%2Fshader-validator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antaalt%2Fshader-validator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/antaalt","download_url":"https://codeload.github.com/antaalt/shader-validator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antaalt%2Fshader-validator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28950409,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T18:30:42.805Z","status":"ssl_error","status_checked_at":"2026-01-31T18:30:19.593Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["glsl","hlsl","linting","lsp","shader","typescript","wgsl"],"created_at":"2025-10-21T00:41:27.432Z","updated_at":"2026-01-31T19:06:04.233Z","avatar_url":"https://github.com/antaalt.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Shader validator\n\n[![Rust](https://img.shields.io/badge/Rust-%23000000.svg?e\u0026logo=rust\u0026logoColor=white)](https://www.rust-lang.org/)\n[![extension issues](https://img.shields.io/github/issues/antaalt/shader-validator.svg?label=extension%20issues)](https://github.com/antaalt/shader-validator/issues)\n[![server issues](https://img.shields.io/github/issues/antaalt/shader-sense.svg?label=server%20issues)](https://github.com/antaalt/shader-sense/issues)\n[![vsmarketplace](https://img.shields.io/visual-studio-marketplace/v/antaalt.shader-validator?color=blue\u0026label=vscode%20marketplace)](https://marketplace.visualstudio.com/items?itemName=antaalt.shader-validator)\n[![openVSX registry](https://img.shields.io/open-vsx/v/antaalt/shader-validator?color=purple)](https://open-vsx.org/extension/antaalt/shader-validator)\n\nThis is a vscode extension allowing syntax highlighting, linting \u0026 symbol providing for HLSL / GLSL / WGSL shaders. It is using [shader-language-server](https://github.com/antaalt/shader-sense/tree/main/shader-language-server), a shader language server written in Rust to lint shaders using common validator API \u0026 parse symbols for some code inspection.\n\nIt is mostly intended to be used with big shader codebase used in production by providing interesting features such as region selection and a shader variant entry point selection for quickly switching between two entry point context with decent performances. This make it also quite reliable for small shader codebase.\n\nCurrently, it support some features and languages:\n\n-   **[Syntax Highlighting](#syntax-highlighting)**: Improved syntax highlighting for code.\n-   **[Diagnostic](#diagnostics)**: Highlight errors \u0026 warning as user type code.\n-   **[Goto](#goto)**: Go to a symbol definition.\n-   **[Completion](#autocompletion)**: Suggest completion items.\n-   **[Hover](#hover)**: Add tooltip when hovering symbols.\n-   **[Signature](#signature)**: Provide signatures when completing a function.\n-   **[Formatting](#formatting)**: Format shader code.\n-   **[Inlay hints](#inlay-hints)**: Add hints to function calls.\n-   **[Variant](#variants)**: Define multiple shader variant entry point \u0026 quickly switch between them. \n-   **[Regions](#regions)**: Detect inactive regions in code due to preprocessor and grey them out.\n\n|Language|Syntax Highlighting|Diagnostics |User symbols |Built-in symbols|Regions|Format|\n|--------|-------------------|------------|-------------|----------------|-------|------|\n|GLSL    |✅                 |✅(glslang)|✅           |✅             |✅     |✅   |\n|HLSL    |✅                 |✅(DXC)    |✅           |✅             |✅     |✅   |\n|WGSL    |✅                 |✅(Naga)   |❌           |❌             |❌     |❌   |\n\n## Features\n\n### Syntax highlighting\n\nThis extension provide improved syntax highlighting for HLSL, GLSL \u0026 WGSL than the base one in VS code.\n\n![syntax-highlighting](res/doc/syntax-highlighting.png)\n\n### Diagnostics\n\nYou cant lint your code in real time through this extension:\n\n-   GLSL relies on Glslang.\n-   HLSL relies on DirectX shader compiler on desktop, Glslang on the web (see below).\n-   WGSL relies on Naga.\n\n![diagnostic](res/doc/diagnostic.png)\n\n### Autocompletion\n\nThe extension will suggest you symbols from your file and intrinsics as you type.\n\n![diagnostic](res/doc/completion.png)\n\n### Signature\n\nView available signatures for your function as you type it.\n\n![diagnostic](res/doc/signature.png)\n\n### Hover\n\nView informations relative to a symbol by hovering it.\n\n![diagnostic](res/doc/hover.png)\n\n### Goto\n\nGo to your declaration definition by clicking on it.\n\n![diagnostic](res/doc/goto.png)\n\n### Formatting\n\nFormat your code using clang-format, configurable with .clang-format. clang-format need to be available in path.\n\n### Inlay hints\n\nAdd inlay hints to your function calls. \n\n![inlay-hints](res/doc/inlay-hints.png)\n\n\u003e You can disable this in settings.json (default pressed is Ctrl+Alt)\n\u003e ```json \n\u003e \"editor.inlayHints.enabled\": \"on\"\n\u003e \"editor.inlayHints.enabled\": \"onUnlessPressed\"\n\u003e \"editor.inlayHints.enabled\": \"off\"\n\u003e \"editor.inlayHints.enabled\": \"offUnlessPressed\"\n\u003e ```\n\n### Variants\n\nSwap shader variant on the fly to change entry point \u0026 macro definition. This allow you to define and easily change between the one you have set, affecting regions. For example when you have a lot of entry point in a single shader file, splitted using macros, or want to see the content from your dependencies with the context passed from you main entry point.\n\nYou can then access these variants directly from the dedicated window and then access them by clicking on them.\n\nA neat feature for big shader codebase with lot of entry point everywhere !\n\nYou can add one with the dedicated window or using the command `shader-validator.addCurrentFileVariant`. It will also help dxc and glslang validating your file in a huge codebase where DXC take a lot of time to validate using the lib profile.\n\n![shader-variant](res/doc/variants.png)\n\n### Regions\n\nGrey out inactive regions depending on currently declared preprocessor \u0026 filter symbols.\n\n![diagnostic](res/doc/inactive-regions.png)\n\n### And much more\n\nThis extension also support some features such as document symbols, workspace symbols...\n\n## Extension Settings\n\nThis extension contributes the following settings:\n\n*   `shader-validator.validate`: Enable/disable validation with common API.\n*   `shader-validator.symbols`: Enable/disable symbol inspection \u0026 providers.\n*   `shader-validator.symbolDiagnostics`: Enable/disable symbol provider debug diagnostics.\n*   `shader-validator.severity`: Select minimal log severity for linting.\n*   `shader-validator.includes`: All custom includes for linting.\n*   `shader-validator.pathRemapping`: All virtual paths.\n*   `shader-validator.defines`: All custom macros and their values.\n*   `shader-validator.stageDefine.[vertex|fragment|compute...]`: All custom macros and their values for custom shader stages.\n*   `shader-validator.serverPath`: Use a custom server instead of the bundled one.\n*   `shader-validator.updateSymbolsOnVariantUpdate`: Update symbol outline when changing variant. Will trigger a save event.\n*   `shader-validator.trace.server`: Show debug logs into an output channel. Can be accessed via shader-validator status bar.\n\n### HLSL specific settings: \n\n*   `shader-validator.hlsl.enabled`: Control if server handle this language.\n*   `shader-validator.hlsl.shaderModel`: Specify the shader model to target for HLSL\n*   `shader-validator.hlsl.version`: Specify the HLSL version\n*   `shader-validator.hlsl.enable16bitTypes`: Enable 16 bit types support with HLSL\n*   `shader-validator.hlsl.spirv`: Enable SPIRV Vulkan syntax support for HLSL\n\n### GLSL specific settings:\n\n*   `shader-validator.glsl.enabled`: Control if server handle this language.\n*   `shader-validator.glsl.targetClient`: Specify the OpenGL or Vulkan version for GLSL\n*   `shader-validator.glsl.spirvVersion`: Specify the SPIRV version to target for GLSL\n*   `shader-validator.glsl.preamble`: Add a path to a preamble file for all GLSL shaders.\n\n### WGSL specific settings:\n\n*   `shader-validator.wgsl.enabled`: Control if server handle this language.\n\n## Commands\n\n*   `shader-validator.startServer`: Start the server if it was stopped or crashed.\n*   `shader-validator.stopServer`: Stop the server.\n*   `shader-validator.restartServer`: Restart the server if you have any issue.\n*   `shader-validator.addCurrentFileVariant`: Add a variant to the current file.\n*   `shader-validator.showLogs`: Open the extension log window.\n*   `shader-validator.dumpDependency`: Print dependency tree in logs. mostly for debug.\n*   `shader-validator.dumpAst`: Print internal ast in logs. mostly for debug.\n\n## Platform support\n\nThis extension is supported on every platform, but some limitations are to be expected on some:\n-   Windows x86_64: full feature set.\n-   Linux x86_64: full feature set.\n-   Mac \u0026 ARM Linux / Windows: Rely on WASI version of server, same as web, see web support for limitations.\n\n## IDE support\n\nThis extension is based on a [language-server](https://github.com/antaalt/shader-sense/tree/main/shader-language-server) written in Rust and following the [LSP protocol](https://microsoft.github.io/language-server-protocol/). This client will only work on VSCode. But what is cool about a language server is that not only VSCode support this protocol ! I personnally don't have the time for implementing and supporting all supporting IDE, but feel free to create a client for your favorite IDE using the language server.\n\n## Web support\n\nThis extension run on the web on [vscode.dev](https://vscode.dev/). It is relying on the [WebAssembly Execution engine](https://marketplace.visualstudio.com/items?itemName=ms-vscode.wasm-wasi-core). Because of this restriction, we can't use dxc on the web as it does not compile to WASI and instead rely on glslang, which is more limited in linting (Only support some basic features of SM 6.0, while DXC support all newly added SM (current 6.8)).\n\n\n## Questions and answers\n\n### My shader entry point is hidden behind an inactive region and does not display symbols.\n\nYou can use shader variant to declare the entry point and the necessary macro without having to pass through global defines which might impact global state. It will also speed up validation by setting a stage and entry point.\n\n### Request are really slow on big HLSL files\n\nYou can use shader variant and specify an entry point to speed up things. By default the extension is using the dxc lib profile which is quite a heavy process with big files with a lot of includes. By setting an entry point along a stage, it will speed up validation, but dxc might still have a hard time. Letting the server know where your code start can help it cache everything to the right place !\n\n### I am having an issue, how to handle it ?\n\nIf you encounter an issue with the extension, first you can check the server status by looking at the status bar below. If everything seems fine, you might want to check the log to see what is happening. You can simply click on the link in the status bar or go to the output tab of the terminal and use the scrolling menu to select Shader Language Server. Make sure you have set setting `shader-validator.trace.server` to verbose or messages at least.\n\n## Credits\n\nThis extension is based on a heavily modified version of PolyMeilex [vscode-wgsl](https://github.com/PolyMeilex/vscode-wgsl)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantaalt%2Fshader-validator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fantaalt%2Fshader-validator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantaalt%2Fshader-validator/lists"}