[Flint] adding compute resource layout lowering
Mirror Gitea refs to GitHub / mirror (push) Successful in 18s
Test / build_and_test (push) Successful in 2m12s
Build / build (push) Successful in 3m21s

This commit is contained in:
2026-08-14 20:41:31 +02:00
parent 8c934c7328
commit 04ff263b40
13 changed files with 484 additions and 64 deletions
+9 -2
View File
@@ -120,7 +120,7 @@ fn writeOperation(program: *const program_ir.Program, writer: *std.Io.Writer, ex
try writer.writeAll("load_buffer ");
try writeDestination(program, writer, execution_size, op.destination);
try writer.writeAll(", ");
try writeStorageBufferRef(program, writer, op.buffer);
try writeBufferReference(program, writer, op.buffer);
try writer.writeAll(", ");
try writeSource(program, writer, execution_size, op.byte_offset);
if (op.immediate_offset != 0)
@@ -128,7 +128,7 @@ fn writeOperation(program: *const program_ir.Program, writer: *std.Io.Writer, ex
},
.store_buffer => |op| {
try writer.writeAll("store_buffer ");
try writeStorageBufferRef(program, writer, op.buffer);
try writeBufferReference(program, writer, op.buffer);
try writer.writeAll(", ");
try writeSource(program, writer, execution_size, op.byte_offset);
if (op.immediate_offset != 0)
@@ -356,6 +356,13 @@ fn writeFlagRef(program: *const program_ir.Program, writer: *std.Io.Writer, flag
}
}
fn writeBufferReference(program: *const program_ir.Program, writer: *std.Io.Writer, reference: inst_ir.BufferReference) !void {
switch (reference) {
.logical => |buffer| try writeStorageBufferRef(program, writer, buffer),
.binding_table => |index| try writer.print("bti({d})", .{index}),
}
}
fn writeStorageBufferRef(program: *const program_ir.Program, writer: *std.Io.Writer, buffer_id: ids.StorageBufferId) !void {
const buffer = program.storage_buffers.get(buffer_id);
try writeNamedRef(writer, if (buffer) |value| value.name else null, "buffer", buffer_id.index(), '@');