From 13fcf984365a23145b83d1058ec2f1df493fd769 Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Fri, 11 Mar 2022 16:56:04 -0700 Subject: [PATCH] gpu: add Texture.Descriptor Signed-off-by: Stephen Gutekanst --- gpu/src/TODO | 11 ----------- gpu/src/Texture.zig | 11 +++++++++++ gpu/src/structs.zig | 2 ++ 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/gpu/src/TODO b/gpu/src/TODO index 42c89c50..3e24b5b8 100644 --- a/gpu/src/TODO +++ b/gpu/src/TODO @@ -57,17 +57,6 @@ typedef struct WGPUDawnTogglesDeviceDescriptor { -typedef struct WGPUTextureDescriptor { - WGPUChainedStruct const * nextInChain; - char const * label; - WGPUTextureUsageFlags usage; - WGPUTextureDimension dimension; - WGPUExtent3D size; - WGPUTextureFormat format; - uint32_t mipLevelCount; - uint32_t sampleCount; -} WGPUTextureDescriptor; - typedef struct WGPUBindGroupLayoutDescriptor { WGPUChainedStruct const * nextInChain; char const * label; diff --git a/gpu/src/Texture.zig b/gpu/src/Texture.zig index 5e97e6c0..6f79c268 100644 --- a/gpu/src/Texture.zig +++ b/gpu/src/Texture.zig @@ -32,6 +32,16 @@ pub inline fn destroy(texture: Texture) void { texture.vtable.destroy(texture.ptr); } +pub const Descriptor = struct { + label: ?[*:0]const u8 = null, + usage: Usage, + dimension: Dimension, + size: Extent3D, + format: Format, + mip_level_count: u32, + sample_count: u32, +}; + pub const Usage = enum(u32) { none = 0x00000000, copy_src = 0x00000001, @@ -189,6 +199,7 @@ test "syntax" { _ = reference; _ = release; _ = destroy; + _ = Descriptor; _ = Usage; _ = Format; _ = Aspect; diff --git a/gpu/src/structs.zig b/gpu/src/structs.zig index 291895f5..24992d37 100644 --- a/gpu/src/structs.zig +++ b/gpu/src/structs.zig @@ -4,6 +4,7 @@ const Sampler = @import("Sampler.zig"); const Texture = @import("Texture.zig"); const TextureView = @import("TextureView.zig"); const ShaderModule = @import("ShaderModule.zig"); +const QuerySet = @import("QuerySet.zig"); const StencilFaceState = @import("data.zig").StencilFaceState; const CompilationMessageType = @import("enums.zig").CompilationMessageType; const PrimitiveTopology = @import("enums.zig").PrimitiveTopology; @@ -12,6 +13,7 @@ const FrontFace = @import("enums.zig").FrontFace; const CullMode = @import("enums.zig").CullMode; const StorageTextureAccess = @import("enums.zig").StorageTextureAccess; const CompareFunction = @import("enums.zig").CompareFunction; +const ComputePassTimestampLocation = @import("enums.zig").ComputePassTimestampLocation; pub const CompilationMessage = struct { message: [:0]const u8,