D3D12: Implement ClearRenderTarget by tracking bound RTV handles

- Add m_boundRenderTargets and m_boundDepthStencil members to D3D12CommandList
- SetRenderTargetsHandle now saves bound RTV handles for later clear operations
- ClearRenderTargetView(ID3D12Resource*, ...) clears all bound render targets
- Reset() clears bound targets list
- Follows D3D12 best practice: RTV is bound via OMSetRenderTargets, then cleared
This commit is contained in:
2026-03-24 00:16:57 +08:00
parent 5811967679
commit c700e536c5
2 changed files with 21 additions and 0 deletions

View File

@@ -118,6 +118,10 @@ private:
ID3D12PipelineState* m_currentPipelineState;
ID3D12RootSignature* m_currentRootSignature;
ID3D12DescriptorHeap* m_currentDescriptorHeap;
std::vector<D3D12_CPU_DESCRIPTOR_HANDLE> m_boundRenderTargets;
D3D12_CPU_DESCRIPTOR_HANDLE m_boundDepthStencil;
bool m_depthStencilBound = false;
};
} // namespace RHI