nir: Don't lower Task/Mesh I/O to temporaries
authorCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Fri, 30 Apr 2021 07:01:28 +0000 (00:01 -0700)
committerMarge Bot <eric+marge@anholt.net>
Sat, 28 Aug 2021 03:56:43 +0000 (03:56 +0000)
These won't work since a workgroup can span more than one thread, and
the temporaries are not shared memory.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10600>

src/compiler/nir/nir_lower_io_to_temporaries.c

index 2cb8235..f767fab 100644 (file)
@@ -328,7 +328,9 @@ nir_lower_io_to_temporaries(nir_shader *shader, nir_function_impl *entrypoint,
 {
    struct lower_io_state state;
 
-   if (shader->info.stage == MESA_SHADER_TESS_CTRL)
+   if (shader->info.stage == MESA_SHADER_TESS_CTRL ||
+       shader->info.stage == MESA_SHADER_TASK ||
+       shader->info.stage == MESA_SHADER_MESH)
       return;
 
    state.shader = shader;