MCPcopy Create free account
hub / github.com/Ipotrick/Daxa / daxa_instance_create_device_2

Function daxa_instance_create_device_2

src/impl_instance.cpp:184–226  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

182}
183
184auto daxa_instance_create_device_2(daxa_Instance self, daxa_DeviceInfo2 const * info, daxa_Device * out_device) -> daxa_Result
185{
186 daxa_Result result = {};
187 *out_device = new daxa_ImplDevice{};
188 defer
189 {
190 if (result != DAXA_RESULT_SUCCESS)
191 {
192 delete *out_device;
193 }
194 };
195
196 auto device_i = info->physical_device_index;
197
198 if (device_i >= self->device_properties.size())
199 {
200 result = DAXA_RESULT_ERROR_INVALID_DEVICE_INDEX;
201 }
202 _DAXA_RETURN_IF_ERROR(result, result);
203
204 if (self->device_properties[device_i].missing_required_feature != DAXA_MISSING_REQUIRED_VK_FEATURE_NONE)
205 {
206 result = DAXA_RESULT_ERROR_DEVICE_NOT_SUPPORTED;
207 }
208 _DAXA_RETURN_IF_ERROR(result, result);
209
210 if ((info->explicit_features & self->device_properties[device_i].explicit_features) != info->explicit_features)
211 {
212 result = DAXA_RESULT_ERROR_FEATURE_NOT_PRESENT;
213 }
214 _DAXA_RETURN_IF_ERROR(result, result);
215
216 result = daxa_ImplDevice::create_2(
217 self,
218 *info,
219 self->device_internals[device_i],
220 self->device_properties[device_i],
221 *out_device);
222 _DAXA_RETURN_IF_ERROR(result, result);
223
224 self->inc_weak_refcnt();
225 return result;
226}
227
228auto daxa_instance_inc_refcnt(daxa_Instance self) -> u64
229{

Callers 2

create_device_2Method · 0.85
mainFunction · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected