以下是该结构体的定义:
typedef struct D3D12_AUTO_BREADCRUMB_NODE {
D3D12_AUTO_BREADCRUMB_TYPE Type;
union {
D3D12_DRAW_ARGUMENTS Draw;
D3D12_DRAW_INDEXED_ARGUMENTS DrawIndexed;
D3D12_DISPATCH_ARGUMENTS Dispatch;
D3D12_COMMAND_LIST_ID CommandList;
D3D12_PRIMITIVE_TOPOLOGY PrimitiveTopology;
D3D12_RESOURCE_BARRIER BarrierBegin;
D3D12_RESOURCE_BARRIER BarrierEnd;
D3D12_PIPELINE_STATE PipelineState;
D3D12_RENDER_TARGET_VIEW_DESC RenderTargetView;
D3D12_DEPTH_STENCIL_VIEW_DESC DepthStencilView;
D3D12_VERTEX_BUFFER_VIEW VertexBufferView[ D3D12_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT ];
D3D12_INDEX_BUFFER_VIEW IndexBufferView;
ID3D12Resource *pVertexBuffer;
ID3D12Resource *pIndexBuffer;
ID3D12PipelineState *pPipelineState;
ID3D12DescriptorHeap *pDescriptorHeap;
D3D12_CPU_DESCRIPTOR_HANDLE BackingStore;
D3D12_GPU_VIRTUAL_ADDRESS DestResourceVirtualAddress;
D3D12_GPU_VIRTUAL_ADDRESS SrcResourceVirtualAddress;
D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor;
D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptor0;
D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptor1;
D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptor2;
D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptor3;
D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptor4;
D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptor5;
D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptor6;
D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptor7;
D3D12_CPU_DESCRIPTOR_HANDLE DepthStencilDescriptor;
UINT NumBarriers;
const D3D12_RESOURCE_BARRIER *pBarriers;
HRESULT Hr;
};
} D3D12_AUTO_BREADCRUMB_NODE;
该结构体包含了Breadcrumb的信息,其中包括Breadcrumb的类型(Type)以及与类型相关的具体信息的联合体(union)。不同的Breadcrumb类型对应了不同的GPU命令和操作,例如绘制命令、资源屏障等。
请注意,Breadcrumb的使用需要在创建命令队列时启用,并通过 D3D12_COMMAND_QUEUE_DESC 中的 D3D12_COMMAND_QUEUE_FLAG_3D_CONTENT_PROTECTION 标志进行配置。在实践中,Breadcrumb通常与GPU调试、性能分析和错误追踪等工具一起使用。
确保在实际使用中详细阅读 Microsoft 官方文档以获取更多信息。
转载请注明出处:http://www.zyzy.cn/article/detail/25897/Win32 API/D3d12.h/D3D12_AUTO_BREADCRUMB_NODE