Add GPU data upload allocator with shared page pool

This commit is contained in:
Wojtek Figat
2026-02-24 23:18:07 +01:00
parent e41ec4ebfd
commit 9d95bbaa8c
6 changed files with 147 additions and 44 deletions

View File

@@ -10,26 +10,10 @@
#include "Engine/GraphicsDevice/Vulkan/Types.h"
#include "Engine/Serialization/MemoryReadStream.h"
GPUConstantBufferWebGPU::GPUConstantBufferWebGPU(GPUDeviceWebGPU* device, uint32 size, WGPUBuffer buffer, const StringView& name) noexcept
GPUConstantBufferWebGPU::GPUConstantBufferWebGPU(GPUDeviceWebGPU* device, uint32 size, const StringView& name) noexcept
: GPUResourceWebGPU(device, name)
{
_size = _memoryUsage = size;
Buffer = buffer;
}
GPUConstantBufferWebGPU::~GPUConstantBufferWebGPU()
{
if (Buffer)
wgpuBufferRelease(Buffer);
}
void GPUConstantBufferWebGPU::OnReleaseGPU()
{
if (Buffer)
{
wgpuBufferRelease(Buffer);
Buffer = nullptr;
}
}
GPUShaderProgram* GPUShaderWebGPU::CreateGPUShaderProgram(ShaderStage type, const GPUShaderProgramInitializer& initializer, Span<byte> bytecode, MemoryReadStream& stream)