gpu: implement ComputePipeline.getBindGroupLayout
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
7e54d9b4ae
commit
cad271345a
2 changed files with 16 additions and 2 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
const PipelineLayout = @import("PipelineLayout.zig");
|
const PipelineLayout = @import("PipelineLayout.zig");
|
||||||
const ProgrammableStageDescriptor = @import("structs.zig").ProgrammableStageDescriptor;
|
const ProgrammableStageDescriptor = @import("structs.zig").ProgrammableStageDescriptor;
|
||||||
|
const BindGroupLayout = @import("BindGroupLayout.zig");
|
||||||
|
|
||||||
const ComputePipeline = @This();
|
const ComputePipeline = @This();
|
||||||
|
|
||||||
|
|
@ -11,9 +12,8 @@ vtable: *const VTable,
|
||||||
pub const VTable = struct {
|
pub const VTable = struct {
|
||||||
reference: fn (ptr: *anyopaque) void,
|
reference: fn (ptr: *anyopaque) void,
|
||||||
release: fn (ptr: *anyopaque) void,
|
release: fn (ptr: *anyopaque) void,
|
||||||
// TODO:
|
|
||||||
// WGPU_EXPORT WGPUBindGroupLayout wgpuComputePipelineGetBindGroupLayout(WGPUComputePipeline computePipeline, uint32_t groupIndex);
|
|
||||||
setLabel: fn (ptr: *anyopaque, label: [:0]const u8) void,
|
setLabel: fn (ptr: *anyopaque, label: [:0]const u8) void,
|
||||||
|
getBindGroupLayout: fn (ptr: *anyopaque, group_index: u32) BindGroupLayout,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub inline fn reference(pipeline: ComputePipeline) void {
|
pub inline fn reference(pipeline: ComputePipeline) void {
|
||||||
|
|
@ -28,6 +28,10 @@ pub inline fn setLabel(pipeline: ComputePipeline, label: [:0]const u8) void {
|
||||||
pipeline.vtable.setLabel(pipeline.ptr, label);
|
pipeline.vtable.setLabel(pipeline.ptr, label);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub inline fn getBindGroupLayout(pipeline: ComputePipeline, group_index: u32) BindGroupLayout {
|
||||||
|
return pipeline.vtable.getBindGroupLayout(pipeline.ptr, group_index);
|
||||||
|
}
|
||||||
|
|
||||||
pub const Descriptor = struct {
|
pub const Descriptor = struct {
|
||||||
label: ?[*:0]const u8 = null,
|
label: ?[*:0]const u8 = null,
|
||||||
layout: PipelineLayout,
|
layout: PipelineLayout,
|
||||||
|
|
@ -88,6 +92,8 @@ test "syntax" {
|
||||||
_ = VTable;
|
_ = VTable;
|
||||||
_ = reference;
|
_ = reference;
|
||||||
_ = release;
|
_ = release;
|
||||||
|
_ = setLabel;
|
||||||
|
_ = getBindGroupLayout;
|
||||||
_ = Descriptor;
|
_ = Descriptor;
|
||||||
_ = CreateStatus;
|
_ = CreateStatus;
|
||||||
_ = CreateCallback;
|
_ = CreateCallback;
|
||||||
|
|
|
||||||
|
|
@ -1312,6 +1312,14 @@ const compute_pipeline_vtable = ComputePipeline.VTable{
|
||||||
c.wgpuComputePipelineSetLabel(@ptrCast(c.WGPUComputePipeline, ptr), label);
|
c.wgpuComputePipelineSetLabel(@ptrCast(c.WGPUComputePipeline, ptr), label);
|
||||||
}
|
}
|
||||||
}).setLabel,
|
}).setLabel,
|
||||||
|
.getBindGroupLayout = (struct {
|
||||||
|
pub fn getBindGroupLayout(ptr: *anyopaque, group_index: u32) BindGroupLayout {
|
||||||
|
return wrapBindGroupLayout(c.wgpuComputePipelineGetBindGroupLayout(
|
||||||
|
@ptrCast(c.WGPUComputePipeline, ptr),
|
||||||
|
group_index,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}).getBindGroupLayout,
|
||||||
};
|
};
|
||||||
|
|
||||||
test "syntax" {
|
test "syntax" {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue