| 144 | } |
| 145 | |
| 146 | CGPUDeviceId 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 | |
| 167 | void cgpu_query_video_memory_info(const CGPUDeviceId device, uint64_t* total, uint64_t* used_bytes) |
| 168 | { |
no outgoing calls