RavEngine
Loading...
Searching...
No Matches
WGBuffer.hpp
1#pragma once
2#include <RGL/Types.hpp>
3#include <RGL/Buffer.hpp>
4#include <memory>
5#include <emscripten/html5_webgpu.h>
6
7namespace RGL{
8 struct DeviceWG;
9 struct BufferWG : public IBuffer{
10 WGPUBuffer buffer = nullptr;
11 const std::shared_ptr<DeviceWG> owningDevice;
12 MutableSpan data;
13 uint32_t stride = 0;
14 uint32_t mode;
15 BufferWG(decltype(owningDevice), const BufferConfig&);
16
17 //IBuffer
18 void MapMemory();
20 void UpdateBufferData(untyped_span newData, decltype(BufferConfig::nElements) offset = 0) ;
21 void SetBufferData(untyped_span data, decltype(BufferConfig::nElements) offset = 0) ;
22 decltype(BufferConfig::nElements) getBufferSize() const final;
23 void* GetMappedDataPtr() final;
24
25 void SignalRangeChanged(const Range&) final;
26 virtual ~BufferWG();
27 };
28}
Definition Span.hpp:11
Definition Buffer.hpp:21
Definition WGBuffer.hpp:9
void UnmapMemory()
void UpdateBufferData(untyped_span newData, decltype(BufferConfig::nElements) offset=0)
void SetBufferData(untyped_span data, decltype(BufferConfig::nElements) offset=0)
void MapMemory()
Definition Buffer.hpp:50
Definition Span.hpp:6
Definition Buffer.hpp:45