-
Notifications
You must be signed in to change notification settings - Fork 60
Expand file tree
/
Copy pathGPUCommandBuffer.h
More file actions
45 lines (30 loc) · 1.03 KB
/
GPUCommandBuffer.h
File metadata and controls
45 lines (30 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#pragma once
#include <string>
#include "Unions.h"
#include "RNFHybridObject.h"
#include "webgpu/webgpu_cpp.h"
namespace rnwgpu {
namespace m = margelo;
class GPUCommandBuffer : public m::HybridObject {
public:
explicit GPUCommandBuffer(wgpu::CommandBuffer instance, std::string label)
: HybridObject("GPUCommandBuffer"), _instance(instance), _label(label) {}
public:
std::string getBrand() { return _name; }
std::string getLabel() { return _label; }
void setLabel(const std::string &label) {
_label = label;
_instance.SetLabel(_label.c_str());
}
void loadHybridMethods() override {
registerHybridGetter("__brand", &GPUCommandBuffer::getBrand, this);
registerHybridGetter("label", &GPUCommandBuffer::getLabel, this);
registerHybridSetter("label", &GPUCommandBuffer::setLabel, this);
}
inline const wgpu::CommandBuffer get() { return _instance; }
size_t getMemoryPressure() override { return 1024 * 1024; }
private:
wgpu::CommandBuffer _instance;
std::string _label;
};
} // namespace rnwgpu