iris: Normalize all compute shaders to MESA_SHADER_COMPUTE

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6405>
This commit is contained in:
Jason Ekstrand 2020-08-21 11:31:18 -05:00 committed by Marge Bot
parent d0a8ad77e9
commit b4b39b802b
2 changed files with 8 additions and 1 deletions

View 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,
};
/**

View 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;