adding cleaning engines, adding image engine
This commit is contained in:
@@ -84,3 +84,7 @@ int main(void)
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
## Documentation
|
||||
|
||||
A full documentation on how to use this interpreter will come soon (when I'll stop being lazy).
|
||||
|
||||
+3
-2
@@ -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 => {},
|
||||
|
||||
@@ -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
@@ -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
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user