iris: invalidate sysvals if grid dimension changes

Cc: mesa-stable
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18581>
(cherry picked from commit 9ccdd86b9040b265893712f4125d30552e0fe1cd)
This commit is contained in:
Karol Herbst 2022-09-17 19:59:56 +02:00 committed by Dylan Baker
parent 9a92cd91c2
commit 842759cf77
4 changed files with 10 additions and 1 deletions

View File

@ -1966,7 +1966,7 @@
"description": "iris: invalidate sysvals if grid dimension changes",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null
},

View File

@ -83,6 +83,7 @@ iris_lost_context_state(struct iris_batch *batch)
memset(&ice->shaders.urb, 0, sizeof(ice->shaders.urb));
memset(ice->state.last_block, 0, sizeof(ice->state.last_block));
memset(ice->state.last_grid, 0, sizeof(ice->state.last_grid));
ice->state.last_grid_dim = 0;
batch->last_binder_address = ~0ull;
batch->last_aux_map_state = 0;
batch->screen->vtbl.lost_genx_state(ice, batch);

View File

@ -749,6 +749,8 @@ struct iris_context {
/** The last compute grid size */
uint32_t last_grid[3];
/** The last compute grid dimensions */
uint32_t last_grid_dim;
/** Reference to the BO containing the compute grid size */
struct iris_state_ref grid_size;
/** Reference to the SURFACE_STATE for the compute grid resource */

View File

@ -408,6 +408,12 @@ iris_launch_grid(struct pipe_context *ctx, const struct pipe_grid_info *grid)
ice->state.shaders[MESA_SHADER_COMPUTE].sysvals_need_upload = true;
}
if (ice->state.last_grid_dim != grid->work_dim) {
ice->state.last_grid_dim = grid->work_dim;
ice->state.stage_dirty |= IRIS_STAGE_DIRTY_CONSTANTS_CS;
ice->state.shaders[MESA_SHADER_COMPUTE].sysvals_need_upload = true;
}
iris_update_grid_size_resource(ice, grid);
iris_binder_reserve_compute(ice);