From f8a2507bdf8ce265b64a8964910037007e6949b6 Mon Sep 17 00:00:00 2001 From: ssdfasd <2156608475@qq.com> Date: Wed, 25 Mar 2026 00:26:47 +0800 Subject: [PATCH] docs: Update RHI_Design_Issues.md - mark Priority 1 DescriptorSet as completed --- RHI_Design_Issues.md | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/RHI_Design_Issues.md b/RHI_Design_Issues.md index 4aab683f..260ffa84 100644 --- a/RHI_Design_Issues.md +++ b/RHI_Design_Issues.md @@ -64,6 +64,48 @@ virtual void SetComputeDescriptorSets( --- +### 3.1.1 ✅ 已完成:DescriptorSet 抽象 + +**实现状态**:2026-03-25 已完成 + +**新增抽象**: +| 类名 | 说明 | +|------|------| +| `RHIDescriptorSet` | DescriptorSet 基类,含 Update/UpdateSampler/GetNativeHandle/GetBindingCount/GetBindings | +| `RHIDescriptorPool` | DescriptorPool 基类,含 AllocateSet/FreeSet | +| `D3D12DescriptorSet` | D3D12 实现,使用 DescriptorHeap 分配 | +| `D3D12DescriptorHeap` | 扩展支持 AllocateSet/FreeSet | +| `OpenGLDescriptorSet` | OpenGL 实现,使用 TextureUnitAllocator | +| `OpenGLDescriptorPool` | OpenGL 实现 | + +**RHICommandList 新增接口**: +```cpp +virtual void SetGraphicsDescriptorSets( + uint32_t firstSet, + uint32_t count, + RHIDescriptorSet** descriptorSets, + RHIPipelineLayout* pipelineLayout) = 0; + +virtual void SetComputeDescriptorSets( + uint32_t firstSet, + uint32_t count, + RHIDescriptorSet** descriptorSets, + RHIPipelineLayout* pipelineLayout) = 0; +``` + +**RHIDevice 新增工厂方法**: +```cpp +virtual RHIDescriptorPool* CreateDescriptorPool(const DescriptorPoolDesc& desc) = 0; +virtual RHIDescriptorSet* CreateDescriptorSet(RHIDescriptorPool* pool, const DescriptorSetDesc& desc) = 0; +``` + +**实现说明**: +- D3D12:使用 `D3D12DescriptorHeap` 的 GPU/CPU descriptor 分配 +- OpenGL:使用 `TextureUnitAllocator` 分配 texture unit +- 旧的 `SetUniform*/SetGlobal*` 仍保留,向后兼容 + +--- + ### 3.2 缺少显式 RenderPass **问题描述**:当前只有 `SetRenderTargets()`,没有 `BeginRenderPass()` / `EndRenderPass()`: @@ -463,7 +505,7 @@ class RHITexture : public RHIResource { ... }; | 优先级 | 问题 | 严重性 | 修复难度 | 状态 | |--------|------|--------|----------|------| -| 1 | 字符串查找 SetUniform 不符合 D3D12/Vulkan | 🔴 致命 | 高 | ❌ 未完成 | +| 1 | 字符串查找 SetUniform 不符合 D3D12/Vulkan | 🔴 致命 | 高 | ✅ 已完成 | | 2 | 缺少显式 RenderPass | 🔴 致命 | 高 | ✅ 已完成 | | 3 | 动态状态太多 | 🔴 高 | 高 | ❌ 未完成 | | 4 | ResourceView 类型不明确 | 🟡 中 | 中 | ✅ 基本完成 |