gpu: implement TextureView
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
6338300fb3
commit
13b4a93a87
3 changed files with 45 additions and 0 deletions
21
gpu/src/TextureView.zig
Normal file
21
gpu/src/TextureView.zig
Normal 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);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue