| 35 | /// </summary> |
| 36 | template<typename T = GPUResource> |
| 37 | class GPUResourceProperty : public GPUResourcePropertyBase |
| 38 | { |
| 39 | public: |
| 40 | /// <summary> |
| 41 | /// Initializes a new instance of the <see cref="GPUResourceProperty"/> class. |
| 42 | /// </summary> |
| 43 | GPUResourceProperty() |
| 44 | { |
| 45 | } |
| 46 | |
| 47 | /// <summary> |
| 48 | /// Initializes a new instance of the <see cref="GPUResourceProperty"/> class. |
| 49 | /// </summary> |
| 50 | /// <param name="resource">The resource.</param> |
| 51 | GPUResourceProperty(T* resource) |
| 52 | { |
| 53 | OnSet(resource); |
| 54 | } |
| 55 | |
| 56 | /// <summary> |
| 57 | /// Initializes a new instance of the <see cref="GPUResourceProperty"/> class. |
| 58 | /// </summary> |
| 59 | /// <param name="other">The other value.</param> |
| 60 | GPUResourceProperty(const GPUResourceProperty& other) |
| 61 | { |
| 62 | OnSet(other.Get()); |
| 63 | } |
| 64 | |
| 65 | /// <summary> |
| 66 | /// Initializes a new instance of the <see cref="GPUResourceProperty"/> class. |
| 67 | /// </summary> |
| 68 | /// <param name="other">The other value.</param> |
| 69 | GPUResourceProperty(GPUResourceProperty&& other) |
| 70 | { |
| 71 | OnSet(other.Get()); |
| 72 | other.OnSet(nullptr); |
| 73 | } |
| 74 | |
| 75 | GPUResourceProperty& operator=(GPUResourceProperty&& other) |
| 76 | { |
| 77 | if (&other != this) |
| 78 | { |
| 79 | OnSet(other._resource); |
| 80 | other.OnSet(nullptr); |
| 81 | } |
| 82 | return *this; |
| 83 | } |
| 84 | |
| 85 | /// <summary> |
| 86 | /// Finalizes an instance of the <see cref="GPUResourceProperty"/> class. |
| 87 | /// </summary> |
| 88 | ~GPUResourceProperty() |
| 89 | { |
| 90 | } |
| 91 | |
| 92 | public: |
| 93 | FORCE_INLINE bool operator==(T* other) const |
| 94 | { |