gpu: implement TextureView

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-03-09 11:38:41 -07:00 committed by Stephen Gutekanst
parent 6338300fb3
commit 13b4a93a87
3 changed files with 45 additions and 0 deletions

21
gpu/src/TextureView.zig Normal file
View file

@ -0,0 +1,21 @@
const TextureView = @This();
/// The type erased pointer to the TextureView implementation
/// Equal to c.WGPUTextureView for NativeInstance.
ptr: *anyopaque,
vtable: *const VTable,
pub const VTable = struct {
reference: fn (ptr: *anyopaque) void,
release: fn (ptr: *anyopaque) void,
// TODO:
// WGPU_EXPORT void wgpuTextureViewSetLabel(WGPUTextureView textureView, char const * label);
};
pub inline fn reference(texture_view: TextureView) void {
texture_view.vtable.reference(texture_view.ptr);
}
pub inline fn release(texture_view: TextureView) void {
texture_view.vtable.release(texture_view.ptr);
}