"매 indirect draw 는 draw call args 의 GPU buffer 의 read — CPU roundtrip 없이 GPU 의 self-dispatch". 2026 의 GPU-driven rendering pipeline 의 foundation: Vulkan/D3D12/Metal/WebGPU 의 support. 매 culling, LOD, instancing 의 GPU 에서 결정 → CPU draw-call overhead 의 elimination.
매 핵심
매 vs Direct Draw
Direct: draw(vertexCount, instanceCount, firstVertex, firstInstance) — args from CPU.
Indirect: drawIndirect(buffer, offset) — args read from GPU buffer.
Multi-draw indirect (MDI): thousands of draws from one CPU command.
// Each frame, before culling, zero out instanceCount
device.queue.writeBuffer(indirectBuffer,4,newUint32Array([0]));
Multi-Draw Indirect (Vulkan)
// Draw N different meshes from one buffer
vkCmdDrawIndexedIndirect(cmd,indirectBuf,0,/*drawCount*/N,/*stride*/sizeof(VkDrawIndexedIndirectCommand));// Or with count buffer (drawCount is itself on GPU)
vkCmdDrawIndexedIndirectCount(cmd,indirectBuf,0,countBuf,0,/*maxDraws*/N,sizeof(VkDrawIndexedIndirectCommand));
Three.js (R175+ has WebGPU)
import{WebGPURenderer,BatchedMesh}from'three';constrenderer=newWebGPURenderer();// BatchedMesh internally uses indirect draw + instancing
constbatched=newBatchedMesh(maxInstances,maxVerts,maxIndices);batched.addGeometry(geom1);batched.addGeometry(geom2);// One draw call, GPU handles per-instance state
언제: GPU-driven pipeline 의 design, culling 의 implement, draw-call overhead 의 reduce.
언제 X: simple scene 의 indirect draw 의 over-engineering — direct 의 fine.
❌ 안티패턴
CPU readback of indirect buffer: 매 stall. GPU 의 self-contained 의 keep.
Per-frame full buffer rewrite: defeats purpose. 매 GPU compute 의 update.
No Hi-Z for occlusion: false positives — Hi-Z 또는 conservative AABB 의 사용.
Indirect for tiny scenes: compute dispatch overhead > savings.
WebGL fallback assumed: WebGL 의 no indirect draw — WebGPU required.