MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / cgpu_create_device

Function cgpu_create_device

modules/engine/graphics/src/common/cgpu.c:146–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

144}
145
146CGPUDeviceId cgpu_create_device(CGPUAdapterId adapter, const CGPUDeviceDescriptor* desc)
147{
148 SkrCZoneN(zz, "CGPUCreateDevice", 1);
149
150 cgpu_assert(adapter != CGPU_NULLPTR && "fatal: call on NULL adapter!");
151 cgpu_assert(adapter->proc_table_cache->create_device && "create_device Proc Missing!");
152
153 CGPUDeviceId device = adapter->proc_table_cache->create_device(adapter, desc);
154 ((CGPUDevice*)device)->next_texture_id = 0;
155 // ++ proc_table_cache
156 if (device != CGPU_NULLPTR)
157 {
158 *(const CGPUProcTable**)&device->proc_table_cache = adapter->proc_table_cache;
159 }
160 // -- proc_table_cache
161
162 SkrCZoneEnd(zz);
163
164 return device;
165}
166
167void cgpu_query_video_memory_info(const CGPUDeviceId device, uint64_t* total, uint64_t* used_bytes)
168{

Callers 15

create_api_objectsMethod · 0.85
initMethod · 0.85
initializeFunction · 0.85
initializeFunction · 0.85
ComputeFuncFunction · 0.85
initializeFunction · 0.85
initializeFunction · 0.85
create_api_objectsMethod · 0.85
create_api_objectsMethod · 0.85
create_api_objectsFunction · 0.85
create_api_objectsFunction · 0.85
create_api_objectsMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_create_deviceFunction · 0.68