refactor: 继续用 D3D12CommandList 替换原生 API
- 添加更多 wrapper 方法: SetDescriptorHeaps, SetGraphicsRootConstantBufferView, SetGraphicsRoot32BitConstants, SetGraphicsRootDescriptorTable, SetGraphicsRootShaderResourceView - 使用 wrapper 方法替换 main.cpp 中的原生 API 调用 - 测试通过
This commit is contained in:
@@ -67,9 +67,15 @@ public:
|
||||
void SetIndexBuffer(ID3D12Resource* buffer, uint64_t offset, Format indexFormat);
|
||||
|
||||
void SetDescriptorHeap(ID3D12DescriptorHeap* heap);
|
||||
void SetDescriptorHeaps(uint32_t count, ID3D12DescriptorHeap** heaps);
|
||||
void SetGraphicsDescriptorTable(uint32_t rootParameterIndex, D3D12_GPU_DESCRIPTOR_HANDLE baseHandle);
|
||||
void SetComputeDescriptorTable(uint32_t rootParameterIndex, D3D12_GPU_DESCRIPTOR_HANDLE baseHandle);
|
||||
|
||||
void SetGraphicsRootConstantBufferView(uint32_t rootParameterIndex, D3D12_GPU_VIRTUAL_ADDRESS bufferLocation);
|
||||
void SetGraphicsRoot32BitConstants(uint32_t rootParameterIndex, uint32_t num32BitValuesToSet, const void* pSrcData, uint32_t destOffsetIn32BitValues);
|
||||
void SetGraphicsRootDescriptorTable(uint32_t rootParameterIndex, D3D12_GPU_DESCRIPTOR_HANDLE baseDescriptor);
|
||||
void SetGraphicsRootShaderResourceView(uint32_t rootParameterIndex, D3D12_GPU_VIRTUAL_ADDRESS shaderResource);
|
||||
|
||||
void SetStencilRef(uint32_t stencilRef);
|
||||
void SetBlendFactor(const float blendFactor[4]);
|
||||
void SetDepthBias(float depthBias, float slopeScaledDepthBias, float depthBiasClamp);
|
||||
|
||||
@@ -189,6 +189,10 @@ void D3D12CommandList::SetDescriptorHeap(ID3D12DescriptorHeap* heap) {
|
||||
m_currentDescriptorHeap = heap;
|
||||
}
|
||||
|
||||
void D3D12CommandList::SetDescriptorHeaps(uint32_t count, ID3D12DescriptorHeap** heaps) {
|
||||
m_commandList->SetDescriptorHeaps(count, heaps);
|
||||
}
|
||||
|
||||
void D3D12CommandList::SetGraphicsDescriptorTable(uint32_t rootParameterIndex, D3D12_GPU_DESCRIPTOR_HANDLE baseHandle) {
|
||||
m_commandList->SetGraphicsRootDescriptorTable(rootParameterIndex, baseHandle);
|
||||
}
|
||||
@@ -197,6 +201,22 @@ void D3D12CommandList::SetComputeDescriptorTable(uint32_t rootParameterIndex, D3
|
||||
m_commandList->SetComputeRootDescriptorTable(rootParameterIndex, baseHandle);
|
||||
}
|
||||
|
||||
void D3D12CommandList::SetGraphicsRootConstantBufferView(uint32_t rootParameterIndex, D3D12_GPU_VIRTUAL_ADDRESS bufferLocation) {
|
||||
m_commandList->SetGraphicsRootConstantBufferView(rootParameterIndex, bufferLocation);
|
||||
}
|
||||
|
||||
void D3D12CommandList::SetGraphicsRoot32BitConstants(uint32_t rootParameterIndex, uint32_t num32BitValuesToSet, const void* pSrcData, uint32_t destOffsetIn32BitValues) {
|
||||
m_commandList->SetGraphicsRoot32BitConstants(rootParameterIndex, num32BitValuesToSet, pSrcData, destOffsetIn32BitValues);
|
||||
}
|
||||
|
||||
void D3D12CommandList::SetGraphicsRootDescriptorTable(uint32_t rootParameterIndex, D3D12_GPU_DESCRIPTOR_HANDLE baseDescriptor) {
|
||||
m_commandList->SetGraphicsRootDescriptorTable(rootParameterIndex, baseDescriptor);
|
||||
}
|
||||
|
||||
void D3D12CommandList::SetGraphicsRootShaderResourceView(uint32_t rootParameterIndex, D3D12_GPU_VIRTUAL_ADDRESS shaderResource) {
|
||||
m_commandList->SetGraphicsRootShaderResourceView(rootParameterIndex, shaderResource);
|
||||
}
|
||||
|
||||
void D3D12CommandList::SetStencilRef(uint32_t stencilRef) {
|
||||
m_commandList->OMSetStencilRef(stencilRef);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user