gpu: implement Dawn textureGet*

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-07-30 17:23:37 -07:00 committed by Stephen Gutekanst
parent dbac3c325a
commit 7b62d5f81b

View file

@ -1099,33 +1099,27 @@ pub const Interface = gpu.Interface(struct {
} }
pub inline fn textureGetDepthOrArrayLayers(texture: *gpu.Texture) u32 { pub inline fn textureGetDepthOrArrayLayers(texture: *gpu.Texture) u32 {
_ = texture; return procs.textureGetDepthOrArrayLayers.?(@ptrCast(c.WGPUTexture, texture));
unreachable;
} }
pub inline fn textureGetDimension(texture: *gpu.Texture) gpu.Texture.Dimension { pub inline fn textureGetDimension(texture: *gpu.Texture) gpu.Texture.Dimension {
_ = texture; return @intToEnum(gpu.Texture.Dimension, procs.textureGetDimension.?(@ptrCast(c.WGPUTexture, texture)));
unreachable;
} }
pub inline fn textureGetFormat(texture: *gpu.Texture) gpu.Texture.Format { pub inline fn textureGetFormat(texture: *gpu.Texture) gpu.Texture.Format {
_ = texture; return @intToEnum(gpu.Texture.Format, procs.textureGetFormat.?(@ptrCast(c.WGPUTexture, texture)));
unreachable;
} }
pub inline fn textureGetHeight(texture: *gpu.Texture) u32 { pub inline fn textureGetHeight(texture: *gpu.Texture) u32 {
_ = texture; return procs.textureGetHeight.?(@ptrCast(c.WGPUTexture, texture));
unreachable;
} }
pub inline fn textureGetMipLevelCount(texture: *gpu.Texture) u32 { pub inline fn textureGetMipLevelCount(texture: *gpu.Texture) u32 {
_ = texture; return procs.textureGetMipLevelCount.?(@ptrCast(c.WGPUTexture, texture));
unreachable;
} }
pub inline fn textureGetSampleCount(texture: *gpu.Texture) u32 { pub inline fn textureGetSampleCount(texture: *gpu.Texture) u32 {
_ = texture; return procs.textureGetSampleCount.?(@ptrCast(c.WGPUTexture, texture));
unreachable;
} }
pub inline fn textureGetUsage(texture: *gpu.Texture) gpu.Texture.UsageFlags { pub inline fn textureGetUsage(texture: *gpu.Texture) gpu.Texture.UsageFlags {