CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
WGBuffer.hpp
Go to the documentation of this file.
1//
2// CeresEngine - A game development framework
3//
4// Created by Rogiel Sulzbach.
5// Copyright (c) 2018-2022 Rogiel Sulzbach. All rights reserved.
6//
7
8#pragma once
9
10#include "WebGPU.hpp"
11
13
15
16namespace CeresEngine {
17
19
21 class WGBuffer : public GPUBuffer, public WGDeviceObject<WGBuffer, GPUBuffer> {
22 public:
24
25 private:
28
31
32 public:
37
39 ~WGBuffer() override;
40
43
44 public:
47
49 void unmap() final;
50
53
55 void flush(GPUBufferSize offset = 0, GPUBufferSize size = whole) final;
56
59 };
60
61} // namespace CeresEngine
#define CE_EXPLICIT_FALSE
Definition Macros.hpp:416
A retain-release type of smart pointer.
Definition SmartPtr.hpp:132
Definition GPUBuffer.hpp:124
static const constexpr GPUBufferSize whole
A constant the represents the whole buffer length.
Definition GPUBuffer.hpp:127
GPUDevice & device
The owning device this object was created from.
Definition Common.hpp:55
const Descriptor & descriptor
A structure that describes the object and it's properties.
Definition Common.hpp:69
WebGPU RenderAPI buffer object.
Definition WGBuffer.hpp:21
void flush(GPUBufferSize offset=0, GPUBufferSize size=whole) final
const GPUBufferDescriptor mDescriptor
A structure that describes the buffer and it's properties.
Definition WGBuffer.hpp:27
void invalidate(GPUBufferSize offset=0, GPUBufferSize size=whole) final
GPUBufferSize getSize() const final
GPUBufferData map() final
CE_WG_HANDLE(WGLBuffer) WGLBufferType
Definition WGBuffer.hpp:23
WGBuffer(WGDevicePtr device, const GPUBufferDescriptor &descriptor)
Creates a new WebGPU buffer object.
~WGBuffer() override
Destroys the buffer object and releases the GPU memory.
WGLBufferType mBuffer
The WebGPU API buffer object.
Definition WGBuffer.hpp:30
Definition WebGPU.hpp:119
Definition Application.hpp:19
GPUMemoryData GPUBufferData
A pointer type that represents the buffer raw data.
Definition GPUBuffer.hpp:89
GPUMemorySize GPUBufferSize
A type that represents a buffer size.
Definition GPUBuffer.hpp:86
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25
Hardware buffer descriptor structure.
Definition GPUBuffer.hpp:92