adding cleaning engines, adding image engine
Test / build (push) Successful in 1m6s
Build / build (push) Successful in 1m14s

This commit is contained in:
2026-05-20 18:04:53 +02:00
parent 45453c1b9e
commit bc84a9f553
5 changed files with 712 additions and 551 deletions
+3 -2
View File
@@ -139,7 +139,9 @@ pub const TypeData = union(Type) {
access: ?spv.SpvAccessQualifier,
},
Sampler: struct {},
SampledImage: struct {},
SampledImage: struct {
image_type: SpvWord,
},
Pointer: struct {
storage_class: spv.SpvStorageClass,
target: SpvWord,
@@ -460,7 +462,6 @@ pub fn getMemberCounts(self: *const Self) usize {
.Vector2f32, .Vector2i32, .Vector2u32 => return 2,
.Matrix => |m| return m.member_count,
.Array => |a| return a.member_count,
.SampledImage => return 2,
.Structure => |s| return s.members_type_word.len,
.Function => |f| return f.params.len,
else => {},
+1
View File
@@ -59,6 +59,7 @@ pub const ImageAPI = struct {
readImageInt4: *const fn (driver_image: *anyopaque, dim: spv.SpvDim, x: i32, y: i32, z: i32) RuntimeError!Vec4(u32),
writeImageFloat4: *const fn (driver_image: *anyopaque, dim: spv.SpvDim, x: i32, y: i32, z: i32, pixel: Vec4(f32)) RuntimeError!void,
writeImageInt4: *const fn (driver_image: *anyopaque, dim: spv.SpvDim, x: i32, y: i32, z: i32, pixel: Vec4(u32)) RuntimeError!void,
sampleImageFloat4: *const fn (driver_image: *anyopaque, driver_sampler: *anyopaque, dim: spv.SpvDim, x: f32, y: f32, z: f32) RuntimeError!Vec4(f32),
};
mod: *Module,
+16 -2
View File
@@ -113,7 +113,11 @@ pub const Value = union(Type) {
driver_image: *anyopaque,
},
Sampler: struct {},
SampledImage: struct {},
SampledImage: struct {
type_word: SpvWord,
driver_image: *anyopaque,
driver_sampler: *anyopaque,
},
Pointer: struct {
ptr: union(enum) {
common: *Self,
@@ -244,7 +248,13 @@ pub const Value = union(Type) {
},
},
.Sampler => RuntimeError.ToDo,
.SampledImage => RuntimeError.ToDo,
.SampledImage => .{
.SampledImage = .{
.type_word = target_type,
.driver_image = undefined,
.driver_sampler = undefined,
},
},
.Pointer => .{
.Pointer = .{
.ptr = undefined,
@@ -469,6 +479,10 @@ pub const Value = union(Type) {
},
.RuntimeArray => |*arr| arr.data = @constCast(input[0..]),
.Image => |*img| img.driver_image = @ptrFromInt(std.mem.bytesToValue(usize, input[0..])),
.SampledImage => |*img| {
img.driver_image = @ptrFromInt(std.mem.bytesToValue(usize, input[0..]));
img.driver_sampler = @ptrFromInt(std.mem.bytesToValue(usize, input[@sizeOf(usize)..]));
},
else => return RuntimeError.InvalidValueType,
}
return 0;
+688 -547
View File
File diff suppressed because it is too large Load Diff