fixing recurrent panic
This commit is contained in:
@@ -15,27 +15,27 @@ pub fn main() !void {
|
||||
var module = try spv.Module.init(allocator, @ptrCast(@alignCast(shader_source)), .{});
|
||||
defer module.deinit(allocator);
|
||||
|
||||
//var rt = try spv.Runtime.init(allocator, &module);
|
||||
//defer rt.deinit(allocator);
|
||||
var rt = try spv.Runtime.init(allocator, &module);
|
||||
defer rt.deinit(allocator);
|
||||
|
||||
//const entry = try rt.getEntryPointByName("main");
|
||||
//const color = try rt.getResultByName("color");
|
||||
//const time = try rt.getResultByName("time");
|
||||
//const pos = try rt.getResultByName("pos");
|
||||
//const res = try rt.getResultByName("res");
|
||||
const entry = try rt.getEntryPointByName("main");
|
||||
const color = try rt.getResultByName("color");
|
||||
const time = try rt.getResultByName("time");
|
||||
const pos = try rt.getResultByName("pos");
|
||||
const res = try rt.getResultByName("res");
|
||||
|
||||
//var output: [4]f32 = undefined;
|
||||
var output: [4]f32 = undefined;
|
||||
|
||||
//try rt.writeInput(f32, &.{@as(f32, @floatFromInt(std.time.milliTimestamp()))}, time);
|
||||
//try rt.writeInput(f32, &.{ 1250.0, 720.0 }, res);
|
||||
//try rt.writeInput(f32, &.{ 0.0, 0.0 }, pos);
|
||||
try rt.writeInput(f32, &.{@as(f32, @floatFromInt(std.time.milliTimestamp()))}, time);
|
||||
try rt.writeInput(f32, &.{ 1250.0, 720.0 }, res);
|
||||
try rt.writeInput(f32, &.{ 0.0, 0.0 }, pos);
|
||||
|
||||
//try rt.callEntryPoint(allocator, entry);
|
||||
try rt.callEntryPoint(allocator, entry);
|
||||
|
||||
//try rt.readOutput(f32, output[0..output.len], color);
|
||||
//std.log.info("Output: Vec4{any}", .{output});
|
||||
try rt.readOutput(f32, output[0..output.len], color);
|
||||
std.log.info("Output: Vec4{any}", .{output});
|
||||
|
||||
std.log.info("Total memory used: {d:.3} MB\n", .{@as(f32, @floatFromInt(gpa.total_requested_bytes)) / 1000.0});
|
||||
std.log.info("\nTotal memory used: {d:.3} KB\n", .{@as(f32, @floatFromInt(gpa.total_requested_bytes)) / 1000.0});
|
||||
}
|
||||
std.log.info("Successfully executed", .{});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user