iris: Normalize all compute shaders to MESA_SHADER_COMPUTE
authorJason Ekstrand <jason@jlekstrand.net>
Fri, 21 Aug 2020 16:31:18 +0000 (11:31 -0500)
committerMarge Bot <eric+marge@anholt.net>
Fri, 21 Aug 2020 22:49:54 +0000 (22:49 +0000)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6405>

src/gallium/drivers/iris/iris_disk_cache.c
src/gallium/drivers/iris/iris_program.c

index 47da9e670e6f91ea16ec5ae7465740ef78c596ca..0383512b2953d76a9b8ee0a9b71bca0092f6b06c 100644 (file)
@@ -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,
 };
 
 /**
index 7d63bc185e025e415de5eea808a8cc65dab0fb86..bdad2abcf708775bfd44aa97f3083ff51e38091d 100644 (file)
@@ -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;