zink: don't run update_so_info if shader has no outputs
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Fri, 7 Apr 2023 13:18:00 +0000 (09:18 -0400)
committerMarge Bot <emma+marge@anholt.net>
Thu, 27 Apr 2023 01:33:16 +0000 (01:33 +0000)
this probably means all outputs were eliminated by the linker,
but in any case it's not going to do anything

fixes spec@glsl-1.50@execution@interface-blocks-api-access-members

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22725>

src/gallium/drivers/zink/zink_compiler.c

index 2927070..06806b4 100644 (file)
@@ -5083,7 +5083,7 @@ zink_shader_create(struct zink_screen *screen, struct nir_shader *nir,
    if (!nir->info.internal)
       nir_foreach_shader_out_variable(var, nir)
          var->data.explicit_xfb_buffer = 0;
-   if (so_info && so_info->num_outputs)
+   if (so_info && so_info->num_outputs && nir->info.outputs_written)
       update_so_info(ret, nir, so_info, nir->info.outputs_written, have_psiz);
    else if (have_psiz) {
       bool have_fake_psiz = false;