Loading comparison...
Loading comparison...
WebGPU Shading Language for writing GPU compute and rendering shaders in web applications.
The W3C GPU for the Web Working Group developed WGSL (WebGPU Shading Language) as the shader language for the WebGPU API, with the specification reaching Candidate Recommendation status in 2023. WGSL was created to replace WebGL's reliance on GLSL with a shader language designed from the ground up for the modern web platform, incorporating safety guarantees and portability across GPU architectures that GLSL could not provide. The language compiles to native GPU shader formats — SPIR-V for Vulkan, MSL for Metal, and DXIL for DirectX 12 — enabling consistent behavior across operating systems and GPU vendors.
WGSL's syntax draws from Rust and HLSL, featuring strong typing, structure types, arrays, vectors, matrices, and texture/sampler types that map to GPU hardware concepts. The language supports both vertex/fragment shaders for rendering and compute shaders for general-purpose GPU computing, enabling applications ranging from 3D games and data visualizations to machine learning inference and physics simulations running directly in the browser. WGSL enforces memory safety through its type system — there are no raw pointers, buffer overflows, or undefined behavior that could crash the GPU or leak data between browser tabs.
The address space model explicitly separates uniform, storage, workgroup, and private memory, preventing accidental cross-invocation data sharing. Tools like Tint (Google's WGSL compiler) and Naga (Mozilla's shader translation library) handle compilation and validation. As WebGPU adoption grows — with support in Chrome, Firefox, and Safari — WGSL is positioned to become the standard shader language for web-based graphics and compute, opening GPU programming to the vast web developer audience.
WGSL shader changes directly affect visual rendering output and GPU compute correctness, with results that are immediately visible but root causes that are hard to trace. Comparing WGSL files catches modified vertex transformations that distort geometry, altered fragment shader math that changes lighting and color, changed compute dispatch configurations that produce incorrect parallel results, and updated binding layouts that break the CPU-GPU data pipeline.
Graphics developers iterating on shaders need side-by-side diffs to correlate code changes with visual or computational output differences.
UtraDiff displays WGSL shader files in a diff editor with WGSL syntax highlighting, coloring entry points, struct definitions, and built-in functions distinctly. Side-by-side and inline views expose changes to vertex/fragment stages, compute workgroup sizes, and buffer bindings.
The whitespace-ignore toggle filters formatting noise from shader code generators. Keyboard navigation jumps between diff hunks, critical for reviewing GPU pipeline changes that affect rendering correctness and compute performance.
Supported extensions: .wgsl