fixing compuite pipline test
This commit is contained in:
@@ -52,14 +52,18 @@ pub fn createCompute(device: *base.Device, allocator: std.mem.Allocator, cache:
|
|||||||
self.* = .{
|
self.* = .{
|
||||||
.interface = interface,
|
.interface = interface,
|
||||||
.stages = std.EnumMap(Stages, Shader).init(.{
|
.stages = std.EnumMap(Stages, Shader).init(.{
|
||||||
.compute = .{
|
.compute = blk: {
|
||||||
.module = blk: {
|
var shader: Shader = undefined;
|
||||||
soft_module.ref();
|
soft_module.ref();
|
||||||
break :blk soft_module;
|
shader.module = soft_module;
|
||||||
},
|
|
||||||
.runtimes = blk: {
|
|
||||||
const runtimes = device_allocator.alloc(spv.Runtime, soft_device.workers.getIdCount()) catch return VkError.OutOfHostMemory;
|
const runtimes = device_allocator.alloc(spv.Runtime, soft_device.workers.getIdCount()) catch return VkError.OutOfHostMemory;
|
||||||
errdefer device_allocator.free(runtimes);
|
errdefer {
|
||||||
|
for (runtimes) |*runtime| {
|
||||||
|
runtime.deinit(device_allocator);
|
||||||
|
}
|
||||||
|
device_allocator.free(runtimes);
|
||||||
|
}
|
||||||
|
|
||||||
for (runtimes) |*runtime| {
|
for (runtimes) |*runtime| {
|
||||||
runtime.* = spv.Runtime.init(device_allocator, &soft_module.module) catch |err| {
|
runtime.* = spv.Runtime.init(device_allocator, &soft_module.module) catch |err| {
|
||||||
@@ -67,9 +71,10 @@ pub fn createCompute(device: *base.Device, allocator: std.mem.Allocator, cache:
|
|||||||
return VkError.Unknown;
|
return VkError.Unknown;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
break :blk runtimes;
|
|
||||||
},
|
shader.runtimes = runtimes;
|
||||||
.entry = allocator.dupe(u8, std.mem.span(info.stage.p_name)) catch return VkError.OutOfHostMemory,
|
shader.entry = device_allocator.dupe(u8, std.mem.span(info.stage.p_name)) catch return VkError.OutOfHostMemory;
|
||||||
|
break :blk shader;
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
@@ -117,7 +122,7 @@ pub fn destroy(interface: *Interface, allocator: std.mem.Allocator) void {
|
|||||||
runtime.deinit(device_allocator);
|
runtime.deinit(device_allocator);
|
||||||
}
|
}
|
||||||
device_allocator.free(stage.value.runtimes);
|
device_allocator.free(stage.value.runtimes);
|
||||||
allocator.free(stage.value.entry);
|
device_allocator.free(stage.value.entry);
|
||||||
}
|
}
|
||||||
allocator.destroy(self);
|
allocator.destroy(self);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user