webgpu-impl-instancing-indirect

Correct WebGPU instanced and indirect draw buffer layouts with alignment and feature checks.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill prevents corrupt geometry, broken instance indexing, and silent WebGPU draw bugs when rendering many copies of the same mesh or when letting the GPU decide draw counts.

Core Features & Use Cases

  • Instanced Rendering: Draw thousands of objects in one call with instanceCount instead of looping draw calls on the CPU.
  • Indirect and GPU-Driven Workflows: Use drawIndirect, drawIndexedIndirect, and dispatchWorkgroupsIndirect when compute shaders write counts and parameters into buffers.
  • Validation Guardrails: Enforce exact record sizes, 4-byte alignment, complete parameter writes, and correct firstInstance handling.
  • Fallback-Safe Multi-Draw Guidance: Handle experimental multiDrawIndirect paths with feature checks and stable loop-based fallbacks.
  • Use Case: Generate a particle system, culling pass, or large scene renderer that keeps the CPU out of the hot path while preserving correct buffer layouts.

Quick Start

Ask the assistant to generate a WebGPU instanced or indirect draw implementation for your mesh, including the correct buffer layout, alignment, and feature checks.

Frequently Asked Questions about webgpu-impl-instancing-indirect

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

FAQPage Schema
Why does my WebGPU instanced rendering corrupt geometry or misplace instance data?

WebGPU instanced rendering corrupts geometry when buffer layouts use incorrect indirect record sizes or incomplete u32 parameters. Enforcing exact 4-byte aligned offsets and complete parameter writes prevents silent instance data misplacement.

How do I set up GPU-driven culling using drawIndexedIndirect in WebGPU?

GPU-driven culling uses compute shaders to write draw parameters into buffers, then calls drawIndexedIndirect to execute rendering. You must enforce exact indirect record sizes and 4-byte aligned offsets to prevent draw corruption.

Does WebGPU 1.0 support multiDrawIndirect for rendering thousands of objects?

WebGPU 1.0 treats multiDrawIndirect as experimental and requires feature gating. You must check for indirect-first-instance and multiDrawIndirect support, using stable loop-based fallbacks if features are unavailable.

What is the correct buffer layout for dispatchWorkgroupsIndirect in WebGPU?

dispatchWorkgroupsIndirect requires complete u32 records with exact 4-byte aligned offsets. Compute shaders must fully write these parameters into the buffer to avoid silent dispatch errors.

How do I render a large particle system in WebGPU without looping draw calls on the CPU?

Large particle systems use instanced rendering with instanceCount or drawIndirect to keep the CPU out of the hot path. Correctly structuring indirect buffers and validating firstInstance handling ensures accurate multi-draw workflows.

When do I need feature gating for indirect-first-instance in WebGPU?

Feature gating for indirect-first-instance is required when using drawIndirect or drawIndexedIndirect with a starting instance offset. Checking this WebGPU feature prevents silent draw bugs during GPU-driven rendering workflows.