forge-indirect-drawing

Implements GPU-driven indirect drawing with compute-based frustum culling via SDL_DrawGPUIndexedPrimitivesIndirect.

Updated Mar 17, 2026
One-click install
npx skills add https://github.com/code-review-benchmark/coderabbit_prs2__forge-gpu__coderabbit__PR323__20260317 --skill forge-indirect-drawing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: forge-indirect-drawing
Source: https://github.com/code-review-benchmark/coderabbit_prs2__forge-gpu__coderabbit__PR323__20260317/tree/main/.claude/skills/forge-indirect-drawing
Command: npx skills add https://github.com/code-review-benchmark/coderabbit_prs2__forge-gpu__coderabbit__PR323__20260317 --skill forge-indirect-drawing

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

GPU-driven rendering lets compute shaders decide which objects to draw, avoiding CPU-side visibility tests and reducing draw calls in scenes with many instances.

Core Features & Use Cases

  • GPU-based frustum culling using a compute shader that writes indirect draw commands
  • Portable per-object storage buffers read by both compute and vertex stages
  • Indirect drawing via SDL_DrawGPUIndexedPrimitivesIndirect, enabling dynamic visibility without CPU routing
  • Use case: render large scenes with hundreds or thousands of instances with minimal CPU overhead

Quick Start

Enable GPU-driven indirect drawing and frustum culling to render only visible instances.

Frequently Asked Questions about forge-indirect-drawing

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

FAQPage Schema
How do I use GPU compute shaders for frustum culling and indirect drawing?

GPU compute shaders perform frustum culling by writing visibility decisions to an indirect command buffer, enabling indirect drawing without CPU-side visibility tests. Compute shaders evaluate frustum planes and output only visible instances.

What is GPU-driven rendering and when do I need it for large scenes?

GPU-driven rendering offloads visibility decisions from the CPU to the GPU using compute shaders. It is needed for scenes with hundreds or thousands of mesh instances to minimize CPU overhead and reduce draw calls.

Does SDL_GPU support indirect drawing for dynamic visibility?

SDL_GPU supports indirect drawing via SDL_DrawGPUIndexedPrimitivesIndirect. This function enables dynamic visibility by reading indirect draw commands generated directly by a compute shader.

How do I set up per-object storage buffers for compute and vertex stages?

Portable per-object storage buffers are configured for the pipeline to read and write data. Both compute and vertex stages access these buffers to evaluate frustum planes and render visible instances.

Why does my CPU frustum culling cause bottlenecks with many mesh instances?

CPU frustum culling creates bottlenecks by serializing visibility tests for many instances. GPU-driven indirect drawing solves this by offloading visibility decisions to compute shaders, bypassing CPU routing entirely.

What is the first_instance pattern in GPU-driven indirect rendering?

The first_instance pattern is a portable technique used in GPU-driven indirect rendering to manage per-object data access. It allows the pipeline to correctly index storage buffers when reading indirect draw commands.