Mesa (master): iris: Normalize all compute shaders to MESA_SHADER_COMPUTE

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Aug 21 22:58:47 UTC 2020


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

Author: Jason Ekstrand <jason at jlekstrand.net>
Date:   Fri Aug 21 11:31:18 2020 -0500

iris: Normalize all compute shaders to MESA_SHADER_COMPUTE

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6405>

---

 src/gallium/drivers/iris/iris_disk_cache.c | 1 -
 src/gallium/drivers/iris/iris_program.c    | 8 ++++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/iris/iris_disk_cache.c b/src/gallium/drivers/iris/iris_disk_cache.c
index 47da9e670e6..0383512b295 100644
--- a/src/gallium/drivers/iris/iris_disk_cache.c
+++ b/src/gallium/drivers/iris/iris_disk_cache.c
@@ -132,7 +132,6 @@ static const enum iris_program_cache_id cache_id_for_stage[] = {
    [MESA_SHADER_GEOMETRY]  = IRIS_CACHE_GS,
    [MESA_SHADER_FRAGMENT]  = IRIS_CACHE_FS,
    [MESA_SHADER_COMPUTE]   = IRIS_CACHE_CS,
-   [MESA_SHADER_KERNEL]    = IRIS_CACHE_CS,
 };
 
 /**
diff --git a/src/gallium/drivers/iris/iris_program.c b/src/gallium/drivers/iris/iris_program.c
index 7d63bc185e0..bdad2abcf70 100644
--- a/src/gallium/drivers/iris/iris_program.c
+++ b/src/gallium/drivers/iris/iris_program.c
@@ -2415,6 +2415,14 @@ iris_create_compute_state(struct pipe_context *ctx,
       unreachable("Unsupported IR");
    }
 
+   /* Most of iris doesn't really care about the difference between compute
+    * shaders and kernels.  We also tend to hard-code COMPUTE everywhere so
+    * it's way easier if we just normalize to COMPUTE here.
+    */
+   assert(nir->info.stage == MESA_SHADER_COMPUTE ||
+          nir->info.stage == MESA_SHADER_KERNEL);
+   nir->info.stage = MESA_SHADER_COMPUTE;
+
    struct iris_uncompiled_shader *ish =
       iris_create_uncompiled_shader(ctx, nir, NULL);
    ish->kernel_input_size = state->req_input_mem;



More information about the mesa-commit mailing list