MCPcopy Create free account
hub / github.com/defold/defold / WebGPUNewContext

Function WebGPUNewContext

engine/graphics/src/webgpu/graphics_webgpu.cpp:1459–1476  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1457}
1458
1459static 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
1478static bool WebGPUIsSupported()
1479{

Callers

nothing calls this directly

Calls 3

mallocFunction · 0.85
InitializeWebGPUContextFunction · 0.85
DeleteContextFunction · 0.50

Tested by

no test coverage detected