adding some operators, working on example
Some checks failed
Build / build (push) Failing after 33s
Test / build (push) Failing after 3m0s

This commit is contained in:
2026-01-20 21:52:42 +01:00
parent 35099b33e1
commit df711a196a
11 changed files with 170 additions and 68 deletions

View File

@@ -1,3 +1,33 @@
//! A small footprint SPIR-V interpreter with zero dependencies to execute SPIR-V shaders on the CPU. It is designed to be used with multiple runtimes concurrently.
//!
//! ```zig
//! const std = @import("std");
//! const spv = @import("spv");
//!
//! const shader_source = @embedFile("shader.spv");
//!
//! pub fn main() !void {
//! {
//! var gpa: std.heap.DebugAllocator(.{}) = .init;
//! defer _ = gpa.deinit();
//!
//! const allocator = gpa.allocator();
//!
//! 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);
//!
//! try rt.callEntryPoint(allocator, try rt.getEntryPointByName("main"));
//! var output: [4]f32 = undefined;
//! try rt.readOutput(f32, output[0..output.len], try rt.getResultByName("color"));
//! std.log.info("Output: Vec4{any}", .{output});
//! }
//! std.log.info("Successfully executed", .{});
//! }
//! ```
const std = @import("std");
pub const Image = @import("Image.zig");
@@ -6,11 +36,3 @@ pub const Runtime = @import("Runtime.zig");
const opcodes = @import("opcodes.zig");
const spv = @import("spv.zig");
test {
std.testing.refAllDecls(Image);
std.testing.refAllDecls(Module);
std.testing.refAllDecls(Runtime);
std.testing.refAllDecls(opcodes);
std.testing.refAllDecls(spv);
}