adding C bindings
Build / build (push) Successful in 1m52s
Test / build (push) Successful in 7m57s

This commit is contained in:
2026-04-25 19:30:09 +02:00
parent 664ea9b92b
commit ef69470183
10 changed files with 765 additions and 75 deletions
+3 -3
View File
@@ -210,19 +210,19 @@ fn pass(self: *Self, allocator: std.mem.Allocator, op_set: ?std.EnumSet(spv.SpvO
}
}
pub fn writeDescriptorSet(self: *const Self, input: []u8, set: SpvWord, binding: SpvWord, descriptor_index: SpvWord) RuntimeError!void {
pub fn writeDescriptorSet(self: *const Self, input: []const u8, set: SpvWord, binding: SpvWord, descriptor_index: SpvWord) RuntimeError!void {
if (set < lib.SPIRV_MAX_SET and binding < lib.SPIRV_MAX_SET_BINDINGS) {
const value = &self.results[self.mod.bindings[set][binding]].variant.?.Variable.value;
switch (value.*) {
.Array => |arr| {
if (descriptor_index >= arr.values.len)
return RuntimeError.NotFound;
_ = try arr.values[descriptor_index].write(input);
_ = try arr.values[descriptor_index].writeConst(input);
},
else => {
if (descriptor_index != 0)
return RuntimeError.NotFound;
_ = try value.write(input);
_ = try value.writeConst(input);
},
}
} else {
+1 -1
View File
@@ -35,7 +35,7 @@ pub const Module = @import("Module.zig");
pub const Runtime = @import("Runtime.zig");
const opcodes = @import("opcodes.zig");
const spv = @import("spv.zig");
pub const spv = @import("spv.zig");
pub const SpvVoid = spv.SpvVoid;
pub const SpvByte = spv.SpvByte;