tu: Remove num_samp hack
authorConnor Abbott <cwabbott0@gmail.com>
Wed, 17 Jun 2020 11:02:49 +0000 (13:02 +0200)
committerMarge Bot <eric+marge@anholt.net>
Wed, 17 Jun 2020 13:13:05 +0000 (13:13 +0000)
Delete the variables so that ir3 thinks there are no samplers and
images instead.

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

src/freedreno/vulkan/tu_shader.c

index 3d9bab5830a5472cb1e678f2b8ea013463e05d77..df99fe6cd9cd52fee9ed9cbc6257c50ba86f000e 100644 (file)
@@ -484,6 +484,13 @@ tu_lower_io(nir_shader *shader, struct tu_shader *tu_shader,
          progress |= lower_impl(function->impl, tu_shader, layout);
    }
 
+   /* Remove now-unused variables so that when we gather the shader info later
+    * they won't be counted.
+    */
+   nir_remove_dead_variables(shader,
+                             nir_var_uniform | nir_var_mem_ubo | nir_var_mem_ssbo,
+                             NULL);
+
    return progress;
 }
 
@@ -741,9 +748,6 @@ tu_compile_shader_variant(struct ir3_shader *shader,
    if (ret)
       return NULL;
 
-   /* num_samp should be 0 for bindless, but we use it with blit shader */
-   variant->num_samp = 0;
-
    /* when assemble fails, we rely on tu_shader_destroy to clean up the
     * variant
     */