"매 GPU 명령마다 어떤 컨텍스트에서 그릴지 결정하는 파라미터 묶음". 매 blend mode, depth test, rasterizer setup, shader binding 의 collection. 매 modern Vulkan/D3D12 에서는 PSO (Pipeline State Object) 의 immutable bake — state change cost 의 minimization.
매 핵심
매 구성 요소
Rasterizer state: cull mode, fill mode, depth bias.
VkPipelineDynamicStateCreateInfodyn{};VkDynamicStateds[]={VK_DYNAMIC_STATE_VIEWPORT,VK_DYNAMIC_STATE_SCISSOR};dyn.dynamicStateCount=2;dyn.pDynamicStates=ds;// PSO 는 viewport/scissor 없이 bake → runtime 에서 cmd.setViewport()
// Descriptor heap 1개 + bindless indexing → PSO 변경 거의 없음
ConstantBuffer<uint>meshIdx;Texture2D<float4>textures[]:register(t0,space0);float4color=textures[NonUniformResourceIndex(materialId)].Sample(...);
매 결정 기준
상황
Approach
AAA 엔진, 수만 draw call
PSO + sort by state hash
Indie, simple 2D
Dynamic state OK, PSO 1-2개
Shader 자주 바뀜 (dev)
PSO cache + hot-reload
Mobile (tile-based)
Render pass 단위 minimization
기본값: PSO bake at level load + state-sorted draw queue.