gfx-rs/wgpu
70.7
Strong · 27 September 2026
262.5k
lines of production code
Rust
primary language
3
measurements over time
What this system is
This system is a comprehensive Rust-based graphics library and shader compiler ecosystem designed to provide cross-platform access to the WebGPU API. It comprises a high-level API for resource management and rendering, a hardware abstraction layer supporting Vulkan, Metal, DirectX 12, and OpenGL, and a robust shader translation engine that converts WGSL, GLSL, and SPIR-V into native backend formats. The codebase also includes extensive tooling for benchmarking, conformance testing, and debugging GPU workloads across native and web environments.
How it got here
2018–2023 — WebGPU architecture and Naga compiler rewrite
63 changes.
This period focused on a comprehensive architectural overhaul of the wgpu-rs ecosystem, introducing a new dispatch-based API, a dedicated hardware abstraction layer (wgpu-hal), and a custom backend infrastructure. Simultaneously, the Naga shader translation library was completely restructured with modular frontends and backends for WGSL, GLSL, SPIR-V, HLSL, and Metal, supporting advanced features like mesh shaders and ray tracing. The work also established robust testing and tooling, including a WebGPU trace player, a Deno-based CTS runner, and a GPU test harness.
2024–2025 — API modernization and feature expansion
81 changes.
This period focused on restructuring the wgpu public API to use internal dispatch wrappers and introducing dynamic HAL traits for runtime polymorphism. It also expanded the library's capabilities with extensive new examples, ray tracing support, mesh shaders, and cooperative matrix operations, alongside significant improvements to the Naga shader compiler and validation infrastructure.
2026 — WebGPU remoting and shader infrastructure
21 changes.
This period focused on establishing the architecture for cross-process WebGPU execution by introducing the wgpu-core-remote crate and its associated FFI-safe types for secure IPC. Concurrently, the project expanded its shader translation capabilities through the new naga-types crate and enhanced ray tracing support via modular SPIR-V backend refactoring and new examples. The work was complemented by extensive test coverage for GPU operations, synchronization primitives, and driver-specific bug reproductions.
Features
Add Boids and Conservative Rasterization examples
New examples have been added to the features directory. The Boids example demonstrates GPU compute-based flocking simulation using WGSL shaders and compute pipelines. The Conservative Rasterization example illustrates rendering with conservative rasterization enabled, including a low-resolution target upscaling technique and optional line rendering via polygon mode.
examples/features/src/boids · high confidence
Add DOT graph backend for IR visualization
Users can now generate Graphviz DOT format files from the Naga IR for debugging and inspection purposes. This new backend allows developers to visualize the control flow graph of shader functions, including nodes for statements like loops, conditionals, and barriers, as well as edges representing execution flow and dependencies.
naga/src/back/dot · high confidence
Add WebGPU compute shader example for Collatz iterations
A new JavaScript example, hello-compute.js, has been added to the CTS runner examples directory. This example demonstrates a WebGPU compute shader that calculates the number of iterations required for the Collatz Conjecture to reach 1 for a set of input numbers. It showcases key WebGPU concepts including storage buffers, compute pipelines, bind groups, and command encoding.
_cts\runner/examples · high confidence
Add big\_compute\_buffers example for handling large datasets across multiple buffers
This change introduces a new example demonstrating how to process datasets that exceed the maximum size of a single GPU buffer by splitting the data across multiple buffers. The example utilizes the \binding\_array\ feature (Vulkan-only) to manage an array of storage buffers, allowing users to increment values in a 1GB dataset distributed across eight 134MB chunks. It includes the necessary Rust code, WGSL shader, and GPU tests to show the complete workflow of creating, dispatching compute work on, and reading back from multiple large buffers.
_examples/features/src/big\_compute\buffers · high confidence
Add bunnymark performance example
A new bunnymark example has been added to the features directory, demonstrating high-performance rendering of up to one million bunnies using dynamic uniform buffer offsets and bytemuck for safe memory transmutation. The example includes a README with run instructions and a screenshot, and utilizes the updated wgpu API features such as depth\_slice in color attachments and dynamic offsets for per-instance data.
examples/features/src/bunnymark · high confidence
Add cooperative matrix multiplication example
A new example demonstrating hardware-accelerated cooperative matrix operations (tensor cores) has been added. It shows how to perform tiled matrix multiplication (C = A \* B + C) using WGSL cooperative matrix intrinsics, with support for both 8x8 f32 tiles (Apple Metal) and 16x16 f16 tiles (AMD Vulkan). The example includes GPU tests that verify results against a CPU reference implementation.
_examples/features/src/cooperative\matrix · high confidence
Add custom backend example demonstrating wgpu custom interface integration
The \examples/standalone/custom\_backend\ directory now contains a new example that demonstrates how to implement and use wgpu's custom backend interfaces. The example provides a \CustomInstance\, \CustomAdapter\, \CustomDevice\, and \CustomComputePipeline\ that implement the respective \wgpu::custom\ traits, allowing users to see how to integrate custom GPU backend implementations into the wgpu API. It also shows how to use \wgpu::Instance::from\_custom\ to wrap a custom instance and interact with it through the standard wgpu abstraction, including creating devices, shader modules, and compute pipelines.
_examples/standalone/custom\backend · high confidence
Add halmark hardware-acceleration benchmark example
The wgpu-hal crate now includes a new halmark example that renders a large number of moving sprites (bunnies) to demonstrate basic HAL usage and performance. The example initializes a window via winit, configures a surface with specific color space and maximum frame latency settings, and uses a WGSL shader to render textured quads with per-instance data. It also implements command pool recycling and tracks average frame time for performance measurement.
wgpu-hal/examples/halmark · high confidence
Add hello\_synchronization example demonstrating WGSL workgroup barriers
A new example has been added to demonstrate GPU synchronization using WGSL workgroup barriers. It compares a 'patient' compute shader that uses \workgroupBarrier()\ to ensure all threads have incremented a counter before reading it, against a 'hasty' version that reads the counter without waiting, illustrating the importance of synchronization for correct atomic results.
_examples/features/src/hello\synchronization · high confidence
Add hello\_window example demonstrating modern wgpu surface and rendering patterns
The standalone hello\_window example has been added to demonstrate current wgpu usage, including handling the unified CurrentSurfaceTexture enum for robust surface texture acquisition (handling suboptimal, occluded, and lost states), configuring surfaces with explicit color space selection (Auto) and view formats for sRGB compatibility, and calling pre\_present\_notify before queue presentation.
_examples/standalone/02\_hello\window · high confidence
Add in-memory and disk-based GPU trace recording and replay support
The wgpu-core device layer now supports recording GPU command traces to disk or memory and replaying them. This adds a \Trace\ trait with \DiskTrace\ (serializing actions to RON files and external binary data) and \MemoryTrace\ (storing actions in memory) implementations, along with a \DataLoader\ trait and \DiskTraceLoader\ to read back recorded data for replay. This enables users to capture, inspect, and reproduce GPU workloads for debugging and testing purposes.
wgpu-core/src/device/trace · high confidence
Add platform-specific dependency crates for Apple, Emscripten, Linux/Android/BSD, WASM, and Windows
New \wgpu-core/platform-deps\ crates have been added for Apple, Emscripten, Linux/Android/BSD, WASM, and Windows. Each crate includes Apache 2.0 and MIT license files and a README explaining that they exist to enable platform-specific features correctly, with feature flags gated by \target\_vendor\, \target\_os\, or \target\_arch\ as defined in \wgpu-hal\'s \Cargo.toml\.
wgpu-core/platform-deps · high confidence
Add platform-specific dependency crates for Apple, Emscripten, and WASM
New platform-specific crates have been added for Apple, Emscripten, and WebAssembly targets. These crates currently serve as documentation stubs, including the shared README content, to establish the structure for future platform-specific implementations.
wgpu-core/platform-deps/apple, wgpu-core/platform-deps/emscripten, wgpu-core/platform-deps/wasm · high confidence
Add raw GLES interop example for Emscripten
A new HTML host file (raw-gles.em.html) and Rust source (raw-gles.rs) are added to demonstrate hooking wgpu-hal into an existing raw GLES context on Emscripten. The HTML sets up a 640x400 canvas and configures the Emscripten module to enable debug logging via RUST\_LOG=debug before loading the compiled JavaScript. The Rust example initializes a GLES 3.0+ context using glutin, creates a window and surface, and draws a triangle into the external context, providing a concrete interop pattern for WebAssembly targets.
wgpu-hal/examples · high confidence
Add ray tracing examples using compute and fragment shaders
New examples demonstrating hardware-accelerated ray tracing have been added: \ray\_cube\_compute\ uses a compute shader to perform ray queries and write to a texture, while \ray\_cube\_fragment\ performs ray queries directly in the fragment shader. Both examples require the \EXPERIMENTAL\_RAY\_QUERY\ feature and demonstrate the use of acceleration structures (BLAS/TLAS) and the \wgpu\_ray\_query\ WGSL extension.
_examples/features/src/ray\_cube\compute · high confidence
Add ray tracing scene rendering example
A new example demonstrating ray tracing capabilities has been added to the features directory. It loads 3D models and constructs bottom-level acceleration structures (BLAS) using wgpu buffers for vertices, indices, and geometry data. The example uses a WGSL shader with the \wgpu\_ray\_query\ extension to perform ray queries against the acceleration structure, computing intersections to render materials and normals based on the hit geometry.
_examples/features/src/ray\scene · high confidence
Add ray-aabb compute example demonstrating hardware ray queries on AABB geometry
A new example has been added that uses hardware ray queries to trace against an Acceleration Structure (BLAS) built from Axis-Aligned Bounding Boxes. The compute shader performs ray-AABB intersection checks and, upon a hit, fits and renders a sphere inside the detected box. This example requires the EXPERIMENTAL\_RAY\_QUERY feature and is currently unsupported on the Metal backend.
_examples/features/src/ray\_aabb\compute · high confidence
Add ray-shadows example demonstrating hardware-accelerated ray tracing
A new example named \ray\_shadows\ has been added to the features set, showcasing real-time ray traced shadows using hardware acceleration. The example renders a scene with a base plane and a shadow-casting object, utilizing Bottom-Level Acceleration Structures (BLAS) and Top-Level Acceleration Structures (TLAS) for efficient ray intersection. It requires the \EXPERIMENTAL\_RAY\_QUERY\ and \IMMEDIATES\ features, employing immediate data for light position and bind group layouts with acceleration structures to compute shadowing in the fragment shader.
_examples/features/src/ray\shadows · high confidence
Add ray-traced triangle example
A new example demonstrating hardware-accelerated ray tracing has been added to the features set. It renders three triangles using a compute shader that performs ray queries against a Bottom-Level Acceleration Structure (BLAS) and a Top-Level Acceleration Structure (TLAS), with the results blitted to the screen. This example requires the \EXPERIMENTAL\_RAY\_QUERY\ feature and specific acceleration structure limits.
(repo-wide) · high confidence
Add repeated\_compute example demonstrating GPU-accelerated Collatz calculations
A new example has been added that repeatedly performs the Collatz calculation on sets of random numbers using the GPU. The example demonstrates key wgpu patterns including mapping buffers for CPU-GPU data transfer, using async channels to handle buffer mapping completion portably across native and WASM targets, and executing compute shaders via compute passes. It serves as a practical reference for handling buffer synchronization and compute pipeline usage in wgpu applications.
_examples/features/src/repeated\compute · high confidence
Add standalone HDR surface example for WebGPU
A new standalone example (03\_hdr\_surface) has been added to demonstrate HDR surface capabilities on the WebGPU backend. The example includes a web interface that allows users to test and report surface capabilities, with support for forcing specific color spaces (extended-srgb, extended-display-p3, srgb) via URL parameters to verify HDR output behavior.
examples/standalone · high confidence
Add storage texture example for Mandelbrot set computation
A new example has been added to demonstrate the use of storage textures for compute-shader-based image generation. The example computes a Mandelbrot set image using a write-only storage texture, copies the result to a staging buffer, and outputs it as a PNG file on native platforms or displays it in the browser on WebAssembly.
_examples/features/src/storage\texture · high confidence
Add wgpu-info utility with Apache 2.0 and MIT licensing
The wgpu-info command-line utility is introduced to list available GPU adapters and their details, or to run test commands across all adapter/backend combinations by setting environment variables. This new tool is distributed under dual Apache 2.0 and MIT licenses.
wgpu-info · high confidence
Added HLSL snapshot test configuration support for mesh shaders
The \naga/hlsl-snapshots\ crate now includes a \Config\ struct that supports a \mesh\ field alongside existing shader stages (vertex, fragment, compute, task). This allows users to define and manage RON configuration files for mesh shader snapshot tests, enabling validation of mesh shader HLSL output in addition to other shader types.
naga/hlsl-snapshots · high confidence
Added Metal texture atomic bug reproduction example
A new example has been added to demonstrate a workaround for a Metal driver bug on Apple M4 Max (macOS Tahoe) where fragment shader texture atomic writes randomly drop, causing flickering black artifacts. The example reproduces the issue by performing atomic writes in a fragment shader and visualizes the result, while also showing the workaround of inserting a compute pass with atomic access between the write and read stages to ensure data integrity.
_examples/bug-repro/01\_texture\_atomic\bug · high confidence
Added web-static example entry point
A new index.html file has been added to the examples/features/web-static directory, providing a responsive web interface for running graphics examples. The page dynamically loads example modules based on URL parameters for backend (WebGL2 or WebGPU) and example name, and includes a mobile-friendly menu to toggle the backend selection banner.
examples/features/web-static · high confidence
Automatic GPU timestamp normalization via compute shader
Added a new timestamp normalization module that automatically converts GPU query timestamps to a consistent 1GHz period, as required by the WebGPU specification. When enabled, the system uses a compute shader to multiply raw timestamps by a calculated fraction (derived from the device's timestamp period) and shift the result, ensuring normalized values are stored directly in the output buffer. This feature is opt-in via the \AUTOMATIC\_TIMESTAMP\_NORMALIZATION\ instance flag and requires compute shader support.
_wgpu-core/src/timestamp\normalization · high confidence
DX12 backend now supports the D3D12 Agility SDK for independent runtime updates
The DX12 hardware abstraction layer now allows applications to load a specific version of the D3D12 runtime via the Agility SDK, rather than relying solely on the system-installed version. This is achieved through a new \DeviceFactory\ abstraction that attempts to initialize the SDK's \ID3D12DeviceFactory\ first; if that fails, it falls back to the legacy \D3D12CreateDevice\ path based on configuration. This change enables more consistent behavior across different Windows versions and allows for independent updates of the graphics runtime without waiting for OS updates.
wgpu-hal/src/dx12 · high confidence
HDR surface example supports multiple color spaces and live HDR queries
The standalone HDR surface example now allows users to select specific output color spaces (HDR10, HLG, extended linear scRGB, extended sRGB, and extended Display-P3) via command-line arguments or URL parameters, automatically preferring the most capable HDR mode available. It renders a luminance test pattern to verify correct tone mapping and gamut conversion across these modes. On macOS, the example also observes system display parameter changes to re-query live HDR headroom information, ensuring the rendered output adapts to real-time display configuration changes.
_examples/standalone/03\_hdr\surface · high confidence
HLSL backend refactored into modular components with mesh shader and ray tracing support
The HLSL backend in \naga/src/back/hlsl\ has been restructured from a single large module into distinct files (\conv.rs\, \help.rs\, \keywords.rs\, \mesh\_shader.rs\, \ray.rs\, \storage.rs\, \writer.rs\, \mod.rs\) to improve maintainability and support new capabilities. This refactoring introduces dedicated support for mesh shaders (including wrapper generation for mesh output counts and vertex/primitive arrays) and ray tracing (including ray query intersection functions and tracker variables). It also adds comprehensive type conversion helpers for HLSL scalar and storage formats, keyword reservation handling for FXC/DXC compilers, and optimized storage buffer access chains using \ByteAddressBuffer\ load/store methods. The changes ensure correct handling of matrix layouts, external textures, and 64-bit integer operations in generated HLSL code.
naga/src/back/hlsl · high confidence
Initial Metal Shading Language (MSL) backend implementation
This change introduces the Naga backend for generating Metal Shading Language (MSL) code. It includes the core writer logic, support for mesh shaders (including vertex and primitive output struct generation), ray tracing queries (candidate and committed intersections), and external texture handling. The implementation also provides a comprehensive list of reserved keywords to prevent identifier collisions and defines inline sampler configurations.
naga/src/back/msl · high confidence
Initial WebGPU implementation in Deno
Deno now includes a new \deno\_webgpu\ extension that implements the WebGPU API, exposing classes such as \GPU\, \GPUDevice\, \GPUBuffer\, and \GPURenderPassEncoder\ to JavaScript. This feature allows Deno applications to access the GPU directly through the standard WebGPU interface, with the Rust implementation binding to the \wgpu-core\ backend for cross-platform hardware acceleration.
_deno\webgpu · high confidence
Initial implementation of the GLES hardware abstraction layer
The GLES backend for wgpu-hal has been added, providing the foundational infrastructure to run wgpu on OpenGL and OpenGL ES contexts. This includes adapter detection and version parsing, command encoding and state management, texture and vertex format conversion, device and resource management, EGL context and surface handling, fence synchronization, and Emscripten-specific WebGL extension support.
wgpu-hal/src/gles · high confidence
Initial release of naga-cli shader translation tool
The \naga-cli\ binary is introduced, providing a command-line interface for translating shaders between various formats (GLSL, HLSL, SPIR-V, Metal, WGSL). Users can now validate, compile, and convert shader sources using options for input/output kinds, shader stages, entry points, and specific backend configurations such as GLSL profiles, HLSL shader models, SPIR-V versions, and Metal versions. The tool supports advanced features including bounds checking policies, debug symbol generation, bulk validation, override value processing, and IR compaction.
naga-cli/src · high confidence
Introduce WGSL backend with matrix inverse polyfills
The WGSL (WebGPU Shading Language) backend is now available, allowing shaders to be generated in WGSL format. This implementation includes support for standard WGSL constructs and introduces polyfills for the \inverse\ matrix function on 2x2, 3x3, and 4x4 matrices for both f16 and f32 types, ensuring compatibility where native hardware support may be lacking.
naga/src/back/wgsl · high confidence
Introduce bind group layout deduplication via hashable entry maps
The device module now includes a new \bgl.rs\ module that implements \EntryMap\, a hashable structure for storing \BindGroupLayoutEntry\ slices. By sorting entries by binding index before hashing, equivalent bind group layouts produce identical hashes, enabling the system to deduplicate bind group layouts. This reduces memory overhead and improves performance when creating multiple bind groups with identical layouts.
wgpu-core/src/device · high confidence
Introduce cts\_runner as a Deno-based WebGPU CTS execution environment
The cts\_runner tool is now implemented using Deno, providing a JavaScript/TypeScript runtime for executing the WebGPU Conformance Test Suite. This change introduces a new bootstrap.js entry point that initializes the WebGPU API and standard web APIs within the Deno environment, and a Rust main.rs that manages the runtime lifecycle, file operations, and strict WebGPU compliance settings. Users benefit from a more consistent web-standard environment for testing, with DXC used as the default shader compiler on Windows and strict compliance enabled by default.
_cts\runner/src · high confidence
Introduce custom benchmarking harness for wgpu
The \benches/src\ directory now contains a new, custom benchmarking framework (\wgpu-benchmark\) that replaces the previous setup. This framework provides a structured way to run benchmarks with support for iteration or time-based control, automatic comparison against previous results (saved as JSON), and colored terminal output that highlights performance regressions (red) and improvements (green). It includes utilities for iterating over benchmarks, managing context, and printing detailed delta reports, offering a more lightweight and \cargo-nextest\-compatible alternative to \criterion\.
benches/src · high confidence
Introduce naga-types crate for shared shader types
A new \naga-types\ crate has been added to host types shared between the \naga\ shader translator and \wgpu\ renderers. This separation allows \naga\ to remain independent of \wgpu\ while still sharing common definitions. The crate includes core types such as \ShaderStage\ (covering vertex, fragment, compute, mesh, task, and ray tracing stages), \ResourceBinding\, and specialized hash maps (\FastHashMap\, \FastIndexSet\) for performance. It also provides language-specific support modules, including GLSL version handling (\Version\ with support for desktop and ES/WebGL profiles), WGSL language extensions (such as \packed\_4x8\_integer\_dot\_product\ and \immediate\_address\_space\), and SPIR-V binding information.
naga-types · high confidence
Introduce wgpu-core-remote Global API for cross-process resource management
The \wgpu-core-remote\ crate now exposes a \Global\ wrapper that acts as the central entry point for WebGPU operations in a remote-process architecture. This change adds new modules (\instance\, \device\, \queue\, \command\_encoder\, \render\_pass\, \compute\_pass\, \bundle\) that implement methods on \Global\ to accept FFI-safe descriptors (e.g., \DeviceDescriptor\, \RenderPassDescriptor\) and resource IDs, resolving them internally via a \Hub\ to concrete \wgpu-core\ types. Users interacting with this layer will now use ID-based handles for adapters, devices, queues, and encoders, with the \Global\ instance managing the lifecycle and validation of these resources across process boundaries.
wgpu-core-remote/src/global · high confidence
Introduce wgpu-core-remote-types for secure WebGPU IPC
A new \wgpu-core-remote-types\ crate has been added to support the remoting architecture for WebGPU in browsers. This crate defines a complete set of FFI-safe, serializable types (implementing \serde::Serialize\/\Deserialize\) for IPC communication between the browser's untrusted content process and the trusted GPU process. It includes dedicated descriptors for all major WebGPU resources—such as \DeviceDescriptor\, \BufferDescriptor\, \TextureDescriptor\, \RenderPipelineDescriptor\, and \BindGroupDescriptor\—along with encoder commands (\RenderPassDescriptor\, \ComputePassDescriptor\) and a robust ID generation system (\IdentityHub\) to manage resource lifecycles. By defining these types separately from \wgpu-core\ and \wgpu-types\, the change ensures that experimental or non-standard features cannot be expressed in untrusted contexts, as Serde's deserialization rejects invalid values, thereby enhancing security.
wgpu-core-remote-types/src · high confidence
Introduce wgpu-info as a dedicated CLI tool for GPU capability reporting
The wgpu-info utility is now a proper command-line application that inspects system GPUs and outputs their capabilities. It supports multiple verbosity levels (-q, -v, -vv) to control output detail, can export data as JSON or human-readable text, and allows reading from or writing to files and stdin. The tool reports comprehensive adapter information including driver details, features, limits, downlevel capabilities, and texture format support, enabling users to easily diagnose GPU compatibility and feature availability.
wgpu-info/src · high confidence
Introduce wgpu-sync crate for cross-platform synchronization primitives
The new \wgpu-sync\ crate provides reusable synchronization primitives, including \Mutex\, \RwLock\, and atomic types, designed to work in both \std\ and \no\_std\ environments. When the \std\ feature is enabled, it delegates to \parking\_lot\ for robust locking; otherwise, it falls back to a \!Sync\ implementation similar to \RefCell\ that panics on contention to detect deadlocks. The crate also integrates \portable-atomic\ to ensure cross-platform atomic support and \once\_cell\ for lazy initialization, making these primitives available across a wider range of target architectures.
wgpu-sync · high confidence
Naga integration and configuration scaffolding
The Naga shader translation library is integrated into the repository, including its license files, documentation, and build configuration. The build script establishes conditional compilation aliases for output back-ends (such as HLSL and Metal) to support target-specific feature flags, and defines \no\_std\ support via the \build.rs\ configuration.
naga · high confidence
New Claude Code skills for CTS triage and WebGPU spec reference
Added new agent skills under \.claude/skills\ to streamline development workflows. The \cts-triage\ skill provides a structured, step-by-step process for running, analyzing, and documenting CTS test suite failures, including specific commands for identifying validation gaps and spec compliance issues. The \webgpu-specs\ skill adds a script to automatically download and cache the latest WebGPU and WGSL specifications, enabling the agent to reference official documentation and provide clickable links to specific sections during development.
.claude · high confidence
New MSAA line rendering example
Added a new example demonstrating how to render lines using Multisample Anti-Aliasing (MSAA). The example creates a multisampled texture as a color attachment and resolves it to the swapchain, allowing users to toggle the sample count (up to 16x) via keyboard input to visualize the anti-aliasing effect on line primitives.
_examples/features/src/msaa\line · high confidence
New Mandelbrot set example demonstrating uniform buffer usage
Added a new example in the uniform\_values feature folder that renders an interactive Mandelbrot set. The example demonstrates how to transfer state (cursor position, zoom level, and iteration count) from the Rust application to the WGSL shader using uniform buffers and bind groups, allowing users to pan and zoom the fractal in real-time.
_examples/features/src/uniform\values · high confidence
New WebGPU trace player library
A new \player\ library has been added to replay WebGPU command traces. It implements a \Player\ struct that maintains an internal registry of GPU resources (buffers, textures, pipelines, etc.) and processes recorded actions (creation, destruction, and command submission) against a live \wgpu-core\ device and queue, enabling deterministic debugging and testing of GPU workloads.
player/src · high confidence
New agent skills for CTS triage and WebGPU specification access
Added new AI agent skills to streamline developer workflows: a CTS triage skill that provides a structured process for running, analyzing, and fixing WebGPU Conformance Test Suite failures, and a WebGPU specs skill that automatically downloads and references the latest WebGPU and WGSL specifications. Additionally, Apache 2.0 and MIT license files have been added to the wgpu-core-remote and wgpu-core-remote-types packages to clarify licensing terms.
.agents, wgpu-core-remote, wgpu-core-remote-types · high confidence
New custom backend infrastructure for wgpu-rs
The \wgpu\ crate now provides a \custom\ backend module that allows users to supply their own implementation of the graphics backend via the \Context\ trait. This new infrastructure introduces a set of dynamic dispatch wrappers (e.g., \DynDevice\, \DynBuffer\, \DynRenderPass\) in \backend/custom.rs\ that wrap trait objects, enabling the high-level \wgpu\ API to operate on user-defined backend implementations alongside the standard \wgpu\_core\ and \webgpu\ backends.
wgpu/src/backend · high confidence
New documentation modules for best practices, color management, debugging, and experimental extensions
The documentation source has been reorganized into structured modules under \wgpu/src/documentation\, providing users with dedicated guides for best practices (including the middleware pattern and performance dos/don'ts), color management (covering HDR surfaces, color spaces, and sRGB conversions), debugging (tools for native API validation, GPU/CPU debugging, and Xcode integration), and experimental features (cooperative matrices, mesh shading, and shader debug printing).
wgpu/src/documentation · high confidence
New error\_scope example and restructured examples framework
The examples have been reorganized into a new \examples/features/src\ location, introducing a unified framework (\framework.rs\) that standardizes initialization, surface management, and logging across native and Web platforms. A new \error\_scope\ example demonstrates how to use wgpu's error scopes to detect validation and internal errors during GPU work, including support for nested scopes and cross-platform execution (WebGL2, WebGPU, and native). The example list (\main.rs\) and module exports (\lib.rs\) have been updated to include this new example alongside existing ones, with platform-specific capabilities (WebGL/WebGPU) explicitly declared for each.
examples/features/src · high confidence
New example demonstrating multiple render targets
Added a new example that shows how to use a fragment shader to output to two color attachments of a render pass simultaneously. The example generates a black and white ball-shaped texture and draws it to two separate texture targets—one receiving a red version and the other a green version—before displaying each on its own viewport that splits the screen in half.
_examples/features/src/multiple\_render\targets · high confidence
New hello\_workgroups example demonstrates compute shader workgroup execution
Added a new example that illustrates how workgroups and invocations function in WebGPU compute shaders. The example dispatches a compute shader with a workgroup size of (2, 1, 1) to increment elements in two storage buffers, using \@builtin(local\_invocation\_id)\ and \@builtin(workgroup\_id)\ to coordinate work within the group. It also includes a detailed README explaining workgroup concurrency guarantees, memory sharing, and execution order.
_examples/features/src/hello\workgroups · high confidence
New lock-analyzer tool for visualizing wgpu-core lock acquisition order
A new standalone \lock-analyzer\ binary has been added to read and summarize lock acquisition logs generated by \wgpu-core\'s \observe\_locks\ feature. By setting the \WGPU\_CORE\_LOCK\_OBSERVE\_DIR\ environment variable to a directory containing \.ron\ log files, users can run this tool to analyze lock ordering, detect potential deadlocks, and visualize the dependency graph of lock ranks.
lock-analyzer · high confidence
New macros for static SPIR-V and WGSL shader loading
The \wgpu/src/macros\ module now provides \include\_spirv\ and \include\_wgsl\ macros, allowing users to embed SPIR-V binary and WGSL source files directly into their application at compile time. The \include\_spirv\ macro handles word alignment and magic number validation, returning a \ShaderModuleDescriptor\, while \include\_wgsl\ loads text source similarly. Additionally, \include\_spirv\_raw\ is introduced for passthrough shader support, and \vertex\_attr\_array\ is available for generating vertex attribute arrays. These changes simplify shader integration by moving file loading to compile time.
wgpu/src/macros · high confidence
New mesh shader example demonstrating task and mesh stages
Added a new example that renders a triangle using mesh shaders, showcasing task shaders, payloads, and per-primitive data. The example uses a WGSL shader with task and mesh entry points to generate vertex and primitive data, which is then passed to a fragment shader for rendering.
_examples/features/src/mesh\shader · high confidence
New mipmap and multiview example applications
Added two new example applications to demonstrate advanced rendering techniques. The mipmap example shows how to generate and use mipmaps, including the use of \MipmapFilterMode\ and \RenderPassColorAttachment::depth\_slice\. The multiview example demonstrates rendering to different layers of an array texture, a feature commonly used for VR rendering, utilizing \multiview\_mask\ and \SELECTIVE\_MULTIVIEW\ features.
examples/features/src/mipmap · high confidence
New module processing infrastructure in Naga
The \naga/src/proc\ module has been introduced to centralize shader IR processing logic. This includes a comprehensive constant evaluator (\constant\_evaluator.rs\) for compile-time computation, a type layouter (\layouter.rs\) for memory alignment, an expression emitter (\emitter.rs\), and utilities for index bounds checking (\index.rs\), identifier naming (\namer.rs\), and type resolution (\typifier.rs\). These components provide the foundational processing capabilities required for validating and transforming shader code before backend code generation.
naga/src/proc · high confidence
New naga xtask validation tool with parallel execution and progress reporting
The \naga/xtask\ directory introduces a new command-line tool for validating shader code. It supports validating outputs for SPIR-V, Metal, GLSL, HLSL (via DXC and FXC), DOT, and WGSL. The tool runs validation jobs in parallel using a jobserver and displays a progress bar via the \indicatif\ crate. It only produces output when errors occur, logging them via \log::error\.
naga/xtask · high confidence
New sRGB blending example
Added a new example demonstrating how blending behaves differently in sRGB versus linear color spaces. The example renders overlapping red and blue quads to visually compare the results, allowing users to see the impact of color space on alpha blending.
_examples/features/src/srgb\blend · high confidence
New shadow mapping and stencil triangle examples
Added two new examples to the features set: a shadow mapping demo that renders animated cubes with multiple lights and depth-based shadowing, and a stencil triangles demo that uses stencil buffers to mask geometry. These examples provide visual references for implementing advanced rendering techniques in wgpu applications.
examples/features/src/shadow · high confidence
New skybox example with OBJ model and reflections
The skybox example now loads a Wavefront OBJ model (replacing the previous cybertruck model with the Ferris mascot) and renders it with skybox and simple reflections. It uses winit mouse controls for camera rotation around the model at the center, and demonstrates loading and rendering a textured cube alongside the skybox.
examples/features/src/skybox · high confidence
New texture array indexing example
Added a new example demonstrating texture array indexing, including a README, WGSL shaders, and Rust implementation. The example showcases binding arrays for textures and samplers, supporting both uniform and non-uniform indexing based on device features and environment variables.
_examples/features/src/texture\arrays · high confidence
New timestamp\_queries and render\_to\_texture examples
Added two new examples to the features set: \timestamp\_queries\ demonstrates GPU profiling using timestamp queries across command encoders, render passes, and compute passes, while \render\_to\_texture\ shows how to render a triangle to a texture and export it as an image file.
_examples/features/src/timestamp\queries · high confidence
New trace player binary for replaying WebGPU traces
A new command-line binary (\play\) has been added to the player crate, allowing users to replay WebGPU traces from either a single file or a directory. The tool automatically initializes the graphics device based on the trace's backend requirements, creates a window (when the \winit\ feature is enabled) to render the trace, and handles surface configuration and resizing. It supports both headless execution (for debugging/capture) and interactive windowed modes, processing trace actions in reverse order to ensure correct state restoration.
player/src/bin · high confidence
New utility module with staging belt, texture blitter, and device helpers
The \wgpu::util\ module has been introduced to provide high-level convenience utilities built on top of the core API. This includes a \StagingBelt\ for efficiently performing many small buffer writes by reusing temporary staging buffers, a \TextureBlitter\ for copying textures with incompatible formats or sizes, and a \DeviceExt\ trait offering \create\_buffer\_init\ and \create\_texture\_with\_data\ to simplify resource creation with initial data. Additional helpers include SPIR-V loading utilities, adapter initialization from environment variables, and a \DownloadBuffer\ for reading buffer data back to the CPU.
wgpu/src/util · high confidence
New water rendering example demonstrating Read-Only Depth/Stencil
Added a new water example that renders animated water and terrain, specifically demonstrating the Read-Only Depth/Stencil (RODS) feature where a depth/stencil buffer is used as a read-only attachment for calculating reflections and depth in shaders. The example includes source code for hexagonal terrain generation, WGSL shaders for terrain and water rendering, and a README with run instructions.
examples/features/src/water · high confidence
New wgpu-benchmark harness with bindless and resource creation tests
The benchmarking suite in benches/benches has been restructured into a new harness (wgpu-benchmark) that introduces several new performance tests. This includes benchmarks for creating bind groups with binding arrays (bind\_groups.rs), compute and render pass encoding with both standard and bindless resource layouts (computepass.rs, renderpass.rs, and their corresponding WGSL shaders), and parallel buffer resource creation (resource\_creation.rs). The main entry point (main.rs) registers these new benchmarks alongside existing Naga shader pipeline tests (parsing, validation, compaction, and backend generation).
benches/benches · high confidence
New wgpu-naga-bridge for shader capability mapping
Added a new \wgpu-naga-bridge\ library that provides conversions between \wgpu\_types\ and \naga\ capabilities. This component maps WebGPU features and downlevel flags to Naga validation capabilities, enabling the shader compiler to understand which hardware features are available for shader validation and code generation.
wgpu-naga-bridge/src · high confidence
Safe access to underlying hardware abstraction layer resources
The wgpu-core library now provides \as\_hal\ methods on \Buffer\, \Texture\, and \TextureView\ that return a guard object. This guard keeps the resource alive and provides safe, direct access to the underlying hardware abstraction layer (HAL) type. This change allows internal components and backends to interact with raw hardware resources without risking use-after-free errors or manual memory management issues.
wgpu-core/src · high confidence
Support for external textures and interop with web image sources
This change introduces the ability to import and use external textures (such as video frames, image bitmaps, and canvas elements) within the WebGPU pipeline on the web. It adds new types like \ExternalTextureDescriptor\ and \ExternalImageSource\ to define the format, color space, and transformation matrices for these external sources, enabling developers to copy data from web-native image elements directly into GPU textures.
wgpu-types/src/texture · high confidence
Vulkan backend implementation for wgpu-hal
The Vulkan hardware abstraction layer (HAL) has been implemented, providing the core infrastructure for GPU access on Vulkan-capable systems. This includes adapter enumeration and feature detection, command encoding and buffer/texture management, descriptor set allocation, and device lifecycle handling. The implementation maps wgpu texture formats to Vulkan equivalents, manages render passes and framebuffers, and supports advanced features such as ray tracing, mesh shaders, and HDR color spaces where the underlying driver allows.
wgpu-hal/src/vulkan · high confidence
wgpu-hal crate initialization with license, documentation, and build configuration
The wgpu-hal crate has been added to the repository, providing a cross-platform unsafe graphics abstraction layer with backends for Vulkan, Metal, Direct3D 12, and GL. This change introduces the Apache 2.0 and MIT license files, a comprehensive README detailing the crate's design principles and backend support, and a build script that configures target-specific feature flags (such as \cfg\_aliases\) to enable conditional compilation for different platforms and graphics APIs.
wgpu-hal · high confidence
Architecture
Extract shared WGSL formatting and diagnostic logic into a common module
The WGSL front-end and back-end now share a common codebase for formatting Naga IR types and handling diagnostic filters. This change introduces a new \naga/src/common/wgsl\ module containing traits like \TypeContext\ and \TryToWgsl\ to standardize how types are converted to WGSL source code, and adds \diagnostics.rs\ to map WGSL diagnostic severities and triggering rules. This refactoring ensures consistent type representation and error reporting across both parsing and code generation.
naga/src/common/wgsl · high confidence
GLSL frontend refactored into modular source files
The GLSL frontend implementation has been reorganized from a single monolithic file into a set of distinct modules (ast, builtins, context, error, functions, lex, parser, offset, token, types, variables). This structural change improves code maintainability and separation of concerns without altering the external parsing API or shader compatibility.
naga/src/front/glsl · high confidence
Naga validation module restructured into dedicated submodules
The shader validation logic in \naga/src/valid\ has been refactored from a single large module into distinct submodules (\analyzer\, \compose\, \expression\, \function\, \handles\, \immediates\, \interface\, \type\). This change organizes the validation rules by concern—such as control flow uniformity analysis, expression type checking, function call validation, and interface binding checks—without altering the external API or validation behavior.
naga/src/valid · high confidence
New command buffer allocation and encoding architecture in wgpu-core
The \wgpu-core/src/command\ module has been restructured to introduce a dedicated \CommandAllocator\ for pooling and reusing \CommandEncoder\ instances, reducing allocation overhead. Command encoding logic has been extracted into new, focused modules: \bind.rs\ handles bind group layout compatibility and binding state, \bundle.rs\ implements the isolated render bundle recording and replay system, and \clear.rs\ manages buffer and texture clearing operations. This refactoring centralizes command buffer state management and improves the separation of concerns within the command encoding pipeline.
wgpu-core/src/command · high confidence
Refactored Naga module compaction into dedicated tracing and mapping modules
The module compaction logic in \naga/src/compact\ has been reorganized into separate files (\expressions.rs\, \functions.rs\, \handle\_set\_map.rs\, \statements.rs\, \types.rs\) to improve maintainability. This change introduces dedicated tracer structs (\ExpressionTracer\, \FunctionTracer\, \TypeTracer\) to handle usage analysis for different IR components and a \HandleMap\ to manage handle remapping during compaction. The core \compact\ function and its configuration (\KeepUnused\) remain, but the internal implementation is now structured around these specialized components to trace and adjust expressions, functions, statements, and types more modularly.
naga/src/compact · high confidence
Refactored SPIR-V ray tracing backend into modular components
The SPIR-V backend's ray tracing code has been reorganized into a dedicated \naga/src/back/spv/ray\ module, splitting functionality into \query.rs\ for ray query operations and \pipeline.rs\ for ray tracing pipeline support, while \mod.rs\ now houses shared helpers like \ExtractedRayDesc\ and validation logic. This structural change improves code maintainability and separation of concerns for ray tracing features without altering the generated output.
naga/src/back/spv/ray · high confidence
Refactored WGSL lowering into modular construction, conversion, and template handling
The WGSL front-end's lowering logic has been restructured from a single monolithic module into distinct, focused components: \construction.rs\ handles type constructors (including partial inference for vectors, matrices, and arrays), \conversion.rs\ manages WGSL's automatic type conversions for abstract types, and \template\_list.rs\ parses generic template arguments. This refactoring improves code organization and error reporting within the \naga/src/front/wgsl/lower\ directory.
naga/src/front/wgsl/lower · high confidence
Restructured IR module layout with dedicated Block type
The internal organization of the Naga Intermediate Representation has been refactored to improve modularity. The \Block\ type, which represents a sequence of statements with associated span information, has been extracted into its own dedicated source file (\block.rs\). The core IR definitions and documentation have been consolidated into \mod.rs\. This change isolates the block management logic from the broader IR type definitions, making the codebase easier to navigate and maintain without altering the external API or shader processing behavior.
naga/src/ir · high confidence
SPIR-V frontend refactored into modular sub-files
The SPIR-V frontend parser in \naga/src/front/spv\ has been reorganized from a single large module into distinct sub-modules (\convert\, \error\, \function\, \image\, \next\_block\, \null\). This change extracts specific parsing logic—such as SPIR-V to Naga IR type mapping, error reporting, function body parsing, image sampling operations, and control-flow block processing—into their own files to improve maintainability and reduce the complexity of the main entry point.
naga/src/front/spv · high confidence
Behavioural changes
Add Angle as GL backend on Windows
The commit message indicates that the Angle library is now available as a graphics backend on Windows, allowing users to utilize OpenGL functionality via Angle's translation layer. However, the provided code diff only shows the creation of new \lib.rs\ files in the \wgpu-core/platform-deps/linux-android-bsd\ and \wgpu-core/platform-deps/windows\ directories, which merely include a README. The actual implementation details of the Angle backend integration are not visible in this excerpt, so the specific behavioral change is inferred solely from the commit message.
wgpu-core/platform-deps/linux-android-bsd, wgpu-core/platform-deps/windows · low confidence · unverified
Add Apache-2.0 and MIT license files and configure build-time feature flags
The wgpu crate now includes LICENSE.APACHE and LICENSE.MIT files, clarifying the dual-licensing terms for users. Additionally, a new build.rs script has been added to define complex cfg\_aliases for backend selection (such as WebGPU, WebGL, DX12, Metal, Vulkan, DRM, and GLES) based on target platform and enabled features, and to expose documentation image URLs for accurate local and hosted documentation builds.
wgpu · high confidence
Add option to skip integer division safety checks in SPIR-V output
The naga-test library now supports an \emit\_int\_div\_checks\ configuration option for SPIR-V generation. When enabled (the new default), the SPIR-V backend will wrap integer division operations with safety checks; users can disable this to generate more compact code if they are certain their division operands are safe.
naga-test · high confidence
Complete rewrite of the WGSL parser with new AST, lexer, and directive support
The WGSL front-end parser in \naga/src/front/wgsl/parse\ has been completely rewritten from scratch. This change introduces a new Abstract Syntax Tree (AST) structure (\ast.rs\) that separates parsing from lowering, a new tokenizer (\lexer.rs\) that implements WGSL's template list discovery algorithm, and a new directive system (\directive.rs\) for parsing \enable\, \requires\, and \diagnostic\ directives. The new parser also adds support for \immediate\ address space, mesh shader built-ins, ray tracing built-ins, and 64-bit integer/float literals, while removing the previous recursive descent implementation.
naga/src/front/wgsl/parse · high confidence
Consolidated xtask subcommands for CI, testing, and maintenance
The \xtask\ tool now provides a unified set of subcommands to manage project workflows. The \changelog\ subcommand audits \CHANGELOG.md\ for odd characters and modifications to released sections. The \cts\ subcommand runs the WebGPU Conformance Test Suite with support for test filtering, backend selection, and external textures. New \install-warp\ and \install-agility-sdk\ subcommands automatically download and configure the WARP DLL and D3D12 Agility SDK for Windows testing. The \test\ subcommand orchestrates the test suite, including GPU configuration generation and SDK installation. Additionally, \sync-repo-files\ synchronizes agent and license files, \miri\ runs Miri checks, and \run-wasm\ builds and serves WebGPU/ WebGL examples.
xtask · high confidence
DXGI subsystem refactored into modular auxiliary components
The DXGI helper code in \wgpu-hal/src/auxil/dxgi\ has been reorganized into distinct modules (\conv\, \dxgi\_lib\, \exception\, \factory\, \hdr\, \name\, \result\, \time\) to improve maintainability and sharing between backends. This change introduces a dedicated \DxgiLib\ for dynamic loading of \dxgi.dll\ functions, a new \DxgiHdrSource\ for reading HDR display information (shared with the Vulkan backend), and a vectored exception handler to map D3D12 debug messages to log levels. It also adds specific adapter filtering for Intel Haswell iGPUs and WARP software adapters, and implements texture format conversion helpers for SRV/UAV and copy operations.
wgpu-hal/src/auxil/dxgi · high confidence
Enforce explicit interpolation for integer shader I/O and upgrade atomic types in SPIR-V
The SPIR-V frontend now automatically promotes scalar types to atomic types when they are accessed via atomic instructions, ensuring compatibility with Naga IR and downstream targets like Metal and WGSL. Additionally, integer inputs and outputs passed from vertex to fragment shaders must now explicitly specify an interpolation qualifier (such as \flat\); floating-point values continue to default to perspective-correct interpolation, while integer values without an explicit qualifier will be rejected by the validator.
naga/src/front · high confidence
Extracted remote resource management infrastructure into wgpu-core-remote
The \wgpu-core-remote\ crate now contains the core infrastructure for managing GPU resources in a remote (IPC) context, including the \Hub\ struct that tracks all resource types (buffers, textures, pipelines, etc.), the \Registry\ and \Storage\ components for ID-based resource allocation and retrieval, and the \Id\ reference system. This extraction separates the remote-specific resource tracking logic from the main \wgpu-core\ global state, enabling the GPU process to handle resource lifecycle management for commands originating from untrusted content processes.
wgpu-core-remote/src · high confidence
GLSL backend refactored into modular components with expanded feature support
The GLSL backend has been restructured into distinct modules (conv, features, keywords, writer) to improve maintainability and code organization. This change introduces a comprehensive feature flag system that explicitly tracks and validates GLSL version requirements for capabilities such as double precision, compute shaders, image atomics, and barycentric coordinates. It also adds support for new shader features including 16-bit integer types, mesh shader built-ins, and ray tracing primitives, while updating reserved keyword lists and builtin mappings to align with modern GLSL specifications.
naga/src/back/glsl · high confidence
Hello triangle example updated to use new wgpu API
The hello\_triangle example has been updated to use the latest wgpu API, including the new \CurrentSurfaceTexture\ enum for surface texture handling, the \default\_queue\ field in \DeviceDescriptor\, and the \immediate\_size\ field in \PipelineLayoutDescriptor\. The example now also uses \winit\ 0.30 and handles window resizing more robustly by triggering a surface resize to deal with race conditions.
_examples/features/src/hello\triangle · high confidence
Improved diagnostic and debug output for Naga IR types
Naga now provides language-aware formatting for IR types in error messages and debug logs. New \DiagnosticDisplay\ and \DiagnosticDebug\ wrappers, along with \ForDebug\ traits, ensure that when WGSL features are enabled, types like scalars, handles, and type resolutions are rendered in WGSL syntax rather than raw internal representations. This change also moves predeclared type name generation and vector size string helpers into common code, ensuring consistent naming and display logic across frontends and backends.
naga/src/common · high confidence
Indirect draw and dispatch validation moved to a dedicated module with updated WGSL shader logic
The indirect validation machinery in wgpu-core has been reorganized into a new \indirect\_validation\ module containing \dispatch.rs\, \draw.rs\, \utils.rs\, and \validate\_draw.wgsl\. This change introduces a dedicated WGSL shader for indirect draw validation that explicitly checks vertex/index and instance limits against device constraints, handles indexed vs non-indexed draws, and zeroes out invalid draw arguments in the destination buffer. The module also adds utility helpers for unique index iteration and buffer barrier management, and enforces that indirect draw validation does not encounter u64 offsets by asserting buffer sizes fit within u32 limits.
_wgpu-core/src/indirect\validation · high confidence
Introduce structured CTS test management with explicit pass/fail/skip lists
The cts\_runner now uses dedicated text files (test.lst, fail.lst, skip.lst) to explicitly manage which WebGPU Conformance Test Suite (CTS) tests are expected to pass, fail, or be skipped, replacing the previous ad-hoc or implicit selection method. This change provides clear visibility into test coverage status, documents known platform-specific issues (e.g., DX12, Vulkan, Metal) and unimplemented features (e.g., external textures, subgroups), and enforces sorted ordering of test selectors via an integration test. The runner also updates the CTS revision to 83cbc838309ba7bddf6f3ec5c17574564773732b and includes a README clarifying its role in running CTS and standalone WebGPU snippets.
_cts\runner · high confidence
Introduces dynamic HAL trait abstractions for runtime polymorphism
The \wgpu-hal/src/dynamic\ module now provides a set of \Dyn\-prefixed traits (such as \DynDevice\, \DynCommandEncoder\, \DynAdapter\, \DynInstance\, \DynQueue\, and \DynSurface\) that wrap the existing concrete HAL implementations. These traits allow hardware abstraction layer objects to be stored and passed around as trait objects (\dyn Trait\) rather than concrete generic types, enabling runtime polymorphism and dynamic dispatch for GPU resources and operations.
wgpu-hal/src/dynamic · high confidence
Metal backend reimplementation using objc2
The Metal hardware abstraction layer (HAL) has been rewritten to use the \objc2\ ecosystem (including \objc2-metal\ and \objc2-foundation\) instead of the previous \objc\ crate. This migration updates the underlying Objective-C bindings for Metal API interactions, including device initialization, command encoding, surface management, and shader compilation, while maintaining the same public API surface for the wgpu core.
wgpu-hal/src/metal · high confidence
Naga arena module refactored into submodules with new HandleSet type
The \naga/src/arena\ module has been reorganized into submodules (\handle\, \handle\_set\, \handlevec\, \range\, \unique\_arena\), moving the \HandleSet\ type from the \compact\ module into the core arena module. This change introduces \HandleSet\ as a new data structure for tracking sets of arena handles, which is now used by the validator for expression sets and visit requirements. The refactoring also includes the addition of a \take()\ method to \Arena\ and \UniqueArena\, and ensures the arena types use \core\ and \alloc\ instead of \std\ for better compatibility.
naga/src/arena · high confidence
Naga shader compiler restructured with new diagnostic filtering and error reporting
The Naga shader compiler has been restructured to introduce a new \diagnostic\_filter\ module, allowing users to configure diagnostic severities (Off, Info, Warning, Error) for specific triggering rules like \DerivativeUniformity\ via WGSL \@diagnostic\ attributes. Error reporting has been enhanced with a new \error.rs\ module that escapes control characters in source code during diagnostic printing and supports optional \termcolor\ and \stderr\ features for formatted output. The core library (\lib.rs\) now uses \NonMaxU32\ for handle indices to optimize memory layout, implements \no\_std\ support via a custom \RacyLock\ for lazy initialization, and reorganizes internal modules like \arena\ and \ir\ for better structure.
naga/src · high confidence
New GLSL parser implementation in naga
The GLSL frontend parser has been restructured into dedicated modules (declarations, expressions, functions, types) within the parser directory. This change introduces support for parsing complex GLSL constructs including struct declarations, array specifiers, type constructors, and function calls, while enforcing strict type checking for literals and handling layout qualifiers.
naga/src/front/glsl/parser · high confidence
New auxil module for shared HAL utilities and RenderDoc integration
The \wgpu-hal/src/auxil\ module has been introduced to centralize shared low-level utilities for the Hardware Abstraction Layer. This includes a \DynLib\ wrapper for dynamic library loading, a \db\ submodule containing GPU vendor ID constants, and helper methods on \CopyExtent\ and \TextureCopy\ to correctly handle physical sizes and clamp copy operations. Additionally, it provides a new RenderDoc integration that dynamically loads the RenderDoc API to enable frame capture debugging, and implements logic to adjust reported limits to comply with WebGPU adapter capability guarantees.
wgpu-hal/src/auxil · high confidence
New deadlock-prevention lock validation in wgpu-core
The \wgpu-core/src/lock\ module now provides instrumented lock wrappers that enforce a strict, cycle-free acquisition order to prevent deadlocks. When the \wgpu\_validate\_locks\ configuration is enabled (default in development and CI), the \ranked\ implementation checks that locks are acquired in a specific order defined in \lock::rank.rs\, asserting and panicking if the order is violated. An \observing\ mode is also available via the \observe\_locks\ feature to log lock acquisition sequences for analysis by the \lock-analyzer\ tool, while a \vanilla\ mode provides uninstrumented wrappers for production builds.
wgpu-core/src/lock · high confidence
New overload resolution system for Naga builtin functions
Naga now uses a new, structured overload resolution system for its builtin functions (such as math operations and constructors). This change introduces a new \OverloadSet\ trait and several implementation types (\Regular\, \List\, \AnyOverloadSet\) that define how argument types are matched to function signatures, including support for automatic type conversions. This replaces the previous ad-hoc validation logic with a more robust and extensible framework for type-checking builtins.
naga/src/proc/overloads · high confidence
Noop backend now supports buffer allocation and command recording
The Noop backend (formerly Empty) has been extended to support actual buffer memory management and command encoding. Users can now create buffers that store data in memory and record commands like buffer clears and copies, which are executed by the backend. This change enables the Noop backend to be used for more comprehensive testing and validation of wgpu-core logic, rather than just serving as a placeholder.
wgpu-hal/src/noop · high confidence
Refactor Vulkan swapchain into abstracted traits and native implementation
The Vulkan swapchain logic in \wgpu-hal\ has been restructured to separate the abstract interface from the platform-specific implementation. New \Surface\ and \Swapchain\ traits define the contract for creating swapchains, acquiring textures, and presenting frames, while the \native.rs\ module provides the concrete \NativeSurface\ implementation using Vulkan APIs. This change introduces support for chaining extension structs onto \VkSwapchainCreateInfoKHR\ and \VkPresentInfoKHR\ via a new \set\_next\_swapchain\_create\_chain\ method, and implements proper resource cleanup through \Drop\ implementations for surfaces and swapchains to prevent panics during destruction.
wgpu-hal/src/vulkan/swapchain · high confidence
Refactored memory initialization tracking into a modular, generic system
The memory initialization tracker has been restructured into a generic, modular system that tracks the initialization status of buffer and texture memory to avoid unnecessary zero-initialization. The new implementation introduces separate \BufferInitTracker\ and \TextureInitTracker\ components, with buffers tracked at byte granularity and textures at the mip-level and array-layer granularity. This change ensures that resources are only initialized when first read or when partial writes occur, optimizing performance by deferring initialization until necessary.
_wgpu-core/src/init\tracker · high confidence
Refined validation logic for inter-stage shader variable limits
The validation logic for the \maxInterStageShaderVariables\ limit has been updated to more accurately account for how different shader inputs consume this quota. Specifically, the \Position\ built-in no longer deducts from the limit, while other inter-stage built-ins like \Barycentric\ now correctly deduct 3 variables. The system also now properly handles \ClipDistances\ in vertex outputs and includes a debug assertion to ensure deductions are applied when errors occur, leading to more precise validation errors for users exceeding shader I/O limits.
wgpu-core/src/validation · high confidence
Reworked public API types to use internal dispatch wrappers
The \wgpu\ crate's public API types (such as \Adapter\, \Buffer\, \BindGroup\, \CommandEncoder\, etc.) have been restructured to wrap an internal \dispatch::Dispatch\*\ handle instead of directly exposing underlying resource IDs or core types. This change introduces \as\_core\ and \from\_core\ methods for interoperability with \wgpu-core\, adds \as\_custom\ support for custom backends, and implements \Clone\ and \Debug\ on these API types. Users will see that API objects are now more robustly encapsulated, with lifetime and ownership managed through the dispatch layer, while maintaining compatibility with existing code through the preserved public method signatures.
wgpu/src/api · high confidence
Rewrite of resource tracking system for improved performance and correctness
The resource tracking subsystem in wgpu-core has been completely rewritten to use a sparse, cache-efficient data structure that significantly reduces overhead during command buffer recording and execution. This change introduces dedicated trackers for all resource types—including buffers, textures, query sets, and BLASes—utilizing a dense array layout backed by bit-vectors to skip unused resources efficiently. The new architecture separates stateful tracking (for synchronization barriers) from stateless tracking (for lifetime management), ensuring that resources are kept alive correctly while minimizing memory usage and improving merge performance for bind groups and usage scopes.
wgpu-core/src/track · high confidence
SPIR-V backend refactored into modular components with mesh shader and f16 polyfill support
The SPIR-V backend in naga has been reorganized from a single large file into distinct modules (block, helpers, image, index, instructions, layout, mesh\_shader, and f16\_polyfill) to improve maintainability. This change introduces native support for mesh shaders, including the generation of output variables and handling of vertex/primitive return data, and adds an f16 I/O polyfill mechanism to convert 16-bit floats to 32-bit when the StorageInputOutput16 capability is unavailable. The refactoring also includes improved handling of std140 layout compatibility for two-row matrices in uniform buffers and more robust bounds-checking logic for array accesses.
naga/src/back/spv · high confidence
Updated WGSL reserved keyword list and caching mechanism
The WGSL frontend now uses an updated list of reserved keywords synchronized with the latest W3C Candidate Recommendation (dated 2025-08-09), ensuring compliance with the standard's current specification. To improve performance during shader processing, this reserved keyword list is now cached in a thread-safe set (\RESERVED\_SET\), reducing the overhead of repeated lookups during name resolution.
naga/src/keywords · high confidence
Vendored WebGPU bindings updated to web-sys 0.2.127
The vendored WebGPU bindings in the \webgpu\_sys\ backend have been updated to version 0.2.127 of the \web-sys\ crate. This refresh aligns the generated Rust bindings with the latest WebGPU specification changes, ensuring compatibility with current browser implementations and exposing updated API surface areas such as \GpuAdapterInfo\ fields and bind group entry variants.
_wgpu/src/backend/webgpu/webgpu\sys · high confidence
WGSL \`enable\` directive parsing and extension tracking
The WGSL front-end now parses \enable\ directives (e.g., \enable f16;\, \enable primitive\_index;\) to explicitly request optional shader capabilities. A new \EnableExtensions\ struct tracks which extensions are active for the current module, and the parser rejects features that require an extension if it has not been enabled, ensuring strict compliance with the WGSL specification's extension gating.
naga/src/front/wgsl/parse/directive · high confidence
WGSL frontend refactored into modular components with improved error reporting
The WGSL frontend has been restructured into distinct modules (\error\, \index\, \lower\, \parse\) to improve maintainability and error handling. This change introduces a dependency-ordering index for global declarations to detect and report cyclic references more clearly, and replaces the previous error handling with a structured \ParseError\ type that supports detailed labels, notes, and control-character escaping in diagnostics. The frontend now exposes specific extension enums (\EnableExtension\, \LanguageExtension\) and provides a \Frontend\ struct for configurable parsing, while retaining the \parse\_str\ convenience function.
naga/src/front/wgsl · high confidence
Workarounds for switch/loop bugs and pipeline constant processing in shader backends
The shader backends (HLSL, GLSL) now include logic to work around platform-specific bugs where \continue\ statements inside \switch\ blocks or single-body \switch\ statements cause miscompilation; this is handled by introducing synthetic boolean flags to forward control flow correctly. Additionally, the \back\ module now exposes the \pipeline\_constants\ module, which allows users to provide values for pipeline-overridable constants, automatically compacting the module to remove unreachable code and replacing override expressions with concrete constants before validation.
naga/src/back · high confidence
wgpu v30: Major API overhaul with new dispatch infrastructure and no\_std support
This release introduces a comprehensive rewrite of the wgpu crate, shifting to a new dispatch-based architecture (wgpu/src/dispatch.rs) that unifies native (wgpu\_core) and WebGPU backends under object-safe interface traits. The public API has been significantly restructured: buffer mapping now uses callbacks instead of async futures, surface creation is unified via SurfaceTarget, and shader module creation supports WGSL, Naga, and GLSL sources. The library now supports no\_std environments, requires Rust 1.87+, and includes new features like external texture support, pipeline caching, and improved error handling with error scopes. Internal resource management has been refactored with new comparison/hashing infrastructure (wgpu/src/cmp.rs) and explicit Send/Sync implementations.
wgpu/src · high confidence
wgpu-core now uses cfg\_aliases for conditional compilation and includes license files
The wgpu-core crate has been updated to use the cfg\_aliases crate for managing complex conditional compilation flags, replacing previous macro-based backend selection logic. This change introduces new build-time configuration options for backends (such as DX12, WebGL, GLES, Vulkan, DRM, and Metal) and platform-specific features (like ANGLE support on Apple platforms). Additionally, Apache 2.0 and MIT license files have been added to the crate to clarify licensing terms for redistributors.
wgpu-core · high confidence
wgpu-types refactored into modular source files with new adapter and backend APIs
The \wgpu-types\ crate has been restructured from a single large \lib.rs\ into a modular directory layout (\adapter.rs\, \backend.rs\, \binding.rs\, \buffer.rs\, etc.), introducing dedicated types for adapter selection (\RequestAdapterOptions\, \FeatureLevel\, \PowerPreference\), backend configuration (\Backends\, \Backend\ enum), and binding layouts (\BindingType\). This change also adds support for limit bucketing via \AdapterLimitBucketInfo\ and introduces a \Noop\ backend for testing, alongside new assertion macros for strict validation.
wgpu-types/src · high confidence
Fixes
Disable libFuzzer on OpenBSD and Windows ARM64
The naga fuzzing harness now disables libFuzzer support on OpenBSD and Windows ARM64 targets. This change prevents build failures on these platforms by excluding them from the \fuzzable\_platform\ configuration in the build script, ensuring the fuzzing infrastructure only compiles on supported architectures.
naga/fuzz · high confidence
Test coverage
Add deep-nesting and structural regression tests for Naga; Added GPU shader test suite for array overrides, builtins, and struct layouts; Added GPU tests for binding arrays across buffers, textures, samplers, and TLAS; Added GPU tests for external texture operations; Added GPU tests for mesh shader functionality; Added GPU tests for multiview rendering capabilities; Added GPU tests for per-vertex attribute interpolation; Added GPU tests for ray tracing acceleration structures and ray queries; Added GPU tests for shader barycentric coordinates; Added GPU tests for shader passthrough across multiple languages; Added GPU tests for storage texture binding and scalar load operations; Added GPU tests for subgroup and quad operations; Added GPU tests for timestamp normalization utility functions; Added GPU tests for vertex, index, and instance index handling; Added MSL test cases for SPIR-V and WGSL code generation; Added WGSL snapshot tests for GLSL input; Added WebGPU trace playback test harness; Added bug reproduction example for surface presentation issues; Added compile-fail tests for ComputePass and RenderPass lifetime errors; Added comprehensive vertex format validation tests; Added fuzzing targets for Naga parsers and IR validator; Added integration tests for cts\_runner; Added regression tests for GPU driver and validation edge cases; Added regression tests for Send/Sync trait implementations; Added replay test data for buffer, texture, and pipeline operations; Added tests for LoadOp::DontCare behavior and strict compliance; Added tests for NV12 and P010 planar texture support; Added tests for WGPU dependency resolution on wasm32; Added tracing tests for buffer and texture operations; Added validation tests for limit bucketing, Noop backend, and StagingBelt; Expanded API validation test coverage; Expanded GLSL backend test coverage for WGSL and SPIR-V inputs; Expanded GLSL test coverage for shader parsing and validation; Expanded GPU test coverage for validation and resource management; Expanded HLSL snapshot test coverage for SPIR-V and WGSL inputs; Expanded SPIR-V test coverage for atomic, barrier, and binding array operations; Expanded SPIR-V test coverage for shader features and bug fixes; Expanded WGSL snapshot test coverage for Naga; Introduction of internal validation canary for testing; New GPU test harness framework; Updated Naga analysis snapshot tests.
Dependencies
Initial Cargo.lock generation
The project now includes a generated Cargo.lock file, establishing a deterministic dependency tree for the workspace. This ensures that all builds use the exact same versions of crates and their transitive dependencies, preventing unexpected changes from upstream updates.
(dependencies) · high confidence
Housekeeping
Add Apache 2.0 and MIT license files to naga-cli; Added Apache 2.0 and MIT license files to wgpu-naga-bridge; Release v0.16.0.
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.
Score
- CAI 39 → 71 (+32.0)
- Rubric changed (rubric-2026.08.15 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 36 → 77 (+40.8)
- Architecture 68 (new)
- Maturity 57 → 76 (+19.1)
- Readiness 31 → 82 (+51.5)
- Security 63 → 69 (+5.6)
Resolved (68)
- Change coupling: bootstrap.js ↔ 01_webgpu.js (cts_runner/src/bootstrap.js)
- Dimension evaluation failed
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- …and 48 more
New (1576)
- Adapter::device_from_raw (cognitive 56) (wgpu-hal/src/vulkan/adapter.rs)
- Adapter::device_from_raw (cyclomatic 47) (wgpu-hal/src/vulkan/adapter.rs)
- Adapter::expose (cognitive 106) (wgpu-hal/src/dx12/adapter.rs)
- Adapter::expose (cognitive 137) (wgpu-hal/src/gles/adapter.rs)
- Adapter::expose (cyclomatic 103) (wgpu-hal/src/dx12/adapter.rs)
- Adapter::expose (cyclomatic 96) (wgpu-hal/src/gles/adapter.rs)
- Adapter::texture_format_capabilities (cognitive 47) (wgpu-hal/src/metal/adapter.rs)
- Adapter::texture_format_capabilities (cyclomatic 50) (wgpu-hal/src/metal/adapter.rs)
- Adapter::texture_format_capabilities (cyclomatic 55) (wgpu-hal/src/gles/adapter.rs)
- BakedCommands::initialize_buffer_memory (cognitive 17) (wgpu-core/src/command/memory_init.rs)
- BakedCommands::initialize_texture_memory (cognitive 23) (wgpu-core/src/command/memory_init.rs)
- BindGroupLayoutEntry::try_into (cognitive 16) (wgpu-core/src/binding_model.rs)
- BlockContext::cache_expression_value (cognitive 183) (naga/src/back/spv/block.rs)
- BlockContext::cache_expression_value (cyclomatic 249) (naga/src/back/spv/block.rs)
- BlockContext::write_access_chain (cognitive 23) (naga/src/back/spv/block.rs)
- BlockContext::write_access_chain (cyclomatic 18) (naga/src/back/spv/block.rs)
- BlockContext::write_as_expression (cognitive 22) (naga/src/back/spv/block.rs)
- BlockContext::write_as_expression (cyclomatic 32) (naga/src/back/spv/block.rs)
- BlockContext::write_block (cognitive 135) (naga/src/back/spv/block.rs)
- BlockContext::write_block (cyclomatic 83) (naga/src/back/spv/block.rs)
- …and 1556 more
Changes since last survey
- 300 commits — 251 feature/other, 49 fixes
By area
- (root) — 46 commits
- wgpu/src — 46 commits
- .github/workflows — 32 commits
- wgpu-core/src — 25 commits
- wgpu-core-remote-types/src — 23 commits
- wgpu-hal/src — 22 commits
- wgpu-core-remote/src — 16 commits
- tests/tests — 12 commits
- deno_webgpu/device.rs — 9 commits
- wgpu-types/src — 9 commits
- cts_runner/test.lst — 8 commits
- naga/src — 8 commits
- naga/tests — 7 commits
- .github/mergify.yml — 3 commits
- cts_runner/fail.lst — 3 commits
- deno_webgpu/adapter.rs — 3 commits
- wgpu-core/platform-deps — 3 commits
- .github/actions — 2 commits
- cts_runner/skip.lst — 2 commits
- deno_webgpu/bind_group_layout.rs — 2 commits
Notable commits
- fix: Fix WebGL build after external texture API changes (#10201)
- fix: Fix a non-breaking space in the changelog (#10210)
- fix: Fix changelog checks when the base branch advances (#10342)
- fix: Fix crash on older vulkan drivers when poolSizeCount == 0 (#10124)
- fix: Fix doc_comments struct_member indices for undocumented members (#10273)
- fix: Fix dxc compile error when shader label contains : (#10134)
- fix: Fix error messages with texture view aspect validation on multiplanar formats (#9702)
- fix: Fix issue with surface drop panic (#10230)
- fix: Fix lock issues affecting mark_externally_initialized test
- fix: Fix lock rank graph for SURFACE_PRESENTATION (#10426)
- fix: Fix separate depth stencil read-only state (#9763)
- fix: Fix stale poll() doc comments referring to a bool return value
- fix: Revert part of #10115 by removing result from create_render_bundle_encoder and reimpl content validation in deno (#10179)
- fix: Support raytracing barycentrics for spirv, and fix spirv 1.4 handling for mesh and raytracing shaders (#10193)
- fix: [core] Log shader translation error and beg for bug reports (#10241)
- fix: [vulkan] Fix interacting robust image access feature detection (#10291)
- fix: chore: Fix CRLF line endings (#10299)
- fix: fix(const_eval): handle non-vector Compose select args. (#10350)
- fix: fix(core): Add missing DISCARD_HAL_LABELS checks in ray tracing (#10123)
- fix: fix(core): Check for device loss before mapping buffers (#10301)
- …and 280 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
gfx-rs/wgpu was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 27 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit babefc0d26f636a6d607bba0eefefb588232227e — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-d00c643c3f66.