gpu: implement BindGroup
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
616b1529f2
commit
9162a8136f
4 changed files with 51 additions and 67 deletions
|
|
@ -30,6 +30,7 @@ const RenderBundle = @import("RenderBundle.zig");
|
|||
const QuerySet = @import("QuerySet.zig");
|
||||
const PipelineLayout = @import("PipelineLayout.zig");
|
||||
const ExternalTexture = @import("ExternalTexture.zig");
|
||||
const BindGroup = @import("BindGroup.zig");
|
||||
|
||||
const TextureUsage = @import("enums.zig").TextureUsage;
|
||||
const TextureFormat = @import("enums.zig").TextureFormat;
|
||||
|
|
@ -707,6 +708,26 @@ const external_texture_vtable = ExternalTexture.VTable{
|
|||
}).release,
|
||||
};
|
||||
|
||||
fn wrapBindGroup(group: c.WGPUBindGroup) BindGroup {
|
||||
return .{
|
||||
.ptr = group.?,
|
||||
.vtable = &bind_group_vtable,
|
||||
};
|
||||
}
|
||||
|
||||
const bind_group_vtable = BindGroup.VTable{
|
||||
.reference = (struct {
|
||||
pub fn reference(ptr: *anyopaque) void {
|
||||
c.wgpuBindGroupReference(@ptrCast(c.WGPUBindGroup, ptr));
|
||||
}
|
||||
}).reference,
|
||||
.release = (struct {
|
||||
pub fn release(ptr: *anyopaque) void {
|
||||
c.wgpuBindGroupRelease(@ptrCast(c.WGPUBindGroup, ptr));
|
||||
}
|
||||
}).release,
|
||||
};
|
||||
|
||||
test "syntax" {
|
||||
_ = wrap;
|
||||
_ = interface_vtable;
|
||||
|
|
@ -730,4 +751,5 @@ test "syntax" {
|
|||
_ = wrapQuerySet;
|
||||
_ = wrapPipelineLayout;
|
||||
_ = wrapExternalTexture;
|
||||
_ = wrapBindGroup;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue