D3D12 笔记六 RASTERIZE STATEPipeline Object

mac2026-04-03  4

Rasterize State

use D3D12_RASTERIZE_DESC configure rasterization stage of the pipeline

CD3DX12_RASTERIZER_DESC 用来创建 structure 的类

CD3DX12_RASTERIZER_DESC rsDesc(D3D12_DEFAULT); //默认值的rasterization stage


Pipeline Object

背景:How to bind objects(like layout description, vertex shader, rasterize stage group) to the graphics pipeline?

定义: pipeline state object (PSO) :Most of the objects that control the state of the graphics pipeline are specified as an aggregrate called a pipeline state object

接口: ID3D12PipelineState

//声明 ComPtr<ID3D12PipelineState> mPSO = nullptr;

创建PSO过程:

1.填充结构 D3D12_GRAPHICS_PIPELINE_STATE_DESC 2.创建 :CreateGraphicsPipelineState() 3.在刷新CommandLIst时,设置PSO: mCommandList->Reset(mDirectCmdListAlloc.Get(), mPSO.Get())

之后再设置 mCommandList->SetPipelineState(mPSO2.Get()); /* draw objects using PSO */

最新回复(0)