From f6ff11a594e7a18c759a69669ab6fae0ce16f379 Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Fri, 27 Jun 2025 16:23:27 -0400 Subject: [PATCH] nil: Reorder the checks in GOBType::choose() again Match on HW generation first. Blackwell is so totally different that it doesn't make sense to share any code with the others. Part-of: --- src/nouveau/nil/tiling.rs | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/src/nouveau/nil/tiling.rs b/src/nouveau/nil/tiling.rs index 53835c05c5c..1e822b990ca 100644 --- a/src/nouveau/nil/tiling.rs +++ b/src/nouveau/nil/tiling.rs @@ -99,22 +99,30 @@ impl GOBType { dev: &nil_rs_bindings::nv_device_info, format: Format, ) -> GOBType { - if format.is_depth_or_stencil() { - GOBType::FermiZS - } else { - if dev.cls_eng3d >= clcd97::BLACKWELL_A { + if dev.cls_eng3d >= clcd97::BLACKWELL_A { + if format.is_depth_or_stencil() { + GOBType::FermiZS + } else { match format.el_size_B() { 1 => GOBType::Blackwell8Bit, 2 => GOBType::Blackwell16Bit, _ => GOBType::TuringColor2D, } - } else if dev.cls_eng3d >= clc597::TURING_A { - GOBType::TuringColor2D - } else if dev.cls_eng3d >= cl9097::FERMI_A { - GOBType::FermiColor - } else { - panic!("Unsupported 3d engine class") } + } else if dev.cls_eng3d >= clc597::TURING_A { + if format.is_depth_or_stencil() { + GOBType::FermiZS + } else { + GOBType::TuringColor2D + } + } else if dev.cls_eng3d >= cl9097::FERMI_A { + if format.is_depth_or_stencil() { + GOBType::FermiZS + } else { + GOBType::FermiColor + } + } else { + panic!("Unsupported 3d engine class") } }