Renamed ProcessDef to COmputeDef

This commit is contained in:
adrien 2026-05-19 21:35:52 +02:00
parent e467539f6e
commit 83ef8bcd12
3 changed files with 5 additions and 5 deletions

View File

@ -73,7 +73,7 @@ pub fn main(init: std.process.Init) !void {
try buf_a.load(f16, data_a); try buf_a.load(f16, data_a);
try buf_b.load(f16, data_b); try buf_b.load(f16, data_b);
// 7. Dispatch the Compute Process // 7. Dispatch the Compute
try add_cp.run(gloc, .{ buf_a, buf_b, buf_out }); try add_cp.run(gloc, .{ buf_a, buf_b, buf_out });
// 8. Map and copy the resulting buffer back to the CPU // 8. Map and copy the resulting buffer back to the CPU

View File

@ -54,7 +54,7 @@ pub fn main(init: std.process.Init) !void {
try buf_a.load(f16, data_a); try buf_a.load(f16, data_a);
try buf_b.load(f16, data_b); try buf_b.load(f16, data_b);
// 7. Dispatch the Compute Process // 7. Dispatch the Compute
try add_cp.run(gloc, .{ buf_a, buf_b, buf_out }); try add_cp.run(gloc, .{ buf_a, buf_b, buf_out });
// 8. Map and copy the resulting buffer back to the CPU // 8. Map and copy the resulting buffer back to the CPU

View File

@ -10,7 +10,7 @@ pub const Binding = struct {
element_size: u32 = 0, element_size: u32 = 0,
}; };
pub const ProcessDef = struct { pub const ComputeDef = struct {
bindings: []const Binding, bindings: []const Binding,
workgroup_size: u32 = 256, workgroup_size: u32 = 256,
max_workgroups: u32 = 65535, max_workgroups: u32 = 65535,
@ -20,9 +20,9 @@ pub const ProcessDef = struct {
}; };
pip: c.WGPUComputePipeline, pip: c.WGPUComputePipeline,
def: ProcessDef, def: ComputeDef,
pub fn init(device: GpuDevice, wgsl: []const u8, def: ProcessDef) !@This() { pub fn init(device: GpuDevice, wgsl: []const u8, def: ComputeDef) !@This() {
var wgsl_src = c.WGPUShaderSourceWGSL{ var wgsl_src = c.WGPUShaderSourceWGSL{
.chain = .{ .sType = c.WGPUSType_ShaderSourceWGSL }, .chain = .{ .sType = c.WGPUSType_ShaderSourceWGSL },
.code = sv(wgsl), .code = sv(wgsl),