tiny.choir.backends.gpu.spirv.emitter.plan
Defined in backends.gpu.spirv.emitter.
API (2)
Actions
Public operations.
emitPlanWords: Emitsmoduleand returns the layout ofentry_name's push-constant block.
Types and contracts
Public types and contracts.
Emission: SPIR-V words for one module, and the push-constant layout the emitter gave the requested entry.
Source
Source: lib/choir/src/backends/gpu/spirv/emitter/plan.zig
zig
const std = @import("std");const abi = @import("choir_abi");const choir = @import("../../../../root.zig");const codegen = @import("codegen.zig");const ir = choir.ir;/// SPIR-V words for one module, and the push-constant layout the emitter gave/// the requested entry.pub const Emission = struct { words: []u32, push_constants: abi.PushConstants,};/// Emits `module` and returns the layout of `entry_name`'s push-constant/// block. A hand-written `spirv.module` declares no block, so its layout is/// empty. `controls` contains only float modes the selected device reports.pub fn emitPlanWords( result_allocator: std.mem.Allocator, module: *ir.Operation, entry_name: []const u8, limits: abi.Limits, controls: codegen.FloatControls,) abi.Error!Emission { std.debug.assert(entry_name.len > 0); std.debug.assert(limits.valid()); var emitter = codegen.SpirvCodegen.init(result_allocator); defer emitter.deinit(); emitter.limits = limits; emitter.entry_name = entry_name; emitter.float_controls = controls; const words = emitter.emitModuleWords(module) catch |err| return mapCodegenError(err); return .{ .words = words, .push_constants = emitter.entry_push_constants orelse .{} };}fn mapCodegenError(err: codegen.SpirvCodegenError) abi.Error { return switch (err) { error.OutOfMemory => error.OutOfMemory, error.UnsupportedOperation, error.UnsupportedStageMemory, error.UnsupportedHelperSignature => error.UnsupportedOperation, error.UnsupportedFunctionSignature, error.UnsupportedType, error.UnsupportedMask, error.UnsupportedAddressSpace, error.UnsupportedControlFlow, => error.CapabilityMismatch, else => error.InvalidArtifact, };}test { std.testing.refAllDecls(@This());}Source: lib/choir/src/backends/gpu/spirv/emitter/root.zig:8
zig
pub const plan = @import("plan.zig");Audit
| Definitions | 3 |
|---|---|
| Public names | 4 |
| Members | 2 |
| Version | 26.7.0 |
| Revision | daab053ee433 |