[Flint] centralize compute lowering, adding surface messages with GRF
Mirror Gitea refs to GitHub / mirror (push) Successful in 16s
Test / build_and_test (push) Successful in 2m11s
Build / build (push) Successful in 3m18s

allocation
This commit is contained in:
2026-08-27 21:18:05 +02:00
parent 148ed9b441
commit 441d5fbb96
12 changed files with 542 additions and 124 deletions
+16 -2
View File
@@ -64,6 +64,16 @@ fn validateInstruction(inst: instruction.Instruction) Error!void {
try validateSource(op.byte_offset);
try validateSource(op.source);
},
.surface_read => |op| {
try validateBindingTableIndex(op.binding_table);
try validateDestination(op.destination);
try validateSource(op.address);
},
.surface_write => |op| {
try validateBindingTableIndex(op.binding_table);
try validateSource(op.address);
try validateSource(op.data);
},
.move => |op| {
try validateDestination(op.destination);
try validateSource(op.source);
@@ -94,11 +104,15 @@ fn validateInstruction(inst: instruction.Instruction) Error!void {
fn validateBufferReference(reference: instruction.BufferReference) Error!void {
switch (reference) {
.logical => {},
.binding_table => |index| if (index >= compute.resource_layout.max_storage_buffers)
return Error.InvalidBindingTableIndex,
.binding_table => |index| try validateBindingTableIndex(index),
}
}
fn validateBindingTableIndex(index: u8) Error!void {
if (index >= compute.resource_layout.max_storage_buffers)
return Error.InvalidBindingTableIndex;
}
fn validateSource(source: operand.Source) Error!void {
try validateType(source.type);
switch (source.register) {