@@ -106,10 +106,33 @@ struct asset_traits<asset::ICPUComputePipeline>
106
106
using lookup_t = const video_t *;
107
107
};
108
108
109
- /*
109
+
110
110
template <>
111
- struct asset_traits<asset::ICPUDescriptorSetLayout> { using GPUObjectType = IGPUDescriptorSetLayout; };
112
- */
111
+ struct asset_traits <asset::ICPURenderpass>
112
+ {
113
+ // the asset type
114
+ using asset_t = asset::ICPURenderpass;
115
+ // we don't need to descend during DFS into other assets
116
+ constexpr static inline bool HasChildren = false ;
117
+ // the video type
118
+ using video_t = IGPURenderpass;
119
+ // lookup type
120
+ using lookup_t = const video_t *;
121
+ };
122
+
123
+ template <>
124
+ struct asset_traits <asset::ICPUGraphicsPipeline>
125
+ {
126
+ // the asset type
127
+ using asset_t = asset::ICPUGraphicsPipeline;
128
+ // we reference a pipeline layout and a renderpass
129
+ constexpr static inline bool HasChildren = true ;
130
+ // the video type
131
+ using video_t = IGPUGraphicsPipeline;
132
+ // lookup type
133
+ using lookup_t = const video_t *;
134
+ };
135
+
113
136
114
137
template <>
115
138
struct asset_traits <asset::ICPUBuffer>
@@ -138,25 +161,81 @@ struct asset_traits<asset::ICPUBufferView>
138
161
};
139
162
140
163
141
- /*
142
164
template <>
143
- struct asset_traits<asset::ICPUImage> { using GPUObjectType = IGPUImage; };
165
+ struct asset_traits <asset::ICPUImage>
166
+ {
167
+ // the asset type
168
+ using asset_t = asset::ICPUImage;
169
+ // we don't need to descend during DFS into other assets
170
+ constexpr static inline bool HasChildren = false ;
171
+ // the video type
172
+ using video_t = IGPUImage;
173
+ // lookup type
174
+ using lookup_t = const video_t *;
175
+ };
144
176
145
177
template <>
146
- struct asset_traits<asset::ICPUImageView> { using GPUObjectType = IGPUImageView; };
147
- */
178
+ struct asset_traits <asset::ICPUImageView>
179
+ {
180
+ // the asset type
181
+ using asset_t = asset::ICPUImageView;
182
+ // depends on ICPUImage
183
+ constexpr static inline bool HasChildren = true ;
184
+ // the video type
185
+ using video_t = IGPUImageView;
186
+ // lookup type
187
+ using lookup_t = const video_t *;
188
+ };
189
+
190
+
191
+ template <>
192
+ struct asset_traits <asset::ICPUBottomLevelAccelerationStructure>
193
+ {
194
+ // the asset type
195
+ using asset_t = asset::ICPUBottomLevelAccelerationStructure;
196
+ // we don't need to descend during DFS into other assets
197
+ constexpr static inline bool HasChildren = true ;
198
+ // the video type
199
+ using video_t = IGPUImageView;
200
+ // lookup type
201
+ using lookup_t = const video_t *;
202
+ };
148
203
149
- /*
150
204
template <>
151
- struct asset_traits<asset::ICPUShader> { using GPUObjectType = IGPUShader; };
205
+ struct asset_traits <asset::ICPUTopLevelAccelerationStructure>
206
+ {
207
+ // the asset type
208
+ using asset_t = asset::ICPUTopLevelAccelerationStructure;
209
+ // depends on ICPUBottomLevelAccelerationStructure
210
+ constexpr static inline bool HasChildren = true ;
211
+ // the video type
212
+ using video_t = IGPUTopLevelAccelerationStructure;
213
+ // lookup type
214
+ using lookup_t = const video_t *;
215
+ };
216
+
152
217
153
218
template <>
154
- struct asset_traits<asset::ICPUDescriptorSet> { using GPUObjectType = IGPUDescriptorSet; };
219
+ struct asset_traits <asset::ICPUDescriptorSet>
220
+ {
221
+ // the asset type
222
+ using asset_t = asset::ICPUDescriptorSet;
223
+ // depends on a lot of `IDescriptor` ICPU... types
224
+ constexpr static inline bool HasChildren = true ;
225
+ // the video type
226
+ using video_t = IGPUDescriptorSet;
227
+ // lookup type
228
+ using lookup_t = const video_t *;
229
+ };
155
230
231
+
232
+ /* TODO
156
233
template<>
157
- struct asset_traits<asset::ICPUAccelerationStructure> { using GPUObjectType = IGPUAccelerationStructure; } ;
234
+ struct asset_traits<asset::ICPUFramebuffer> ;
158
235
*/
159
236
237
+ // Every other ICPU type not present in the list here is deprecated
238
+
160
239
161
240
// Slight wrapper to allow copyable smart pointers
162
241
template <asset::Asset AssetType>
0 commit comments