radv: skip radv_remove_varyings for mesh shaders
authorRhys Perry <pendingchaos02@gmail.com>
Wed, 11 Oct 2023 13:46:20 +0000 (14:46 +0100)
committerEric Engestrom <eric@engestrom.ch>
Sat, 4 Nov 2023 14:15:53 +0000 (14:15 +0000)
Fixes compilation of a Talos Principle 2 shader.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Fixes: 9fa9782c1790 ("radv: stop compiling a noop FS when the application doesn't provide a FS")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25659>
(cherry picked from commit 0a418561dab43a41f21ab209367f88c2ed9eb4a5)

.pick_status.json
src/amd/vulkan/radv_pipeline_graphics.c

index 1d6ce7f..e3d7b94 100644 (file)
         "description": "radv: skip radv_remove_varyings for mesh shaders",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "9fa9782c1790e049be66d3bcd383fb3fdb79e1c5",
         "notes": null
index 9b648db..72ed969 100644 (file)
@@ -1627,6 +1627,12 @@ radv_pipeline_needs_noop_fs(struct radv_graphics_pipeline *pipeline, const struc
 static void
 radv_remove_varyings(nir_shader *nir)
 {
+   /* We can't demote mesh outputs to nir_var_shader_temp yet, because
+    * they don't support array derefs of vectors.
+    */
+   if (nir->info.stage == MESA_SHADER_MESH)
+      return;
+
    bool fixup_derefs = false;
 
    nir_foreach_shader_out_variable (var, nir) {