fixing dangling pointer
Build / build (push) Successful in 48s
Test / build_and_test (push) Successful in 25m13s

This commit is contained in:
2026-04-23 14:12:44 +02:00
parent ed8a60b539
commit 2a427c0b51
3 changed files with 6 additions and 9 deletions
+1 -3
View File
@@ -63,9 +63,7 @@ pub fn dispatch(self: *Self, group_count_x: u32, group_count_y: u32, group_count
var wg: std.Io.Group = .init;
for (0..@min(self.batch_size, group_count)) |batch_id| {
if (base.config.single_threaded_compute) {
@branchHint(.cold); // Should only be reached for debugging
if (comptime base.config.single_threaded_compute) {
runWrapper(
RunData{
.self = self,
+3 -5
View File
@@ -27,9 +27,9 @@ renderer: Renderer,
/// .compute = 1
pipeline_states: [2]PipelineState,
pub fn init(device: *SoftDevice) Self {
var self: Self = undefined;
/// Initializating an execution device and
/// not creating one to avoid dangling pointers
pub fn init(self: *Self, device: *SoftDevice) void {
for (self.pipeline_states[0..]) |*state| {
state.* = .{
.pipeline = null,
@@ -38,8 +38,6 @@ pub fn init(device: *SoftDevice) Self {
}
self.compute = .init(device, &self.pipeline_states[@intFromEnum(vk.PipelineBindPoint.compute)]);
self.renderer = .init();
return self;
}
pub fn deinit(self: *Self) void {