Nameless Engine
Loading...
Searching...
No Matches
GpuResource.h
1#pragma once
2
3// Standard.
4#include <optional>
5#include <string>
6#include <memory>
7
8// Custom.
9#include "misc/Error.h"
10
11namespace ne {
12 class GpuResourceManager;
13 class GlobalShaderResourceBinding;
14
17 // Bindings will assign their pointers to resources.
18 friend class GlobalShaderResourceBinding;
19
20 public:
21 GpuResource() = delete;
22
35 const std::string& sResourceName,
36 unsigned int iElementSizeInBytes,
37 unsigned int iElementCount);
38
39 virtual ~GpuResource();
40
41 GpuResource(GpuResource&) = delete;
42 GpuResource& operator=(GpuResource&) = delete;
43
49 std::string getResourceName() const;
50
59 unsigned int getElementSizeInBytes() const;
60
69 unsigned int getElementCount() const;
70
77
78 private:
85 std::shared_ptr<GlobalShaderResourceBinding> pGlobalShaderResourceBinding;
86
88 GpuResourceManager* const pManager = nullptr;
89
91 const unsigned int iElementSizeInBytes = 0;
92
94 const unsigned int iElementCount = 0;
95
97 const std::string sResourceName;
98 };
99} // namespace ne
Definition: GlobalShaderResourceBinding.h:27
Definition: GpuResourceManager.h:43
Definition: GpuResource.h:16
const std::string sResourceName
Definition: GpuResource.h:97
unsigned int getElementSizeInBytes() const
Definition: GpuResource.cpp:32
unsigned int getElementCount() const
Definition: GpuResource.cpp:34
std::string getResourceName() const
Definition: GpuResource.cpp:30
std::shared_ptr< GlobalShaderResourceBinding > pGlobalShaderResourceBinding
Definition: GpuResource.h:85
GpuResourceManager *const pManager
Definition: GpuResource.h:88
GpuResourceManager * getResourceManager() const
Definition: GpuResource.cpp:36
const unsigned int iElementCount
Definition: GpuResource.h:94
const unsigned int iElementSizeInBytes
Definition: GpuResource.h:91