iris: Allocate shader variant in caller of iris_upload_shader

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11229>
This commit is contained in:
Ian Romanick
2021-06-02 12:26:35 -07:00
committed by Marge Bot
parent ca19be1a8d
commit 0e48b1a99d
4 changed files with 54 additions and 38 deletions
@@ -146,6 +146,7 @@ iris_create_shader_variant(const struct iris_screen *screen,
struct iris_compiled_shader *
iris_upload_shader(struct iris_screen *screen,
struct iris_uncompiled_shader *ish,
struct iris_compiled_shader *shader,
struct hash_table *driver_shaders,
struct u_upload_mgr *uploader,
enum iris_program_cache_id cache_id,
@@ -162,11 +163,6 @@ iris_upload_shader(struct iris_screen *screen,
{
const struct intel_device_info *devinfo = &screen->devinfo;
void *mem_ctx = ish ? NULL : (void *) driver_shaders;
struct iris_compiled_shader *shader =
iris_create_shader_variant(screen, mem_ctx, cache_id, key_size, key);
u_upload_alloc(uploader, 0, prog_data->program_size, 64,
&shader->assembly.offset, &shader->assembly.res,
&shader->map);
@@ -280,10 +276,13 @@ iris_blorp_upload_shader(struct blorp_batch *blorp_batch, uint32_t stage,
memset(&bt, 0, sizeof(bt));
struct iris_compiled_shader *shader =
iris_upload_shader(screen, NULL, ice->shaders.cache,
ice->shaders.uploader_driver,
IRIS_CACHE_BLORP, key_size, key, kernel,
prog_data, NULL, NULL, 0, 0, 0, &bt);
iris_create_shader_variant(screen, ice->shaders.cache, IRIS_CACHE_BLORP,
key_size, key);
iris_upload_shader(screen, NULL, shader, ice->shaders.cache,
ice->shaders.uploader_driver,
IRIS_CACHE_BLORP, key_size, key, kernel,
prog_data, NULL, NULL, 0, 0, 0, &bt);
struct iris_bo *bo = iris_resource_bo(shader->assembly.res);
*kernel_out =