Add GPUDevice::CreateConstantBuffer for custom constants buffers usage
This commit is contained in:
@@ -2045,6 +2045,11 @@ GPUSwapChain* GPUDeviceVulkan::CreateSwapChain(Window* window)
|
||||
return New<GPUSwapChainVulkan>(this, window);
|
||||
}
|
||||
|
||||
GPUConstantBuffer* GPUDeviceVulkan::CreateConstantBuffer(uint32 size, const StringView& name)
|
||||
{
|
||||
return New<GPUConstantBufferVulkan>(this, size);
|
||||
}
|
||||
|
||||
SemaphoreVulkan::SemaphoreVulkan(GPUDeviceVulkan* device)
|
||||
: _device(device)
|
||||
{
|
||||
|
||||
@@ -708,6 +708,7 @@ public:
|
||||
GPUBuffer* CreateBuffer(const StringView& name) override;
|
||||
GPUSampler* CreateSampler() override;
|
||||
GPUSwapChain* CreateSwapChain(Window* window) override;
|
||||
GPUConstantBuffer* CreateConstantBuffer(uint32 size, const StringView& name) override;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -234,16 +234,4 @@ GPUShaderProgram* GPUShaderVulkan::CreateGPUShaderProgram(ShaderStage type, cons
|
||||
return shader;
|
||||
}
|
||||
|
||||
GPUConstantBuffer* GPUShaderVulkan::CreateCB(const String& name, uint32 size, MemoryReadStream& stream)
|
||||
{
|
||||
return new(_cbs) GPUConstantBufferVulkan(_device, size);
|
||||
}
|
||||
|
||||
void GPUShaderVulkan::OnReleaseGPU()
|
||||
{
|
||||
_cbs.Clear();
|
||||
|
||||
GPUShader::OnReleaseGPU();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -126,10 +126,6 @@ public:
|
||||
/// </summary>
|
||||
class GPUShaderVulkan : public GPUResourceVulkan<GPUShader>
|
||||
{
|
||||
private:
|
||||
|
||||
Array<GPUConstantBufferVulkan, FixedAllocation<MAX_CONSTANT_BUFFER_SLOTS>> _cbs;
|
||||
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
@@ -146,8 +142,6 @@ protected:
|
||||
|
||||
// [GPUShader]
|
||||
GPUShaderProgram* CreateGPUShaderProgram(ShaderStage type, const GPUShaderProgramInitializer& initializer, byte* cacheBytes, uint32 cacheSize, MemoryReadStream& stream) override;
|
||||
GPUConstantBuffer* CreateCB(const String& name, uint32 size, MemoryReadStream& stream) override;
|
||||
void OnReleaseGPU() override;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user