Mesa (master): tu: Remove num_samp hack

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jun 17 13:31:01 UTC 2020


Module: Mesa
Branch: master
Commit: b1700698a58dcdca8ba0fe738514a8b23b0e8572
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b1700698a58dcdca8ba0fe738514a8b23b0e8572

Author: Connor Abbott <cwabbott0 at gmail.com>
Date:   Wed Jun 17 13:02:49 2020 +0200

tu: Remove num_samp hack

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 | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/freedreno/vulkan/tu_shader.c b/src/freedreno/vulkan/tu_shader.c
index 3d9bab5830a..df99fe6cd9c 100644
--- a/src/freedreno/vulkan/tu_shader.c
+++ b/src/freedreno/vulkan/tu_shader.c
@@ -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
     */



More information about the mesa-commit mailing list