Nameless Engine
Loading...
Searching...
No Matches
DirectXDescriptor.h
1#pragma once
2
3// Standard.
4#include <optional>
5
6// Custom.
7#include "DirectXDescriptorType.hpp"
8
9namespace ne {
10 class DirectXDescriptorHeap;
11 class ContinuousDirectXDescriptorRange;
12 class DirectXResource;
13
19 // We notify the heap about descriptor being no longer used in destructor.
20 friend class DirectXDescriptorHeap;
21
22 public:
23 DirectXDescriptor() = delete;
24
27
28 DirectXDescriptor(const DirectXDescriptor& other) = delete;
29 DirectXDescriptor& operator=(const DirectXDescriptor& other) = delete;
30
31 // Intentionally disable `move` because heap stores raw pointers to descriptors
32 // and wraps descriptors into unique ptr to provide move functionality.
33 DirectXDescriptor(DirectXDescriptor&& other) noexcept = delete;
34 DirectXDescriptor& operator=(DirectXDescriptor&& other) noexcept = delete;
35
43
49 inline DirectXDescriptorHeap* getDescriptorHeap() const { return pHeap; }
50
57
58 protected:
74 DirectXDescriptorType descriptorType,
77 std::optional<size_t> referencedCubemapFaceIndex,
79
80 private:
86
89
91 DirectXDescriptorHeap* const pHeap = nullptr;
92
98
100 const std::optional<size_t> referencedCubemapFaceIndex;
101
103 const DirectXDescriptorType descriptorType;
104 };
105} // namespace ne
Definition: DirectXDescriptorHeap.h:44
Definition: DirectXDescriptorHeap.h:198
Definition: DirectXDescriptor.h:18
DirectXResource * pResource
Definition: DirectXDescriptor.h:88
int getDescriptorOffsetInDescriptors() const
Definition: DirectXDescriptor.h:42
ContinuousDirectXDescriptorRange *const pRange
Definition: DirectXDescriptor.h:97
DirectXResource * getOwnerResource() const
Definition: DirectXDescriptor.cpp:32
DirectXDescriptorHeap * getDescriptorHeap() const
Definition: DirectXDescriptor.h:49
int iDescriptorOffsetInDescriptors
Definition: DirectXDescriptor.h:85
const std::optional< size_t > referencedCubemapFaceIndex
Definition: DirectXDescriptor.h:100
~DirectXDescriptor()
Definition: DirectXDescriptor.cpp:8
DirectXDescriptorHeap *const pHeap
Definition: DirectXDescriptor.h:91
const DirectXDescriptorType descriptorType
Definition: DirectXDescriptor.h:103
Definition: DirectXResource.h:32