CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
MTBuffer.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 "Metal.hpp"
11
13
15
16namespace CeresEngine {
17
19
21 class MTBuffer : public GPUBuffer, public MTDeviceObject<MTBuffer, GPUBuffer> {
22 public:
24
25 private:
28
31
32 public:
37
39 ~MTBuffer() 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
#define CE_MT_HANDLE(T)
Definition Metal.hpp:20
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
Metal RenderAPI buffer object.
Definition MTBuffer.hpp:21
void flush(GPUBufferSize offset=0, GPUBufferSize size=whole) final
~MTBuffer() override
Destroys the buffer object and releases the GPU memory.
void invalidate(GPUBufferSize offset=0, GPUBufferSize size=whole) final
void * MTLBufferType
Definition MTBuffer.hpp:23
GPUBufferData map() final
MTBuffer(MTDevicePtr device, const GPUBufferDescriptor &descriptor)
Creates a new Metal buffer object.
MTLBufferType mBuffer
The Metal API buffer object.
Definition MTBuffer.hpp:30
const GPUBufferDescriptor mDescriptor
A structure that describes the buffer and it's properties.
Definition MTBuffer.hpp:27
GPUBufferSize getSize() const final
Definition Metal.hpp:124
const Descriptor & descriptor
A structure that describes the object and it's properties.
Definition Common.hpp:69
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