From 2e9ef6447908373cccc8baf4f786caed281cf6a7 Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Sat, 16 Jul 2022 20:27:21 -0700 Subject: [PATCH] gpu: add TextureView.Descriptor Signed-off-by: Stephen Gutekanst --- gpu/TODO-webgpu.h | 12 ------------ gpu/src/texture_view.zig | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/gpu/TODO-webgpu.h b/gpu/TODO-webgpu.h index c6562710..d34a1103 100644 --- a/gpu/TODO-webgpu.h +++ b/gpu/TODO-webgpu.h @@ -1,15 +1,3 @@ -pub const WGPUTextureViewDescriptor = extern struct { - next_in_chain: *const ChainedStruct, - label: ?[*:0]const u8 = null, - format: TextureFormat, - dimension: TextureViewDimension, - base_mip_level: u32, - mip_level_count: u32, - base_array_layer: u32, - array_layer_count: u32, - aspect: TextureAspect, -}; - pub const VertexAttribute = extern struct { format: VertexFormat, offset: u64, diff --git a/gpu/src/texture_view.zig b/gpu/src/texture_view.zig index 9cb3fdb5..673d7f9e 100644 --- a/gpu/src/texture_view.zig +++ b/gpu/src/texture_view.zig @@ -1,3 +1,6 @@ +const ChainedStruct = @import("types.zig").ChainedStruct; +const Texture = @import("texture.zig").Texture; + pub const TextureView = enum(usize) { _, @@ -12,4 +15,16 @@ pub const TextureView = enum(usize) { dimension_cube_array = 0x00000005, dimension_3d = 0x00000006, }; + + pub const Descriptor = extern struct { + next_in_chain: *const ChainedStruct, + label: ?[*:0]const u8 = null, + format: Texture.Format, + dimension: Dimension, + base_mip_level: u32, + mip_level_count: u32, + base_array_layer: u32, + array_layer_count: u32, + aspect: Texture.Aspect, + }; };