forked from mirror/vulkan-zig
Copy array of strings instead of assuming lifetime
Current setup works fine if passed static memory like '&.{ "glslc" }', but produces errors of various types (segmentation faults, access denied, file doesn't exist, etc) if passed a dynamically allocated slice, such as a slice containing the result of a call to `Builder.pathJoin`, a la `b.pathJoin(&.{ b.env_map.get("VULKAN_SDK").?, "bin", "glslc" })`.
This commit is contained in:
@@ -32,7 +32,7 @@ pub const ShaderCompileStep = struct {
|
|||||||
self.* = .{
|
self.* = .{
|
||||||
.step = Step.init(.custom, "shader-compile", builder.allocator, make),
|
.step = Step.init(.custom, "shader-compile", builder.allocator, make),
|
||||||
.builder = builder,
|
.builder = builder,
|
||||||
.glslc_cmd = glslc_cmd,
|
.glslc_cmd = builder.dupeStrings(glslc_cmd),
|
||||||
.shaders = std.ArrayList(Shader).init(builder.allocator),
|
.shaders = std.ArrayList(Shader).init(builder.allocator),
|
||||||
};
|
};
|
||||||
return self;
|
return self;
|
||||||
|
|||||||
Reference in New Issue
Block a user