summaryrefslogtreecommitdiff
path: root/src/gpu/gpu.cc
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-01-31 17:23:13 +0100
committerskal <pascal.massimino@gmail.com>2026-01-31 17:23:13 +0100
commit32d26371627638570b74d678ab73deb7b87af8e4 (patch)
tree3097b3678086ddaed7930a02e5c88464f1c7d03e /src/gpu/gpu.cc
parent7ec28a3f1d417cd5b5adead895a25e42035ef037 (diff)
fix: Cross-compilation and style compliance
Fixes seq_compiler build for Windows cross-compilation. Moves common WebGPU compatibility shims to gpu.h. Applies project-wide coding style via clang-format. Verified on both macOS (native) and Windows (cross-compile).
Diffstat (limited to 'src/gpu/gpu.cc')
-rw-r--r--src/gpu/gpu.cc16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/gpu/gpu.cc b/src/gpu/gpu.cc
index db79b9d..b9545bf 100644
--- a/src/gpu/gpu.cc
+++ b/src/gpu/gpu.cc
@@ -3,9 +3,9 @@
// Driven by audio peaks for synchronized visual effects.
#include "gpu.h"
-#include "platform.h"
#include "demo_effects.h"
#include "effect.h"
+#include "platform.h"
#include <GLFW/glfw3.h>
#include <math.h>
@@ -23,19 +23,21 @@
// --- WebGPU Headers & Compatibility ---
#if defined(DEMO_CROSS_COMPILE_WIN32)
// Renamed Types/Enums
-#define WGPUSType_ShaderSourceWGSL WGPUSType_ShaderModuleWGSLDescriptor
-using WGPUShaderSourceWGSL = WGPUShaderModuleWGSLDescriptor;
-#define WGPUSurfaceGetCurrentTextureStatus_SuccessOptimal WGPUSurfaceGetCurrentTextureStatus_Success
-#define WGPUSurfaceGetCurrentTextureStatus_SuccessSuboptimal WGPUSurfaceGetCurrentTextureStatus_Success
+#define WGPUSurfaceGetCurrentTextureStatus_SuccessOptimal \
+ WGPUSurfaceGetCurrentTextureStatus_Success
+#define WGPUSurfaceGetCurrentTextureStatus_SuccessSuboptimal \
+ WGPUSurfaceGetCurrentTextureStatus_Success
#define WGPUCallbackMode_WaitAnyOnly 0
-static void wgpuInstanceWaitAny(WGPUInstance instance, size_t, void *, uint64_t) {
+static void wgpuInstanceWaitAny(WGPUInstance instance, size_t, void *,
+ uint64_t) {
wgpuInstanceProcessEvents(instance);
}
static void set_error_callback(WGPUDevice device, WGPUErrorCallback callback) {
wgpuDeviceSetUncapturedErrorCallback(device, callback, nullptr);
}
#else
-static void set_error_callback(WGPUDevice device, WGPUUncapturedErrorCallback callback) {
+static void set_error_callback(WGPUDevice device,
+ WGPUUncapturedErrorCallback callback) {
// Handled in descriptor for new API.
}
#endif