adding storage image read and writes
Build / build (push) Successful in 1m42s
Test / build (push) Successful in 8m27s

This commit is contained in:
2026-04-29 01:19:48 +02:00
parent cc041c9677
commit 046b1c8f9e
10 changed files with 473 additions and 62 deletions
+3 -13
View File
@@ -109,17 +109,7 @@ pub const Value = union(Type) {
Function: noreturn,
Image: struct {
type_word: SpvWord,
data: []u8,
pub inline fn getInfos(self: *const @This(), results: []const Result) RuntimeError!@FieldType(Result.TypeData, "Image") {
return switch (try results[self.type_word].getConstVariant()) {
.Type => |t| switch (t) {
.Image => |i| i,
else => RuntimeError.InvalidSpirV,
},
else => RuntimeError.InvalidSpirV,
};
}
driver_image: *anyopaque,
},
Sampler: struct {},
SampledImage: struct {},
@@ -236,7 +226,7 @@ pub const Value = union(Type) {
.Image => .{
.Image = .{
.type_word = resolved,
.data = &.{},
.driver_image = undefined,
},
},
.Sampler => RuntimeError.ToDo,
@@ -545,7 +535,7 @@ pub const Value = union(Type) {
return offset;
},
.RuntimeArray => |*arr| arr.data = input[0..],
.Image => |*img| img.data = input[0..],
.Image => |*img| img.driver_image = @ptrFromInt(std.mem.bytesToValue(usize, input[0..])),
else => return RuntimeError.InvalidValueType,
}
return 0;