From ed1232f59db4ec6c5a948548416e5dd2a7d1227e Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Sat, 16 Jul 2022 20:54:45 -0700 Subject: [PATCH] gpu: add Texture.Descriptor Signed-off-by: Stephen Gutekanst --- gpu/TODO-webgpu.h | 13 ------------- gpu/src/texture.zig | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/gpu/TODO-webgpu.h b/gpu/TODO-webgpu.h index f58509e1..24b86407 100644 --- a/gpu/TODO-webgpu.h +++ b/gpu/TODO-webgpu.h @@ -1,16 +1,3 @@ -pub const WGPUTextureDescriptor = extern struct { - next_in_chain: *const ChainedStruct, - label: ?[*:0]const u8 = null, - usage: TextureUsageFlags, - dimension: TextureDimension, - size: Extent3D, - format: TextureFormat, - mip_level_count: u32, - sample_count: u32, - view_format_count: u32, - view_formats: [*]const TextureFormat, -}; - pub const VertexBufferLayout = extern struct { array_stride: u64, step_mode: VertexStepMode, diff --git a/gpu/src/texture.zig b/gpu/src/texture.zig index 8b10c8d2..7634250f 100644 --- a/gpu/src/texture.zig +++ b/gpu/src/texture.zig @@ -1,6 +1,7 @@ const std = @import("std"); const ChainedStruct = @import("types.zig").ChainedStruct; const TextureView = @import("texture_view.zig").TextureView; +const Extent3D = @import("types.zig").Extent3D; pub const Texture = enum(usize) { _, @@ -174,4 +175,17 @@ pub const Texture = enum(usize) { bytes_per_row: u32, rows_per_image: u32, }; + + pub const Descriptor = extern struct { + next_in_chain: *const ChainedStruct, + label: ?[*:0]const u8 = null, + usage: UsageFlags, + dimension: Dimension, + size: Extent3D, + format: Format, + mip_level_count: u32, + sample_count: u32, + view_format_count: u32, + view_formats: [*]const Format, + }; };