From f5805dadab3eca8076a66cfe98b2ac7ef2c63aba Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Fri, 29 Sep 2023 18:28:48 -0500 Subject: [PATCH] nak: NVIDIA calls them tessellation init shaders Part-of: --- src/nouveau/compiler/nak_from_nir.rs | 2 +- src/nouveau/compiler/nak_ir.rs | 4 ++-- src/nouveau/compiler/nak_sph.rs | 12 ++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/nouveau/compiler/nak_from_nir.rs b/src/nouveau/compiler/nak_from_nir.rs index 092d9ca6329..d55b3aa87d2 100644 --- a/src/nouveau/compiler/nak_from_nir.rs +++ b/src/nouveau/compiler/nak_from_nir.rs @@ -61,7 +61,7 @@ fn init_info_from_nir(nir: &nir_shader, sm: u8) -> ShaderInfo { }) } MESA_SHADER_TESS_CTRL => { - ShaderStageInfo::TessellationControl(Default::default()) + ShaderStageInfo::TessellationInit(Default::default()) } MESA_SHADER_TESS_EVAL => ShaderStageInfo::Tessellation, _ => panic!("Unknown shader stage"), diff --git a/src/nouveau/compiler/nak_ir.rs b/src/nouveau/compiler/nak_ir.rs index 3d0487a8280..6ea28ab706c 100644 --- a/src/nouveau/compiler/nak_ir.rs +++ b/src/nouveau/compiler/nak_ir.rs @@ -4708,7 +4708,7 @@ impl Default for GeometryShaderInfo { } #[derive(Debug, Default)] -pub struct TessellationControlShaderInfo { +pub struct TessellationInitShaderInfo { pub per_patch_attribute_count: u8, pub threads_per_patch: u8, } @@ -4719,7 +4719,7 @@ pub enum ShaderStageInfo { Vertex, Fragment, Geometry(GeometryShaderInfo), - TessellationControl(TessellationControlShaderInfo), + TessellationInit(TessellationInitShaderInfo), Tessellation, } diff --git a/src/nouveau/compiler/nak_sph.rs b/src/nouveau/compiler/nak_sph.rs index 5489ee7bee6..a5557d38fb3 100644 --- a/src/nouveau/compiler/nak_sph.rs +++ b/src/nouveau/compiler/nak_sph.rs @@ -22,7 +22,7 @@ type SubSPHView<'a> = BitMutView<'a, [u32; CURRENT_MAX_SHADER_HEADER_SIZE]>; #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum ShaderType { Vertex, - TessellationControl, + TessellationInit, Tessellation, Geometry, Fragment, @@ -34,8 +34,8 @@ impl From<&ShaderStageInfo> for ShaderType { ShaderStageInfo::Vertex => ShaderType::Vertex, ShaderStageInfo::Fragment => ShaderType::Fragment, ShaderStageInfo::Geometry(_) => ShaderType::Geometry, - ShaderStageInfo::TessellationControl(_) => { - ShaderType::TessellationControl + ShaderStageInfo::TessellationInit(_) => { + ShaderType::TessellationInit } ShaderStageInfo::Tessellation => ShaderType::Tessellation, _ => panic!("Invalid ShaderStageInfo {:?}", value), @@ -212,7 +212,7 @@ impl ShaderProgramHeader { 10..14, match shader_type { ShaderType::Vertex => 1_u8, - ShaderType::TessellationControl => 2_u8, + ShaderType::TessellationInit => 2_u8, ShaderType::Tessellation => 3_u8, ShaderType::Geometry => 4_u8, ShaderType::Fragment => 5_u8, @@ -275,7 +275,7 @@ impl ShaderProgramHeader { &mut self, per_patch_attribute_count: u8, ) { - assert!(self.shader_type == ShaderType::TessellationControl); + assert!(self.shader_type == ShaderType::TessellationInit); // Maxwell changed that encoding. if self.sm > 35 { @@ -468,7 +468,7 @@ pub fn encode_header( sph.set_output_topology(stage.output_topology); sph.set_max_output_vertex_count(stage.max_output_vertex_count); } - ShaderStageInfo::TessellationControl(stage) => { + ShaderStageInfo::TessellationInit(stage) => { sph.set_per_patch_attribute_count(stage.per_patch_attribute_count); sph.set_threads_per_input_primitive(stage.threads_per_patch); }