From ad6a5a88d1a72425fb044ea461a93edddb8020df Mon Sep 17 00:00:00 2001 From: Mel Henning Date: Tue, 27 Jan 2026 15:29:30 -0500 Subject: [PATCH] nak: Handle unspecified tess spacing Reviewed-by: Mary Guillemard Part-of: --- src/nouveau/compiler/nak/api.rs | 5 ++++- src/nouveau/compiler/nak/from_nir.rs | 7 ++++--- src/nouveau/compiler/nak/ir.rs | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/nouveau/compiler/nak/api.rs b/src/nouveau/compiler/nak/api.rs index ffaaa4d05e8..7834ecc98e3 100644 --- a/src/nouveau/compiler/nak/api.rs +++ b/src/nouveau/compiler/nak/api.rs @@ -302,7 +302,10 @@ impl ShaderBin { nak_shader_info__bindgen_ty_1 { ts: nak_shader_info__bindgen_ty_1__bindgen_ty_3 { domain: ts_info.domain as u8, - spacing: ts_info.common.spacing as u8, + spacing: ts_info + .common + .spacing + .map_or(0, |x| x as u8), ccw: ts_info.common.ccw, point_mode: ts_info.common.point_mode, _pad: Default::default(), diff --git a/src/nouveau/compiler/nak/from_nir.rs b/src/nouveau/compiler/nak/from_nir.rs index b4f345b7d0e..5983332796d 100644 --- a/src/nouveau/compiler/nak/from_nir.rs +++ b/src/nouveau/compiler/nak/from_nir.rs @@ -25,12 +25,13 @@ fn init_info_from_nir(nak: &nak_compiler, nir: &nir_shader) -> ShaderInfo { let tess_common = |info_tess: &shader_info_tess| TesselationCommonShaderInfo { spacing: match info_tess.spacing() { - TESS_SPACING_EQUAL => TessellationSpacing::Integer, + TESS_SPACING_UNSPECIFIED => None, + TESS_SPACING_EQUAL => Some(TessellationSpacing::Integer), TESS_SPACING_FRACTIONAL_ODD => { - TessellationSpacing::FractionalOdd + Some(TessellationSpacing::FractionalOdd) } TESS_SPACING_FRACTIONAL_EVEN => { - TessellationSpacing::FractionalEven + Some(TessellationSpacing::FractionalEven) } _ => panic!("Invalid gl_tess_spacing"), }, diff --git a/src/nouveau/compiler/nak/ir.rs b/src/nouveau/compiler/nak/ir.rs index bf1c9303fe7..1b1484cb9cf 100644 --- a/src/nouveau/compiler/nak/ir.rs +++ b/src/nouveau/compiler/nak/ir.rs @@ -9149,7 +9149,7 @@ pub enum TessellationSpacing { #[derive(Debug)] pub struct TesselationCommonShaderInfo { - pub spacing: TessellationSpacing, + pub spacing: Option, pub ccw: bool, pub point_mode: bool, }