[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
+4 -20
View File
@@ -6,39 +6,23 @@ const common_ir = @import("../lower/common_ir.zig");
pub const gen9 = @import("gen9/gen9.zig");
pub const ComputeArtifact = gen9.ComputeArtifact;
pub const ComputeResourceLayout = gen9.compute.ResourceLayout;
pub const ResourceLayoutError = gen9.compute.resource_layout.Error || error{UnsupportedGeneration};
pub const ResourceLoweringError = gen9.ResourceLoweringError || error{UnsupportedGeneration};
pub const Error = gen9.Error || error{UnsupportedGeneration};
pub const ValidationError = gen9.validator.Error || error{UnsupportedGeneration};
pub fn lower(
pub fn compileCompute(
allocator: std.mem.Allocator,
module: *shader_ir.module.Module,
device_info: device.DeviceInfo,
options: common_ir.Options,
) Error!program_ir.Program {
) Error!ComputeArtifact {
return switch (device_info.generation) {
.gen9 => gen9.lower(allocator, module, device_info, options),
.gen9 => gen9.compileCompute(allocator, module, device_info, options),
.gen10, .gen11 => Error.UnsupportedGeneration,
};
}
pub fn layoutComputeResources(allocator: std.mem.Allocator, program: *const program_ir.Program) ResourceLayoutError!ComputeResourceLayout {
return switch (program.device_info.generation) {
.gen9 => ComputeResourceLayout.init(allocator, program),
.gen10, .gen11 => ResourceLayoutError.UnsupportedGeneration,
};
}
pub fn lowerComputeResources(program: *program_ir.Program, layout: *const ComputeResourceLayout) ResourceLoweringError!void {
return switch (program.device_info.generation) {
.gen9 => gen9.lowerComputeResources(program, layout),
.gen10, .gen11 => ResourceLoweringError.UnsupportedGeneration,
};
}
pub fn validate(program: *const program_ir.Program) ValidationError!void {
return switch (program.device_info.generation) {
.gen9 => gen9.validator.validate(program),