RHI: Add DescriptorSet abstraction for D3D12 and OpenGL backends

- Add RHIDescriptorSet base class with Update/UpdateSampler/GetNativeHandle
- Add RHIDescriptorPool with AllocateSet/FreeSet methods
- Add SetGraphicsDescriptorSets/SetComputeDescriptorSets to RHICommandList
- Implement D3D12DescriptorSet using descriptor heap allocation
- Implement OpenGLDescriptorSet using TextureUnitAllocator
- Add CreateDescriptorPool/CreateDescriptorSet factory methods to RHIDevice
- Fix unit test SetVertexBuffer -> SetVertexBuffers API
- Add SetVertexBuffer convenience method for D3D12 backward compatibility
- Update CMakeLists.txt with new source files
This commit is contained in:
2026-03-25 00:26:16 +08:00
parent c5c43ae7aa
commit c6fe9547aa
22 changed files with 688 additions and 1 deletions

View File

@@ -265,7 +265,8 @@ TEST_P(RHITestFixture, CommandList_SetVertexBuffer_WithResourceView) {
ASSERT_NE(cmdList, nullptr);
cmdList->Reset();
cmdList->SetVertexBuffer(0, static_cast<RHIResourceView*>(nullptr), 0);
RHIResourceView* buffer = nullptr;
cmdList->SetVertexBuffers(0, 1, &buffer, nullptr, nullptr);
cmdList->Close();
cmdList->Shutdown();