From 54b0ffdcc6364963de85e2587c7b843afc931f51 Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Sat, 16 Jul 2022 20:22:57 -0700 Subject: [PATCH] gpu: add Texture.BindingLayout Signed-off-by: Stephen Gutekanst --- gpu/TODO-webgpu.h | 7 ------- gpu/src/texture.zig | 9 +++++++++ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/gpu/TODO-webgpu.h b/gpu/TODO-webgpu.h index e5afb026..bf340f90 100644 --- a/gpu/TODO-webgpu.h +++ b/gpu/TODO-webgpu.h @@ -1,10 +1,3 @@ -pub const WGPUTextureBindingLayout = extern struct { - next_in_chain: *const ChainedStruct, - sample_type: TextureSampleType, - view_dimension: TextureViewDimension, - multisampled: bool, -}; - pub const WGPUTextureDataLayout = extern struct { next_in_chain: *const ChainedStruct, offset: u64, diff --git a/gpu/src/texture.zig b/gpu/src/texture.zig index c453443c..93ffd435 100644 --- a/gpu/src/texture.zig +++ b/gpu/src/texture.zig @@ -1,4 +1,6 @@ const std = @import("std"); +const ChainedStruct = @import("types.zig").ChainedStruct; +const TextureView = @import("texture_view.zig").TextureView; pub const Texture = enum(usize) { _, @@ -158,4 +160,11 @@ pub const Texture = enum(usize) { return @truncate(u6, @bitCast(u32, a)) == @truncate(u6, @bitCast(u32, b)); } }; + + pub const BindingLayout = extern struct { + next_in_chain: *const ChainedStruct, + sample_type: SampleType, + view_dimension: TextureView.Dimension, + multisampled: bool, + }; };