From 32d26371627638570b74d678ab73deb7b87af8e4 Mon Sep 17 00:00:00 2001 From: skal Date: Sat, 31 Jan 2026 17:23:13 +0100 Subject: 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). --- src/gpu/gpu.cc | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/gpu/gpu.cc') 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 #include @@ -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 -- cgit v1.2.3