{"id":34634485,"url":"https://github.com/gogpu/naga","last_synced_at":"2026-05-01T10:03:56.534Z","repository":{"id":328191687,"uuid":"1110695568","full_name":"gogpu/naga","owner":"gogpu","description":"Pure Go Shader Compiler — WGSL to SPIR-V, MSL, GLSL, HLSL, DXIL. Zero CGO.","archived":false,"fork":false,"pushed_at":"2026-04-29T16:14:45.000Z","size":3554,"stargazers_count":33,"open_issues_count":0,"forks_count":4,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-29T18:15:26.035Z","etag":null,"topics":["compiler","directx","dxil","glsl","go","golang","gpu","graphics","hlsl","metal","msl","opengl","pure-go","shader","spirv","vulkan","webgpu","wgsl"],"latest_commit_sha":null,"homepage":null,"language":"Go","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/gogpu.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":"ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-05T15:25:01.000Z","updated_at":"2026-04-29T16:14:27.000Z","dependencies_parsed_at":"2026-02-15T13:01:03.481Z","dependency_job_id":null,"html_url":"https://github.com/gogpu/naga","commit_stats":null,"previous_names":["gogpu/naga"],"tags_count":49,"template":false,"template_full_name":null,"purl":"pkg:github/gogpu/naga","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gogpu%2Fnaga","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gogpu%2Fnaga/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gogpu%2Fnaga/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gogpu%2Fnaga/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gogpu","download_url":"https://codeload.github.com/gogpu/naga/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gogpu%2Fnaga/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32492595,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["compiler","directx","dxil","glsl","go","golang","gpu","graphics","hlsl","metal","msl","opengl","pure-go","shader","spirv","vulkan","webgpu","wgsl"],"created_at":"2025-12-24T16:59:39.021Z","updated_at":"2026-05-01T10:03:56.521Z","avatar_url":"https://github.com/gogpu.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003enaga\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003ePure Go Shader Compiler\u003c/strong\u003e\u003cbr\u003e\n  WGSL to SPIR-V, MSL, GLSL, HLSL, and DXIL. Zero CGO.\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/gogpu/naga/actions/workflows/ci.yml\"\u003e\u003cimg src=\"https://github.com/gogpu/naga/actions/workflows/ci.yml/badge.svg\" alt=\"CI\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://codecov.io/gh/gogpu/naga\"\u003e\u003cimg src=\"https://codecov.io/gh/gogpu/naga/branch/main/graph/badge.svg\" alt=\"codecov\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://pkg.go.dev/github.com/gogpu/naga\"\u003e\u003cimg src=\"https://pkg.go.dev/badge/github.com/gogpu/naga.svg\" alt=\"Go Reference\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://goreportcard.com/report/github.com/gogpu/naga\"\u003e\u003cimg src=\"https://goreportcard.com/badge/github.com/gogpu/naga\" alt=\"Go Report Card\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://opensource.org/licenses/MIT\"\u003e\u003cimg src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" alt=\"License\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/gogpu/naga/releases\"\u003e\u003cimg src=\"https://img.shields.io/github/v/release/gogpu/naga\" alt=\"Latest Release\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/gogpu/naga\"\u003e\u003cimg src=\"https://img.shields.io/badge/Go-1.25+-00ADD8?logo=go\" alt=\"Go Version\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/gogpu/naga\"\u003e\u003cimg src=\"https://img.shields.io/badge/CGO-none-success\" alt=\"Zero CGO\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/gogpu/gogpu/stargazers\"\u003e\u003cimg src=\"https://img.shields.io/github/stars/gogpu/gogpu?style=flat\u0026labelColor=555\u0026color=yellow\" alt=\"Stars\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/gogpu/gogpu/discussions\"\u003e\u003cimg src=\"https://img.shields.io/github/discussions/gogpu/gogpu?style=flat\u0026labelColor=555\u0026color=blue\" alt=\"Discussions\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003csub\u003ePart of the \u003ca href=\"https://github.com/gogpu\"\u003eGoGPU\u003c/a\u003e ecosystem\u003c/sub\u003e\n\u003c/p\u003e\n\n\n\n---\n\n## Overview\n\n**naga** is a shader compiler written entirely in Go. It compiles WGSL (WebGPU Shading Language) to multiple backend formats without requiring CGO or external dependencies.\n\n### Key Features\n\n| Category | Capabilities |\n|----------|--------------|\n| **Input** | Full WGSL parser (120+ tokens), 48 short type aliases (`vec3f`, `mat4x4f`...), abstract constructors |\n| **Outputs** | SPIR-V, MSL, GLSL, HLSL — 100% validation; DXIL — 94.7% IDxcValidator (experimental) |\n| **Compute** | Storage buffers, workgroups, atomics, barriers, subgroup operations |\n| **Ray Tracing** | Ray query types, acceleration structures, 7 ray query builtins |\n| **Compatibility** | **144/144 (100%)** reference shaders compile. Five-layer exact match: **IR 144/144**, **SPIR-V 87/87**, **MSL 91/91**, **GLSL 68/68**, **HLSL 72/72** — complete Rust naga parity on all backends |\n| **Build** | Zero CGO, single binary |\n\n---\n\n## Features\n\n- **Pure Go** — No CGO, no external dependencies\n- **WGSL Frontend** — Full lexer and parser (120+ tokens), 48 short type aliases (`vec3f`, `mat4x4f`, etc.), abstract constructors (`vec3(1,2,3)`)\n- **Rust Naga Compatibility** — **144/144 (100%)** reference shaders compile. Five-layer exact match: **IR 144/144**, **SPIR-V 87/87**, **MSL 91/91**, **GLSL 68/68**, **HLSL 72/72** — complete Rust naga parity on all backends. 164 snapshot tests with 994 golden outputs\n- **IR** — Complete intermediate representation (expressions, statements, types)\n- **Compute Shaders** — Storage buffers, workgroup memory, `@workgroup_size`\n- **Atomic Operations** — atomicAdd, atomicSub, atomicMin, atomicMax, atomicCompareExchangeWeak\n- **Barriers** — workgroupBarrier, storageBarrier, textureBarrier\n- **Type Inference** — Automatic type resolution for all expressions, including `let` bindings\n- **Type Deduplication** — SPIR-V compliant unique type emission\n- **Array Initialization** — `array(1, 2, 3)` shorthand with inferred type and size\n- **Texture Sampling** — textureSample, textureLoad, textureStore, textureDimensions, textureGather, textureSampleCompare\n- **Swizzle Operations** — Full vector swizzle support (`.xyz`, `.rgba`, `.xxyy`, etc.)\n- **Function Calls** — `OpFunctionCall` support for modular WGSL shaders with helper functions\n- **SPIR-V Backend** — Vulkan-compatible bytecode generation (**87/87 exact Rust naga parity**): integer div/mod safety wrappers, image bounds checking (Restrict/ReadZeroSkipWrite), ray query helpers, force loop bounding, workgroup zero-init polyfill, NonUniform decorations, capability-aware instruction emission\n- **MSL Backend** — Metal Shading Language output for macOS/iOS (**91/91 exact Rust naga parity**), vertex pulling transform, external textures, override pipeline constants\n- **GLSL Backend** — OpenGL Shading Language for OpenGL 3.3+, ES 3.0+ (**68/68 exact Rust naga parity**), dead code elimination, ProcessOverrides, image bounds checking\n- **HLSL Backend** — High-Level Shading Language for DirectX 11/12 (**72/72 exact Rust naga parity**)\n- **DXIL Backend** (experimental) — Direct DXIL generation from naga IR (**161/170 IDxcValidator validation, 94.7%**; **105/208 DXC golden parity, diff=0**; **gg production: 58/59 entry points VALID**; visual: renders circles + text on D3D12). LLVM 3.7 bitcode with dx.op intrinsics, DXBC container. Vertex, fragment, compute, and mesh shaders (SM 6.0-6.5). CBV/SRV/UAV (read-only storage as SRV, read-write as UAV), atomics (i32/i64/f32 + image), barriers, ray query (35 intrinsics), wave/subgroup ops (13 intrinsics), texture sampling (8 variants), matrix scalarization, pack/unpack, helper functions. Optimization passes: DCE (mark-and-sweep), SROA (struct decomposition), mem2reg (SSA promotion), single-store local promotion, loadInput DCE (per-member backwards reachability), workgroup struct decomposition, function inlining (early-return wrapping), strength reduction (mul→shl, urem→and, sub→add), constant folding. `Options.BindingMap` for WGSL→DXIL `(space, register)` remap (wgpu root signature compatibility). Eliminates FXC/DXC dependency. `dxil.Compile()` API. ~50K LOC, 330+ unit tests. World's first Pure Go DXIL generator.\n- **Type Conversions** — Scalar constructors `f32(x)`, `u32(y)`, `i32(z)` with correct SPIR-V opcodes\n- **Bitcast** — `bitcast\u003cT\u003e(expr)` for reinterpreting bit patterns between types\n- **Warnings** — Unused variable detection with `_` prefix exception\n- **Validation** — Type checking, semantic validation, function call argument type/count verification, `@must_use` enforcement, `const_assert` evaluation, `@binding`/`@group` pairing, array size validation, swizzle namespace enforcement, mandatory semicolons\n- **CLI Tool** — `nagac` command-line compiler\n\n---\n\n## Installation\n\n```bash\ngo get github.com/gogpu/naga\n```\n\n**Requirements:** Go 1.25+\n\n---\n\n## Usage\n\n### As Library\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"log\"\n\n    \"github.com/gogpu/naga\"\n)\n\nfunc main() {\n    source := `\n@vertex\nfn main(@builtin(vertex_index) idx: u32) -\u003e @builtin(position) vec4\u003cf32\u003e {\n    return vec4\u003cf32\u003e(0.0, 0.0, 0.0, 1.0);\n}\n`\n    // Simple compilation\n    spirv, err := naga.Compile(source)\n    if err != nil {\n        log.Fatal(err)\n    }\n    fmt.Printf(\"Generated %d bytes of SPIR-V\\n\", len(spirv))\n}\n```\n\n### With Options\n\n```go\nopts := naga.CompileOptions{\n    SPIRVVersion: spirv.Version1_3,\n    Debug:        true,   // Include debug names\n    Validate:     true,   // Enable IR validation\n}\nspirv, err := naga.CompileWithOptions(source, opts)\n```\n\n### CLI Tool\n\n```bash\n# Install\ngo install github.com/gogpu/naga/cmd/nagac@latest\n\n# Compile shader\nnagac shader.wgsl -o shader.spv\n\n# With debug info\nnagac -debug shader.wgsl -o shader.spv\n\n# Show version\nnagac -version\n```\n\n### Development Tools\n\n```bash\n# SPIR-V disassembler (debugging shader compilation)\ngo install github.com/gogpu/naga/cmd/spvdis@latest\nspvdis shader.spv\n\n# DXIL validator — Pure Go wrapper around Microsoft IDxcValidator (Windows)\n# First Pure Go integration with dxil.dll, zero CGO. Runs a three-layer\n# defensive pre-check (DXBC structural + LLVM bitcode metadata walker)\n# before handing blobs to IDxcValidator::Validate.\ngo install github.com/gogpu/naga/cmd/dxilval@latest\ndxilval shader.dxil                       # validate a single container\ndxilval --wgsl shader.wgsl                # compile through naga, then validate\ndxilval --corpus snapshot/testdata/in/    # walk a directory, typed-error summary\n\n# Texture shader compile tool (testing)\ngo install github.com/gogpu/naga/cmd/texture_compile@latest\ntexture_compile shader.wgsl\n```\n\n### Multiple Backends\n\n```go\n// Parse and lower WGSL to IR (shared across all backends)\nast, _ := naga.Parse(source)\nmodule, _ := naga.Lower(ast)\n\n// Generate SPIR-V (Vulkan)\nspirvBytes, _ := naga.GenerateSPIRV(module, spirv.Options{})\n\n// Generate MSL (Metal)\nmslCode, _, _ := msl.Compile(module, msl.DefaultOptions())\n\n// Generate GLSL (OpenGL)\nglslCode, _, _ := glsl.Compile(module, glsl.DefaultOptions())\n\n// Generate HLSL (DirectX 11/12)\nhlslCode, _, _ := hlsl.Compile(module, hlsl.DefaultOptions())\n\n// Generate DXIL (DirectX 12, SM 6.0 — experimental)\ndxilBytes, _ := dxil.Compile(module, dxil.DefaultOptions())\n```\n\n### Individual Stages\n\n```go\n// Parse WGSL to AST\nast, err := naga.Parse(source)\n\n// Lower AST to IR\nmodule, err := naga.Lower(ast)\n\n// Validate IR\nerrors, err := naga.Validate(module)\n\n// Generate SPIR-V\nspirvOpts := spirv.Options{Version: spirv.Version1_3, Debug: true}\nspirvBytes, err := naga.GenerateSPIRV(module, spirvOpts)\n```\n\n---\n\n## Architecture\n\n```\nnaga/                              ~192K LOC total\n├── wgsl/              # WGSL frontend (~19.5K LOC)\n│   ├── token.go       # Token types (120+)\n│   ├── lexer.go       # Tokenizer\n│   ├── ast.go         # AST types\n│   ├── parser.go      # Recursive descent parser\n│   └── lower.go       # AST → IR converter\n├── ir/                # Intermediate representation (~6.5K LOC)\n│   ├── ir.go          # Core types (Module, Type, Function)\n│   ├── expression.go  # 30+ expression kinds\n│   ├── statement.go   # 20+ statement kinds\n│   ├── validate.go    # IR validation\n│   ├── resolve.go     # Type inference\n│   └── registry.go    # Type deduplication\n├── spirv/             # SPIR-V backend (~10.8K LOC)\n│   ├── spirv.go       # SPIR-V constants and opcodes\n│   ├── block.go       # Block ownership model (Rust naga pattern)\n│   ├── writer.go      # Binary module builder\n│   ├── backend.go     # IR → SPIR-V translator\n│   └── ray_query.go   # Ray query helper functions\n├── msl/               # MSL backend (~14.2K LOC)\n│   ├── backend.go     # Public API, Options, Compile()\n│   ├── writer.go      # MSL code writer\n│   ├── types.go       # Type generation\n│   ├── expressions.go # Expression codegen\n│   ├── statements.go  # Statement codegen\n│   ├── functions.go   # Entry points and functions\n│   └── keywords.go    # MSL/C++ reserved words\n├── glsl/              # GLSL backend (~7.8K LOC)\n│   ├── backend.go     # Public API, version targeting\n│   ├── writer.go      # GLSL code writer\n│   ├── types.go       # Type generation\n│   ├── expressions.go # Expression codegen\n│   ├── statements.go  # Statement codegen\n│   └── keywords.go    # Reserved word escaping\n├── hlsl/              # HLSL backend (~13.6K LOC)\n│   ├── backend.go     # Public API, Options, Compile()\n│   ├── writer.go      # HLSL code writer\n│   ├── types.go       # Type generation\n│   ├── expressions.go # Expression codegen\n│   ├── statements.go  # Statement codegen\n│   ├── storage.go     # Buffer/atomic operations\n│   ├── functions.go   # Entry points with semantics\n│   └── keywords.go    # HLSL reserved words\n├── dxil/              # DXIL backend (~50K LOC, 161/170 IDxcValidator)\n│   ├── dxil.go        # Public API: Compile(), DefaultOptions()\n│   └── internal/      # All implementation internal\n│       ├── bitcode/   # LLVM 3.7 bit-level writer\n│       ├── module/    # DXIL module + bitcode serialization\n│       ├── container/ # DXBC container (ISG1/OSG1/PSG1/PSV0/SFI0/HASH)\n│       └── emit/      # naga IR → DXIL lowering (all shader stages)\n├── naga.go            # Public API\n└── cmd/\n    ├── nagac/         # CLI compiler\n    ├── spvdis/        # SPIR-V disassembler\n    └── texture_compile/ # Texture shader testing\n```\n\n## Supported WGSL Features\n\n### Types\n- Scalars: `f16`, `f32`, `f64`, `i32`, `u32`, `i64`, `u64`, `bool`\n- Vectors: `vec2\u003cT\u003e`, `vec3\u003cT\u003e`, `vec4\u003cT\u003e` (and short aliases: `vec2f`, `vec3i`, `vec4u`, etc.)\n- Matrices: `mat2x2\u003cf32\u003e` ... `mat4x4\u003cf32\u003e` (and short aliases: `mat2x2f`, `mat4x4f`, etc.)\n- Arrays: `array\u003cT, N\u003e`, `array\u003cT\u003e` (runtime-sized, storage buffers)\n- Structs: `struct { ... }` (with constructor syntax: `StructName(field1, field2)`)\n- Atomics: `atomic\u003cu32\u003e`, `atomic\u003ci32\u003e`\n- Textures: `texture_2d\u003cf32\u003e`, `texture_3d\u003cf32\u003e`, `texture_cube\u003cf32\u003e`, `texture_depth_2d_array`\n- Samplers: `sampler`, `sampler_comparison`\n- Binding arrays: `binding_array\u003cT, N\u003e`\n- Ray tracing: `acceleration_structure`, `ray_query`\n- Abstract constructors: `vec3(1,2,3)`, `mat2x2(...)`, `array(...)` (without explicit template parameters)\n- Type aliases: `alias FVec3 = vec3\u003cf32\u003e;`\n\n### Shader Stages\n- `@vertex` — Vertex shaders with `@builtin(position)` output\n- `@fragment` — Fragment shaders with `@location(N)` outputs\n- `@compute` — Compute shaders with `@workgroup_size(X, Y, Z)`\n\n### Bindings\n- `@builtin(position)`, `@builtin(vertex_index)`, `@builtin(instance_index)`\n- `@builtin(global_invocation_id)` — Compute shader invocation ID\n- `@location(N)` — Vertex attributes and fragment outputs\n- `@group(G) @binding(B)` — Resource bindings\n\n### Address Spaces\n- `var\u003cuniform\u003e` — Uniform buffer\n- `var\u003cstorage, read\u003e` — Read-only storage buffer\n- `var\u003cstorage, read_write\u003e` — Read-write storage buffer\n- `var\u003cworkgroup\u003e` — Workgroup shared memory\n\n### Statements\n- Variable declarations: `var`, `let`, `const`\n- Override declarations: `@id(N) override name: type = default;`\n- Compile-time assertions: `const_assert expr;`\n- Control flow: `if`, `else`, `for`, `while`, `loop`, `switch`, `case`, `default`\n- Loop control: `break`, `continue`, `break if` (continuing blocks)\n- Functions: `return`, `discard`\n- Assignment: `=`, `+=`, `-=`, `*=`, `/=`\n\n### Built-in Functions (100+)\n- Math: `abs`, `min`, `max`, `clamp`, `saturate`, `sign`, `fma`, `modf`, `frexp`, `ldexp`, `quantizeToF16`\n- Trigonometric: `sin`, `cos`, `tan`, `asin`, `acos`, `atan`, `atan2`, `sinh`, `cosh`, `tanh`, `asinh`, `acosh`, `atanh`\n- Angle: `radians`, `degrees`\n- Exponential: `exp`, `exp2`, `log`, `log2`, `pow`, `sqrt`, `inverseSqrt`\n- Decomposition: `ceil`, `floor`, `round`, `fract`, `trunc`\n- Geometric: `dot`, `cross`, `length`, `distance`, `normalize`, `faceForward`, `reflect`, `refract`, `outerProduct`\n- Interpolation: `mix`, `step`, `smoothstep`\n- Matrix: `transpose`, `determinant`, `inverse`\n- Relational: `all`, `any`, `isnan`, `isinf`\n- Bit: `countTrailingZeros`, `countLeadingZeros`, `countOneBits`, `reverseBits`, `extractBits`, `insertBits`, `firstTrailingBit`, `firstLeadingBit`\n- Packing: `pack4x8snorm`, `pack4x8unorm`, `pack2x16snorm`, `pack2x16unorm`, `pack2x16float`, `pack4xI8`, `pack4xU8`, `pack4xI8Clamp`, `pack4xU8Clamp`, `unpack4x8snorm`, `unpack4x8unorm`, `unpack2x16snorm`, `unpack2x16unorm`, `unpack2x16float`, `unpack4xI8`, `unpack4xU8`\n- Selection: `select`\n- Derivatives: `dpdx`, `dpdy`, `fwidth`, `dpdxCoarse`, `dpdyCoarse`, `fwidthCoarse`, `dpdxFine`, `dpdyFine`, `fwidthFine`\n- Atomic: `atomicAdd`, `atomicSub`, `atomicMin`, `atomicMax`, `atomicAnd`, `atomicOr`, `atomicXor`, `atomicExchange`, `atomicCompareExchangeWeak`\n- Barriers: `workgroupBarrier`, `storageBarrier`, `textureBarrier`, `subgroupBarrier`\n- Subgroup: `subgroupBallot`, `subgroupAll`, `subgroupAny`, `subgroupAdd/Mul/Min/Max/And/Or/Xor`, `subgroupBroadcast/First`, `subgroupShuffle/XOR/Up/Down`, `quadSwap/Broadcast`\n- Ray Query: `rayQueryInitialize`, `rayQueryProceed`, `rayQueryGetCommittedIntersection`, `rayQueryGetCandidateIntersection`, `rayQueryTerminate`\n- Uniform Load: `workgroupUniformLoad`\n- Array: `arrayLength`\n\n---\n\n## Status\n\n**Current Version:** See [CHANGELOG.md](CHANGELOG.md) for release history.\n\n| Backend | Status | Target Platform |\n|---------|--------|-----------------|\n| SPIR-V | ✅ **87/87 Rust parity** | Vulkan |\n| MSL | ✅ **91/91 Rust parity** | Metal (macOS/iOS) |\n| GLSL | ✅ **68/68 Rust parity** | OpenGL 3.3+, ES 3.0+ |\n| HLSL | ✅ **72/72 Rust parity** | DirectX 11/12 |\n| DXIL | **161/170 IDxcValidator (94.7%)** | DirectX 12 (SM 6.0-6.5, experimental) |\n\nSee [ROADMAP.md](ROADMAP.md) for detailed development plans.\n\n---\n\n## References\n\n- [WGSL Specification](https://www.w3.org/TR/WGSL/)\n- [SPIR-V Specification](https://registry.khronos.org/SPIR-V/)\n- [naga (Rust)](https://github.com/gfx-rs/naga) — Original implementation\n\n### Rust Naga Compatibility\n\nnaga is tested against **all 144 reference WGSL shaders** from the [Rust naga](https://github.com/gfx-rs/naga) test suite — **100% compatibility** across all five layers: **IR 144/144**, **SPIR-V 87/87**, **MSL 91/91**, **GLSL 68/68**, **HLSL 72/72** exact output match. Total: 164 test shaders with 994 golden outputs.\n\n---\n\n## Ecosystem\n\n**naga** is the shader compiler for the [GoGPU](https://github.com/gogpu) ecosystem.\n\n| Project | Description |\n|---------|-------------|\n| [gogpu/gogpu](https://github.com/gogpu/gogpu) | GPU framework with windowing and input |\n| [gogpu/wgpu](https://github.com/gogpu/wgpu) | Pure Go WebGPU implementation |\n| **gogpu/naga** | **Shader compiler (this repo)** |\n| [gogpu/gg](https://github.com/gogpu/gg) | 2D graphics library |\n| [gogpu/ui](https://github.com/gogpu/ui) | GUI toolkit (22 widgets, M3/Fluent/Cupertino) |\n\n---\n\n## Documentation\n\n- **[ARCHITECTURE.md](docs/ARCHITECTURE.md)** — Compiler architecture, pipeline, IR design\n- **[ROADMAP.md](ROADMAP.md)** — Development milestones\n- **[CHANGELOG.md](CHANGELOG.md)** — Release notes\n- **[pkg.go.dev](https://pkg.go.dev/github.com/gogpu/naga)** — API reference\n\n---\n\n## Contributing\n\nWe welcome contributions! Areas where help is needed:\n- Additional WGSL features\n- Test cases from real shaders\n- Backend optimizations\n- Documentation improvements\n\n## License\n\nMIT License — see [LICENSE](LICENSE) for details.\n\n---\n\n\u003cp align=\"center\"\u003e\n  \u003cb\u003enaga\u003c/b\u003e — Shaders in Pure Go\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgogpu%2Fnaga","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgogpu%2Fnaga","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgogpu%2Fnaga/lists"}