From 7b62d5f81bd63e1dbbd6dac2866b897f4e409ae9 Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Sat, 30 Jul 2022 17:23:37 -0700 Subject: [PATCH] gpu: implement Dawn textureGet* Signed-off-by: Stephen Gutekanst --- gpu/src/dawn_impl.zig | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/gpu/src/dawn_impl.zig b/gpu/src/dawn_impl.zig index c05164ae..90e9949d 100644 --- a/gpu/src/dawn_impl.zig +++ b/gpu/src/dawn_impl.zig @@ -1099,33 +1099,27 @@ pub const Interface = gpu.Interface(struct { } pub inline fn textureGetDepthOrArrayLayers(texture: *gpu.Texture) u32 { - _ = texture; - unreachable; + return procs.textureGetDepthOrArrayLayers.?(@ptrCast(c.WGPUTexture, texture)); } pub inline fn textureGetDimension(texture: *gpu.Texture) gpu.Texture.Dimension { - _ = texture; - unreachable; + return @intToEnum(gpu.Texture.Dimension, procs.textureGetDimension.?(@ptrCast(c.WGPUTexture, texture))); } pub inline fn textureGetFormat(texture: *gpu.Texture) gpu.Texture.Format { - _ = texture; - unreachable; + return @intToEnum(gpu.Texture.Format, procs.textureGetFormat.?(@ptrCast(c.WGPUTexture, texture))); } pub inline fn textureGetHeight(texture: *gpu.Texture) u32 { - _ = texture; - unreachable; + return procs.textureGetHeight.?(@ptrCast(c.WGPUTexture, texture)); } pub inline fn textureGetMipLevelCount(texture: *gpu.Texture) u32 { - _ = texture; - unreachable; + return procs.textureGetMipLevelCount.?(@ptrCast(c.WGPUTexture, texture)); } pub inline fn textureGetSampleCount(texture: *gpu.Texture) u32 { - _ = texture; - unreachable; + return procs.textureGetSampleCount.?(@ptrCast(c.WGPUTexture, texture)); } pub inline fn textureGetUsage(texture: *gpu.Texture) gpu.Texture.UsageFlags {