nak: Handle unspecified tess spacing

Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39571>
This commit is contained in:
Mel Henning 2026-01-27 15:29:30 -05:00 committed by Marge Bot
parent f9831e356b
commit ad6a5a88d1
3 changed files with 9 additions and 5 deletions

View file

@ -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(),

View file

@ -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"),
},

View file

@ -9149,7 +9149,7 @@ pub enum TessellationSpacing {
#[derive(Debug)]
pub struct TesselationCommonShaderInfo {
pub spacing: TessellationSpacing,
pub spacing: Option<TessellationSpacing>,
pub ccw: bool,
pub point_mode: bool,
}