finishing bitwise operatoins
All checks were successful
Build / build (push) Successful in 1m3s
Test / build (push) Successful in 6m4s

This commit is contained in:
2026-01-20 00:32:50 +01:00
parent 9fb8cbea05
commit 35099b33e1
9 changed files with 260 additions and 62 deletions

View File

@@ -17,11 +17,9 @@ pub fn main() !void {
defer rt.deinit(allocator);
try rt.callEntryPoint(allocator, try rt.getEntryPointByName("main"));
var value: f32 = undefined;
var value2: f32 = undefined;
try rt.readOutput(f32, @as([*]f32, @ptrCast(&value))[0..1], try rt.getResultByName("value"));
try rt.readOutput(f32, @as([*]f32, @ptrCast(&value2))[0..1], try rt.getResultByName("value2"));
std.log.info("Output: {d} {d}", .{ value, value2 });
var output: [4]i32 = undefined;
try rt.readOutput(i32, output[0..], try rt.getResultByName("color"));
std.log.info("Output: Vec4{any}", .{output});
}
std.log.info("Successfully executed", .{});
}

View File

@@ -10,7 +10,7 @@ struct FragOut
fn main() -> FragOut
{
let base: i32 = 4;
let value: i32 = base << 3;
let value: i32 = base >> 3;
let output: FragOut;
output.color = vec4[i32](value, value, value, value);
return output;

Binary file not shown.

View File

@@ -34,7 +34,7 @@ Schema: 0
%17 = OpVariable %11 StorageClass(Function)
OpStore %15 %8
%18 = OpLoad %3 %15
%19 = OpShiftLeftLogical %3 %18 %10
%19 = OpShiftRightArithmetic %3 %18 %10
OpStore %16 %19
%20 = OpLoad %3 %16
%21 = OpLoad %3 %16