feat(RHI): 在 RHIBuffer 基类中添加资源状态接口

- 添加 GetState() 和 SetState() 纯虚函数到 RHIBuffer 抽象基类
- D3D12Buffer 已有实现,现在通过基类接口可用
- OpenGLBuffer 添加空实现(OpenGL 无资源状态概念)
This commit is contained in:
2026-03-18 02:34:17 +08:00
parent 60c8461be3
commit 65ce9c84c6
2 changed files with 6 additions and 0 deletions

View File

@@ -51,6 +51,9 @@ public:
void* GetNativeHandle() override { return reinterpret_cast<void*>(static_cast<uintptr_t>(m_buffer)); } void* GetNativeHandle() override { return reinterpret_cast<void*>(static_cast<uintptr_t>(m_buffer)); }
ResourceStates GetState() const override { return ResourceStates::Common; }
void SetState(ResourceStates state) override { }
const std::string& GetName() const override { return m_name; } const std::string& GetName() const override { return m_name; }
void SetName(const std::string& name) override { m_name = name; } void SetName(const std::string& name) override { m_name = name; }

View File

@@ -23,6 +23,9 @@ public:
virtual void* GetNativeHandle() = 0; virtual void* GetNativeHandle() = 0;
virtual ResourceStates GetState() const = 0;
virtual void SetState(ResourceStates state) = 0;
virtual const std::string& GetName() const = 0; virtual const std::string& GetName() const = 0;
virtual void SetName(const std::string& name) = 0; virtual void SetName(const std::string& name) = 0;