adding specialization management to compute pipelines
Build / build (push) Successful in 1m53s
Test / build_and_test (push) Successful in 56m23s

This commit is contained in:
2026-03-30 04:48:05 +02:00
parent c0e2451f5f
commit 95c6af284e
2 changed files with 14 additions and 2 deletions
+12
View File
@@ -70,6 +70,18 @@ pub fn createCompute(device: *base.Device, allocator: std.mem.Allocator, cache:
std.log.scoped(.SpvRuntimeInit).err("SPIR-V Runtime failed to initialize, {s}", .{@errorName(err)});
return VkError.Unknown;
};
if (info.stage.p_specialization_info) |specialization| {
if (specialization.p_map_entries) |map| {
const data: []const u8 = @as([*]const u8, @ptrCast(@alignCast(specialization.p_data)))[0..specialization.data_size];
for (map[0..], 0..specialization.map_entry_count) |entry, _| {
runtime.addSpecializationInfo(device_allocator, .{
.id = @intCast(entry.constant_id),
.offset = @intCast(entry.offset),
.size = @intCast(entry.size),
}, data) catch return VkError.OutOfHostMemory;
}
}
}
}
shader.runtimes = runtimes;