finishing bitwise operatoins
This commit is contained in:
@@ -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", .{});
|
||||
}
|
||||
|
||||
@@ -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.
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user