diff --git a/build.zig.zon b/build.zig.zon index 50a320e..29d0dd2 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -59,8 +59,8 @@ .lazy = true, }, .SPIRV_Interpreter = .{ - .url = "git+https://git.kbz8.me/kbz_8/SPIRV-Interpreter#6c8b364c7d6fd8a4b199649011487a7c243cb849", - .hash = "SPIRV_Interpreter-0.0.1-ajmpn20rBACYd5tvl13JKU_MWx1ZmCClKKFIq5QF8jA1", + .url = "git+https://git.kbz8.me/kbz_8/SPIRV-Interpreter#8072d671af8423e8dc70c27caf386f2b206c17e2", + .hash = "SPIRV_Interpreter-0.0.1-ajmpn5wyBADtKrr1Dt1tl8XuhdSNaXpfO4-QrLa1lDSS", }, }, diff --git a/src/soft/SoftPipeline.zig b/src/soft/SoftPipeline.zig index 43511e7..309d824 100644 --- a/src/soft/SoftPipeline.zig +++ b/src/soft/SoftPipeline.zig @@ -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;