From c045ce7caa7612b06a82d62db804237bbbf4d647 Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Fri, 11 Mar 2022 17:40:07 -0700 Subject: [PATCH] gpu: add constants Signed-off-by: Stephen Gutekanst --- gpu/src/TODO | 23 ----------------------- gpu/src/main.zig | 10 ++++++++++ 2 files changed, 10 insertions(+), 23 deletions(-) diff --git a/gpu/src/TODO b/gpu/src/TODO index ef135ac6..4f223139 100644 --- a/gpu/src/TODO +++ b/gpu/src/TODO @@ -1,26 +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 WGPUChainedStruct { - struct WGPUChainedStruct const * next; - WGPUSType sType; -} WGPUChainedStruct; - -typedef struct WGPUChainedStructOut { - struct WGPUChainedStructOut * next; - WGPUSType sType; -} WGPUChainedStructOut; - - - // TODO: Dawn specific typedef struct WGPUDawnCacheDeviceDescriptor { WGPUChainedStruct chain; diff --git a/gpu/src/main.zig b/gpu/src/main.zig index 8d82ccd0..462de8a6 100644 --- a/gpu/src/main.zig +++ b/gpu/src/main.zig @@ -142,6 +142,16 @@ pub const ColorWriteMask = @import("enums.zig").ColorWriteMask; pub const MapMode = @import("enums.zig").MapMode; pub const ShaderStage = @import("enums.zig").ShaderStage; +// Constants +const array_layer_count_undefined: u32 = 0xffffffff; +const copy_stride_undefined: u32 = 0xffffffff; +const limit_u32_undefined: u32 = 0xffffffff; +const limit_u64_undefined: u32 = 0xffffffffffffffff; +const mip_level_count_undefined: u32 = 0xffffffff; +const stride_undefined: u32 = 0xffffffff; +const whole_map_size: u32 = std.math.maxInt(c_int); +const whole_size: u64 = 0xffffffffffffffff; + test "syntax" { // Root interface/implementations _ = Interface;