| 1457 | } |
| 1458 | |
| 1459 | static HContext WebGPUNewContext(const ContextParams& params) |
| 1460 | { |
| 1461 | #if defined(DM_GRAPHICS_WEBGPU_WAGYU) |
| 1462 | // Making sure we're keeping track of the webgpu.h verssions |
| 1463 | DM_STATIC_ASSERT(WGPUTextureFormat_RG16Snorm == 0x12, Invalid_webgpu_header); |
| 1464 | #endif |
| 1465 | |
| 1466 | TRACE_CALL; |
| 1467 | if (!g_WebGPUContext) |
| 1468 | { |
| 1469 | g_WebGPUContext = (WebGPUContext*)malloc(sizeof(WebGPUContext)); |
| 1470 | memset(g_WebGPUContext, 0, sizeof(*g_WebGPUContext)); |
| 1471 | if (InitializeWebGPUContext(g_WebGPUContext, params)) |
| 1472 | return (HContext) g_WebGPUContext; |
| 1473 | DeleteContext((HContext) g_WebGPUContext); |
| 1474 | } |
| 1475 | return NULL; |
| 1476 | } |
| 1477 | |
| 1478 | static bool WebGPUIsSupported() |
| 1479 | { |
nothing calls this directly
no test coverage detected