1
0
Fork 0
mirror of https://github.com/bjornbytes/lovr.git synced 2024-07-04 13:33:34 +00:00

webgpu: device;

This commit is contained in:
bjorn 2022-12-02 23:17:32 -08:00
parent 15d27fc91f
commit d66b1e7ec8

View file

@ -1,10 +1,18 @@
#include "gpu.h"
#include <webgpu/webgpu.h>
#include <emscripten/html5_webgpu.h>
#include <string.h>
static struct {
WGPUDevice device;
} state;
bool gpu_init(gpu_config* config) {
return false;
state.device = emscripten_webgpu_get_device();
return !!state.device;
}
void gpu_destroy(void) {
//
if (state.device) wgpuDeviceDestroy(state.device);
memset(&state, 0, sizeof(state));
}