- 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
39 lines
1.1 KiB
C++
39 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include <vector>
|
|
#include <cstdint>
|
|
|
|
#include "../RHIEnums.h"
|
|
#include "../RHIDescriptorPool.h"
|
|
|
|
namespace XCEngine {
|
|
namespace RHI {
|
|
|
|
class OpenGLTextureUnitAllocator;
|
|
|
|
class OpenGLDescriptorPool : public RHIDescriptorPool {
|
|
public:
|
|
OpenGLDescriptorPool();
|
|
~OpenGLDescriptorPool() override;
|
|
|
|
bool Initialize(const DescriptorPoolDesc& desc) override;
|
|
void Shutdown() override;
|
|
|
|
void* GetNativeHandle() override { return this; }
|
|
uint32_t GetDescriptorCount() const override { return m_maxSets; }
|
|
DescriptorHeapType GetType() const override { return m_type; }
|
|
|
|
RHIDescriptorSet* AllocateSet(const DescriptorSetLayoutDesc& layout) override;
|
|
void FreeSet(RHIDescriptorSet* set) override;
|
|
|
|
void SetTextureUnitAllocator(OpenGLTextureUnitAllocator* allocator) { m_textureUnitAllocator = allocator; }
|
|
|
|
private:
|
|
DescriptorHeapType m_type;
|
|
uint32_t m_maxSets;
|
|
std::vector<class OpenGLDescriptorSet*> m_allocatedSets;
|
|
class OpenGLTextureUnitAllocator* m_textureUnitAllocator;
|
|
};
|
|
|
|
} // namespace RHI
|
|
} // namespace XCEngine
|