diff options
| author | skal <pascal.massimino@gmail.com> | 2026-01-31 18:15:01 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-01-31 18:15:01 +0100 |
| commit | 5c9286af850f9a3335d294c7c2e100104741b296 (patch) | |
| tree | b2efce19c426b38c9578b6268a3f8b86adbc8265 /src/gpu | |
| parent | 0e9cfeb5855939ae5542943805dec8619ecc3c2d (diff) | |
add testing for sequence
Diffstat (limited to 'src/gpu')
| -rw-r--r-- | src/gpu/gpu.h | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/src/gpu/gpu.h b/src/gpu/gpu.h index 8aa290a..ce233fa 100644 --- a/src/gpu/gpu.h +++ b/src/gpu/gpu.h @@ -9,37 +9,61 @@ #include <cstring> // For strlen #if defined(DEMO_CROSS_COMPILE_WIN32) + // Windows (MinGW) using wgpu-native v0.19.4.1 -#include <webgpu/webgpu.h> -#include <webgpu/wgpu.h> + +#include <webgpu/webgpu.h> // Reverted to angle brackets + +#include <webgpu/wgpu.h> // Reverted to angle brackets + using WGPUStringView = const char *; + static inline const char *str_view(const char *str) { return str; } + static inline const char *label_view(const char *str) { return str; } + #define WGPUSType_ShaderSourceWGSL WGPUSType_ShaderModuleWGSLDescriptor + using WGPUShaderSourceWGSL = WGPUShaderModuleWGSLDescriptor; + #else + // Native (macOS/Linux) using newer wgpu-native -#include <webgpu.h> -#include <wgpu.h> + +#include <webgpu.h> // Reverted to angle brackets + +#include <wgpu.h> // Reverted to angle brackets + static inline WGPUStringView str_view(const char *str) { + if (!str) return {nullptr, 0}; + return {str, strlen(str)}; } + static inline WGPUStringView label_view(const char *str) { + #ifndef STRIP_ALL + if (!str) return {nullptr, 0}; + return {str, strlen(str)}; + #else + (void)str; + return {nullptr, 0}; + #endif } + #endif struct GLFWwindow; |
