Files
XCEngine/engine/include/XCEngine/RHI/RHIDescriptorPool.h
ssdfasd c6fe9547aa 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
2026-03-25 00:26:16 +08:00

37 lines
796 B
C++

#pragma once
#include "RHIEnums.h"
#include <cstdint>
namespace XCEngine {
namespace RHI {
class RHIDescriptorSet;
struct DescriptorSetLayoutDesc;
struct DescriptorPoolDesc {
void* device;
DescriptorHeapType type;
uint32_t descriptorCount;
bool shaderVisible;
};
class RHIDescriptorPool {
public:
virtual ~RHIDescriptorPool() = default;
virtual bool Initialize(const DescriptorPoolDesc& desc) = 0;
virtual void Shutdown() = 0;
virtual void* GetNativeHandle() = 0;
virtual uint32_t GetDescriptorCount() const = 0;
virtual DescriptorHeapType GetType() const = 0;
virtual RHIDescriptorSet* AllocateSet(const DescriptorSetLayoutDesc& layout) = 0;
virtual void FreeSet(RHIDescriptorSet* set) = 0;
};
} // namespace RHI
} // namespace XCEngine