src/gpu: move github.com/hexops/mach-gpu here
This moves github.com/hexops/mach-gpu@528dad0823dafeae5d474c88cc658b091bf2e605 to
this repository in the src/gpu directory. It can be imported via `@import("mach").gpu`.
Soon we will move away from mach-gpu entirely as part of #1166 - but in the meantime
I am giving a workshop at https://sycl.it and it would be nice for people using the
`mach.gpu.*` API to be able to search the API in this single repository.
There's not much harm to moving this code here.
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
c45606c290
commit
2cf68adcc7
38 changed files with 8123 additions and 18 deletions
38
src/gpu/pipeline_layout.zig
Normal file
38
src/gpu/pipeline_layout.zig
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
const ChainedStruct = @import("main.zig").ChainedStruct;
|
||||
const BindGroupLayout = @import("bind_group_layout.zig").BindGroupLayout;
|
||||
const Impl = @import("interface.zig").Impl;
|
||||
|
||||
pub const PipelineLayout = opaque {
|
||||
pub const Descriptor = extern struct {
|
||||
next_in_chain: ?*const ChainedStruct = null,
|
||||
label: ?[*:0]const u8 = null,
|
||||
bind_group_layout_count: usize = 0,
|
||||
bind_group_layouts: ?[*]const *BindGroupLayout = null,
|
||||
|
||||
/// Provides a slightly friendlier Zig API to initialize this structure.
|
||||
pub inline fn init(v: struct {
|
||||
next_in_chain: ?*const ChainedStruct = null,
|
||||
label: ?[*:0]const u8 = null,
|
||||
bind_group_layouts: ?[]const *BindGroupLayout = null,
|
||||
}) Descriptor {
|
||||
return .{
|
||||
.next_in_chain = v.next_in_chain,
|
||||
.label = v.label,
|
||||
.bind_group_layout_count = if (v.bind_group_layouts) |e| e.len else 0,
|
||||
.bind_group_layouts = if (v.bind_group_layouts) |e| e.ptr else null,
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
pub inline fn setLabel(pipeline_layout: *PipelineLayout, label: [*:0]const u8) void {
|
||||
Impl.pipelineLayoutSetLabel(pipeline_layout, label);
|
||||
}
|
||||
|
||||
pub inline fn reference(pipeline_layout: *PipelineLayout) void {
|
||||
Impl.pipelineLayoutReference(pipeline_layout);
|
||||
}
|
||||
|
||||
pub inline fn release(pipeline_layout: *PipelineLayout) void {
|
||||
Impl.pipelineLayoutRelease(pipeline_layout);
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue