This commit is contained in:
thesmartwon
2022-12-02 19:21:28 -05:00
parent be59386118
commit 8db9029286

View File

@@ -77,7 +77,10 @@ pub const ShaderCompileStep = struct {
self.builder.cache_root, self.builder.cache_root,
if (params.output_filename) |out| out else std.fmt.allocPrint(self.builder.allocator, "{s}.spv", .{src}) catch unreachable, if (params.output_filename) |out| out else std.fmt.allocPrint(self.builder.allocator, "{s}.spv", .{src}) catch unreachable,
}) catch unreachable; }) catch unreachable;
self.shaders.append(.{ .source_path = src, .full_out_path = full_out_path, .entry_point = params.entry_point, .stage = params.stage }) catch unreachable; var src_cpy = self.builder.allocator.alloc(u8, src.len) catch unreachable;
_ = std.mem.copy(u8, src_cpy, src);
self.shaders.append(.{ .source_path = src_cpy, .full_out_path = full_out_path, .entry_point = params.entry_point, .stage = params.stage }) catch unreachable;
return full_out_path; return full_out_path;
} }