[Flint] centralize compute lowering, adding surface messages with GRF
allocation
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user