Add RHI texture upload and descriptor set fixes
This commit is contained in:
@@ -51,6 +51,7 @@ private:
|
||||
DescriptorHeapType m_type;
|
||||
uint32_t m_numDescriptors;
|
||||
uint32_t m_descriptorSize;
|
||||
uint32_t m_nextFreeOffset;
|
||||
bool m_shaderVisible;
|
||||
std::vector<D3D12DescriptorSet*> m_allocatedSets;
|
||||
};
|
||||
|
||||
@@ -65,6 +65,7 @@ public:
|
||||
|
||||
RHIBuffer* CreateBuffer(const BufferDesc& desc) override;
|
||||
RHITexture* CreateTexture(const TextureDesc& desc) override;
|
||||
RHITexture* CreateTexture(const TextureDesc& desc, const void* initialData, size_t initialDataSize, uint32_t rowPitch = 0) override;
|
||||
RHISwapChain* CreateSwapChain(const SwapChainDesc& desc, RHICommandQueue* presentQueue) override;
|
||||
RHICommandList* CreateCommandList(const CommandListDesc& desc) override;
|
||||
RHICommandQueue* CreateCommandQueue(const CommandQueueDesc& desc) override;
|
||||
|
||||
@@ -20,7 +20,7 @@ public:
|
||||
bool Initialize(ID3D12Device* device, const D3D12_RESOURCE_DESC& desc, D3D12_RESOURCE_STATES initialState = D3D12_RESOURCE_STATE_COMMON);
|
||||
bool InitializeFromExisting(ID3D12Resource* resource, bool ownsResource = false);
|
||||
bool InitializeFromData(ID3D12Device* device, ID3D12GraphicsCommandList* commandList,
|
||||
const void* pixelData, uint32_t width, uint32_t height, DXGI_FORMAT format);
|
||||
const void* pixelData, uint32_t width, uint32_t height, DXGI_FORMAT format, uint32_t rowPitch = 0);
|
||||
bool InitializeDepthStencil(ID3D12Device* device, uint32_t width, uint32_t height, DXGI_FORMAT format = DXGI_FORMAT_D24_UNORM_S8_UINT);
|
||||
void Shutdown() override;
|
||||
|
||||
|
||||
@@ -46,6 +46,9 @@ public:
|
||||
uint32_t GetBindingPoint(uint32_t binding) const;
|
||||
|
||||
private:
|
||||
DescriptorBinding* FindBinding(uint32_t binding);
|
||||
const DescriptorBinding* FindBinding(uint32_t binding) const;
|
||||
|
||||
OpenGLTextureUnitAllocator* m_allocator;
|
||||
std::vector<DescriptorBinding> m_bindings;
|
||||
DescriptorSetLayoutBinding* m_layoutBindings;
|
||||
@@ -57,4 +60,4 @@ private:
|
||||
};
|
||||
|
||||
} // namespace RHI
|
||||
} // namespace XCEngine
|
||||
} // namespace XCEngine
|
||||
|
||||
@@ -36,6 +36,7 @@ public:
|
||||
|
||||
RHIBuffer* CreateBuffer(const BufferDesc& desc) override;
|
||||
RHITexture* CreateTexture(const TextureDesc& desc) override;
|
||||
RHITexture* CreateTexture(const TextureDesc& desc, const void* initialData, size_t initialDataSize, uint32_t rowPitch = 0) override;
|
||||
RHISwapChain* CreateSwapChain(const SwapChainDesc& desc, RHICommandQueue* presentQueue) override;
|
||||
RHICommandList* CreateCommandList(const CommandListDesc& desc) override;
|
||||
RHICommandQueue* CreateCommandQueue(const CommandQueueDesc& desc) override;
|
||||
|
||||
@@ -34,6 +34,7 @@ public:
|
||||
|
||||
virtual RHIBuffer* CreateBuffer(const BufferDesc& desc) = 0;
|
||||
virtual RHITexture* CreateTexture(const TextureDesc& desc) = 0;
|
||||
virtual RHITexture* CreateTexture(const TextureDesc& desc, const void* initialData, size_t initialDataSize, uint32_t rowPitch = 0) = 0;
|
||||
virtual RHISwapChain* CreateSwapChain(const SwapChainDesc& desc, RHICommandQueue* presentQueue) = 0;
|
||||
virtual RHICommandList* CreateCommandList(const CommandListDesc& desc) = 0;
|
||||
virtual RHICommandQueue* CreateCommandQueue(const CommandQueueDesc& desc) = 0;
|
||||
|
||||
Reference in New Issue
Block a user