tangled
alpha
login
or
join now
altagos.dev
/
rayray
0
fork
atom
this repo has no description
0
fork
atom
overview
issues
pulls
pipelines
already passing a pointer
altagos.dev
1 year ago
282bb8f1
b2b7b046
+2
-4
1 changed file
expand all
collapse all
unified
split
src
rayray.zig
+2
-4
src/rayray.zig
···
98
98
99
99
var create_pixels_node = root_node.start("Create pixel array", 0);
100
100
101
101
-
const pixels = try self.allocator.alloc(zmath.Vec, self.scene.camera.image_height * self.scene.camera.image_width);
101
101
+
const pixels: []zmath.Vec = try self.allocator.alloc(zmath.Vec, self.scene.camera.image_height * self.scene.camera.image_width);
102
102
defer self.allocator.free(pixels);
103
103
// const l = pixels.ptr;
104
104
···
107
107
108
108
var task_node = root_node.start("Creating render tasks", 0);
109
109
110
110
-
const tasks = try self.allocator.alloc(TaskTracker, num_chunks);
110
110
+
const tasks: []TaskTracker = try self.allocator.alloc(TaskTracker, num_chunks);
111
111
defer self.allocator.free(tasks);
112
112
113
113
for (tasks, 0..) |*t, id| {
···
121
121
122
122
const ctx = try self.allocator.create(tracer.Context);
123
123
124
124
-
// FIXME: might cause the segfault
125
125
-
// possible fix: pass a pointer to the context as argument (create via allocator)
126
124
ctx.* = tracer.Context{
127
125
.pixels = pixels,
128
126
.cam = &self.scene.camera,