From 32a26d8f12da5cf21533dcac4b89ea01f35cc062 Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Sun, 10 Jul 2022 19:53:34 -0700 Subject: [PATCH] gpu: translate constants Signed-off-by: Stephen Gutekanst --- gpu/TODO-webgpu.h | 9 --------- gpu/src/main.zig | 10 ++++++++++ 2 files changed, 10 insertions(+), 9 deletions(-) create mode 100644 gpu/src/main.zig diff --git a/gpu/TODO-webgpu.h b/gpu/TODO-webgpu.h index 54f4d694..34a95cc9 100644 --- a/gpu/TODO-webgpu.h +++ b/gpu/TODO-webgpu.h @@ -1,12 +1,3 @@ -#define WGPU_ARRAY_LAYER_COUNT_UNDEFINED (0xffffffffUL) -#define WGPU_COPY_STRIDE_UNDEFINED (0xffffffffUL) -#define WGPU_LIMIT_U32_UNDEFINED (0xffffffffUL) -#define WGPU_LIMIT_U64_UNDEFINED (0xffffffffffffffffULL) -#define WGPU_MIP_LEVEL_COUNT_UNDEFINED (0xffffffffUL) -#define WGPU_STRIDE_UNDEFINED (0xffffffffUL) -#define WGPU_WHOLE_MAP_SIZE SIZE_MAX -#define WGPU_WHOLE_SIZE (0xffffffffffffffffULL) - typedef uint32_t WGPUFlags; typedef struct WGPUAdapterImpl* WGPUAdapter; diff --git a/gpu/src/main.zig b/gpu/src/main.zig new file mode 100644 index 00000000..94e2c133 --- /dev/null +++ b/gpu/src/main.zig @@ -0,0 +1,10 @@ +const std = @import("std"); + +pub const array_layer_count_undefined = 0xffffffff; +pub const copy_stride_undefined = 0xffffffff; +pub const limit_u32_undefined = 0xffffffff; +pub const limit_u64_undefined = 0xffffffffffffffff; +pub const mip_level_count_undefined = 0xffffffff; +pub const stride_undefined = 0xffffffff; +pub const whole_map_size = std.math.maxInt(usize); +pub const whole_size = 0xffffffffffffffff;