bumping spirv interpreter
This commit is contained in:
@@ -23,7 +23,12 @@ It maketh use of a bespoke [SPIR-V interpreter](https://git.kbz8.me/kbz_8/SPIRV-
|
|||||||
|
|
||||||
If thou art truly determined:
|
If thou art truly determined:
|
||||||
```
|
```
|
||||||
zig build soft
|
zig build soft --release=[fast|safe|small]
|
||||||
|
```
|
||||||
|
|
||||||
|
And should thou seek additional build options with:
|
||||||
|
```
|
||||||
|
zig build --help
|
||||||
```
|
```
|
||||||
|
|
||||||
Then ensure thy Vulkan loader is pointed toward the ICD manifest.
|
Then ensure thy Vulkan loader is pointed toward the ICD manifest.
|
||||||
|
|||||||
+2
-2
@@ -26,8 +26,8 @@
|
|||||||
.hash = "N-V-__8AAF9uOh0I4P_99za7N822J3JwsDaqONrFVrcEQo59",
|
.hash = "N-V-__8AAF9uOh0I4P_99za7N822J3JwsDaqONrFVrcEQo59",
|
||||||
},
|
},
|
||||||
.SPIRV_Interpreter = .{
|
.SPIRV_Interpreter = .{
|
||||||
.url = "git+https://git.kbz8.me/kbz_8/SPIRV-Interpreter#c868a4481b6be4f7fb07c90cffcb359e4e21a7fb",
|
.url = "git+https://git.kbz8.me/kbz_8/SPIRV-Interpreter#75099f7e1d74cd04eea3ebf93c1c3e488e3cf740",
|
||||||
.hash = "SPIRV_Interpreter-0.0.1-ajmpn4TyBgAgPySLGtH-ewEI0b53c3nRIjCGTugLyunr",
|
.hash = "SPIRV_Interpreter-0.0.1-ajmpnzLyBgBc7yh8iu2pSNAL-3B35FE8VYDA1PmklZJW",
|
||||||
.lazy = true,
|
.lazy = true,
|
||||||
},
|
},
|
||||||
//.SPIRV_Interpreter = .{
|
//.SPIRV_Interpreter = .{
|
||||||
|
|||||||
@@ -119,6 +119,7 @@ inline fn run(data: RunData) !void {
|
|||||||
try barrier_rt.copySpecializationConstantsFrom(allocator, rt);
|
try barrier_rt.copySpecializationConstantsFrom(allocator, rt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
defer {
|
defer {
|
||||||
for (barrier_runtimes) |*barrier_rt| {
|
for (barrier_runtimes) |*barrier_rt| {
|
||||||
barrier_rt.deinit(allocator);
|
barrier_rt.deinit(allocator);
|
||||||
@@ -179,9 +180,8 @@ inline fn run(data: RunData) !void {
|
|||||||
|
|
||||||
rt.callEntryPoint(allocator, entry) catch |err| switch (err) {
|
rt.callEntryPoint(allocator, entry) catch |err| switch (err) {
|
||||||
// Some errors can be ignored
|
// Some errors can be ignored
|
||||||
SpvRuntimeError.OutOfBounds,
|
SpvRuntimeError.OutOfBounds => {},
|
||||||
SpvRuntimeError.Killed,
|
SpvRuntimeError.Killed => continue,
|
||||||
=> {},
|
|
||||||
else => return err,
|
else => return err,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -235,7 +235,7 @@ fn runBarrierWorkgroup(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inline fn dumpResultsTable(allocator: std.mem.Allocator, io: std.Io, rt: *spv.Runtime, is_early: bool) !void {
|
fn dumpResultsTable(allocator: std.mem.Allocator, io: std.Io, rt: *spv.Runtime, comptime is_early: bool) !void {
|
||||||
@branchHint(.cold);
|
@branchHint(.cold);
|
||||||
const file = try std.Io.Dir.cwd().createFile(
|
const file = try std.Io.Dir.cwd().createFile(
|
||||||
io,
|
io,
|
||||||
|
|||||||
@@ -87,9 +87,13 @@ pub fn writeDescriptorSets(state: *PipelineState, rt: *spv.Runtime) !void {
|
|||||||
if (buffer_data.object) |buffer| {
|
if (buffer_data.object) |buffer| {
|
||||||
const binding_layout = set.?.interface.layout.bindings[binding_index];
|
const binding_layout = set.?.interface.layout.bindings[binding_index];
|
||||||
const dynamic_offset: vk.DeviceSize = switch (binding_layout.descriptor_type) {
|
const dynamic_offset: vk.DeviceSize = switch (binding_layout.descriptor_type) {
|
||||||
.uniform_buffer_dynamic, .storage_buffer_dynamic => state.dynamic_offsets[set_index][binding_layout.dynamic_index + descriptor_index],
|
.uniform_buffer_dynamic,
|
||||||
|
.storage_buffer_dynamic,
|
||||||
|
=> state.dynamic_offsets[set_index][binding_layout.dynamic_index + descriptor_index],
|
||||||
|
|
||||||
else => 0,
|
else => 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
const map = buffer.mapAsSliceWithAddedOffset(u8, buffer_data.offset + dynamic_offset, buffer_data.size) catch continue :bindings;
|
const map = buffer.mapAsSliceWithAddedOffset(u8, buffer_data.offset + dynamic_offset, buffer_data.size) catch continue :bindings;
|
||||||
rt.writeDescriptorSet(
|
rt.writeDescriptorSet(
|
||||||
map,
|
map,
|
||||||
@@ -163,6 +167,7 @@ pub fn writeDescriptorSets(state: *PipelineState, rt: *spv.Runtime) !void {
|
|||||||
const addr: usize = @intFromPtr(image_view);
|
const addr: usize = @intFromPtr(image_view);
|
||||||
data.image = addr;
|
data.image = addr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (texture_data.sampler) |sampler| {
|
if (texture_data.sampler) |sampler| {
|
||||||
const addr: usize = @intFromPtr(sampler);
|
const addr: usize = @intFromPtr(sampler);
|
||||||
data.sampler = addr;
|
data.sampler = addr;
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ pub fn shaderInvocation(
|
|||||||
) SpvRuntimeError![spv.SPIRV_MAX_OUTPUT_LOCATIONS][@sizeOf(zm.F32x4)]u8 {
|
) SpvRuntimeError![spv.SPIRV_MAX_OUTPUT_LOCATIONS][@sizeOf(zm.F32x4)]u8 {
|
||||||
var fragment_inputs = inputs;
|
var fragment_inputs = inputs;
|
||||||
errdefer freeOwnedInputs(allocator, fragment_inputs);
|
errdefer freeOwnedInputs(allocator, fragment_inputs);
|
||||||
|
|
||||||
const derivatives = derivative_inputs;
|
const derivatives = derivative_inputs;
|
||||||
errdefer if (derivatives) |owned_derivatives| {
|
errdefer if (derivatives) |owned_derivatives| {
|
||||||
freeOwnedInputs(allocator, owned_derivatives.dx);
|
freeOwnedInputs(allocator, owned_derivatives.dx);
|
||||||
|
|||||||
Reference in New Issue
Block a user