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
7
namespace
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
();
19
void
UnmapMemory
();
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
}
RGL::untyped_span
Definition
Span.hpp:11
RGL::BufferConfig
Definition
Buffer.hpp:21
RGL::BufferWG
Definition
WGBuffer.hpp:9
RGL::BufferWG::UnmapMemory
void UnmapMemory()
RGL::BufferWG::UpdateBufferData
void UpdateBufferData(untyped_span newData, decltype(BufferConfig::nElements) offset=0)
RGL::BufferWG::SetBufferData
void SetBufferData(untyped_span data, decltype(BufferConfig::nElements) offset=0)
RGL::BufferWG::MapMemory
void MapMemory()
RGL::IBuffer
Definition
Buffer.hpp:50
RGL::MutableSpan
Definition
Span.hpp:6
RGL::Range
Definition
Buffer.hpp:45
RavEngine
deps
RGL
src
WGBuffer.hpp
Generated by
1.9.8