webgpu-wgsl-builtins

Validate WGSL builtin functions and values for WebGPU shader stages.

Updated May 20, 2026
One-click install
npx skills add https://github.com/Impertio-Studio/WebGPU-Claude-Skill-Package --skill webgpu-wgsl-builtins
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: webgpu-wgsl-builtins
Source: https://github.com/Impertio-Studio/WebGPU-Claude-Skill-Package/tree/main/skills/source/webgpu-wgsl/webgpu-wgsl-builtins
Command: npx skills add https://github.com/Impertio-Studio/WebGPU-Claude-Skill-Package --skill webgpu-wgsl-builtins

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill prevents WGSL shader-creation errors caused by using the wrong builtin function, the wrong builtin value, or the wrong shader stage for a WebGPU 1.0 workflow.

Core Features & Use Cases

  • Builtin Function Guidance: Helps choose the correct WGSL math, geometric, integer, pack, texture, derivative, atomic, synchronization, and array builtins.
  • Builtin Value Mapping: Clarifies which builtins are inputs or outputs in vertex, fragment, and compute stages, including direction and type.
  • Error Prevention: Guards against common failures such as stage-restricted texture calls, invalid derivative usage, missing subgroup feature gates, and incorrect uniform control flow.
  • Use Case: A shader author can use this Skill to fix a fragment shader that incorrectly calls a derivative builtin from compute, or to validate that a vertex output uses the proper builtin and interpolation rules.

Quick Start

Ask for the webgpu-wgsl-builtins skill to validate your WGSL builtin calls and builtin value declarations before you compile the shader.

Frequently Asked Questions about webgpu-wgsl-builtins

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I validate WGSL builtin functions in WebGPU shaders?

To validate WGSL builtin functions, you check stage-legal math, texture, derivative, atomic, and synchronization builtins against vertex, fragment, and compute shader entry points to prevent shader-creation errors.

Can I use derivative builtins in a WebGPU compute shader?

Derivative builtins are stage-restricted in WebGPU and cannot be used in compute shaders. They must be validated for correct usage only within fragment shader entry points to avoid creation errors.

What are the correct @builtin input and output directions for WebGPU vertex shaders?

Vertex shader @builtin directions require specific input and output type mappings. You must enforce these correct directions and interpolation rules to ensure the WebGPU pipeline validates successfully.

Do I need feature gates for WGSL subgroups and clip_distances builtins?

You need feature gates for WGSL subgroups and clip_distances builtins. Checking these gates ensures that your shader correctly declares required hardware capabilities before compilation.

Why does my WGSL shader fail creation due to uniform control flow rules?

WGSL shader creation fails because certain builtins require uniform control flow. You must enforce these uniform-control-flow rules to prevent invalid execution paths and shader-creation errors.

What is the best way to choose stage-legal WGSL array and atomic builtins?

The best way to choose stage-legal WGSL array and atomic builtins is to validate them against the specific vertex, fragment, or compute shader entry point requirements before compiling.