gpu: implement Sampler
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
1563fc7246
commit
b29fa9e13d
5 changed files with 63 additions and 0 deletions
27
gpu/src/Sampler.zig
Normal file
27
gpu/src/Sampler.zig
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
const Sampler = @This();
|
||||
|
||||
/// The type erased pointer to the Sampler implementation
|
||||
/// Equal to c.WGPUSampler 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 wgpuSamplerSetLabel(WGPUSampler sampler, char const * label);
|
||||
};
|
||||
|
||||
pub inline fn reference(sampler: Sampler) void {
|
||||
sampler.vtable.reference(sampler.ptr);
|
||||
}
|
||||
|
||||
pub inline fn release(sampler: Sampler) void {
|
||||
sampler.vtable.release(sampler.ptr);
|
||||
}
|
||||
|
||||
test "syntax" {
|
||||
_ = VTable;
|
||||
_ = reference;
|
||||
_ = release;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue