Skip to content

radv, ac/nir: Fix multiview layer export for mesh shaders.

Timur Kristóf requested to merge Venemo/mesa:radv_mesh_layer_fix into main

MR !15456 (merged) broke multiview with mesh shaders. This commit aims to fix this. Unfortunately, radv_lower_multiview is not suitable for mesh shaders because it can't know the mapping between API mesh shader invocations and output primitives.

There were also other issues:

  • layer is an arrayed output in mesh shaders
  • storing to this output in mesh shaders also needs an array index
  • the pass won't work correctly if the number of output primitives is different than the number of mesh shader invocations, or when a mesh shader invocation creates more than 1 primitive

This MR solves this in ac_nir_lower_ngg which has knowledge of all the above, and will now write this output properly at the end on the primitive export threads.

Merge request reports