iris: Unify iris_delete_[shader stage]_state functions
This is in prepartion for using the live shader cache. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11229>
This commit is contained in:
@@ -2555,11 +2555,13 @@ iris_create_compute_state(struct pipe_context *ctx,
|
|||||||
* Frees the iris_uncompiled_shader.
|
* Frees the iris_uncompiled_shader.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
iris_delete_shader_state(struct pipe_context *ctx, void *state, gl_shader_stage stage)
|
iris_delete_shader_state(struct pipe_context *ctx, void *state)
|
||||||
{
|
{
|
||||||
struct iris_uncompiled_shader *ish = state;
|
struct iris_uncompiled_shader *ish = state;
|
||||||
struct iris_context *ice = (void *) ctx;
|
struct iris_context *ice = (void *) ctx;
|
||||||
|
|
||||||
|
const gl_shader_stage stage = ish->nir->info.stage;
|
||||||
|
|
||||||
if (ice->shaders.uncompiled[stage] == ish) {
|
if (ice->shaders.uncompiled[stage] == ish) {
|
||||||
ice->shaders.uncompiled[stage] = NULL;
|
ice->shaders.uncompiled[stage] = NULL;
|
||||||
ice->state.stage_dirty |= IRIS_STAGE_DIRTY_UNCOMPILED_VS << stage;
|
ice->state.stage_dirty |= IRIS_STAGE_DIRTY_UNCOMPILED_VS << stage;
|
||||||
@@ -2579,42 +2581,6 @@ iris_delete_shader_state(struct pipe_context *ctx, void *state, gl_shader_stage
|
|||||||
free(ish);
|
free(ish);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
iris_delete_vs_state(struct pipe_context *ctx, void *state)
|
|
||||||
{
|
|
||||||
iris_delete_shader_state(ctx, state, MESA_SHADER_VERTEX);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
iris_delete_tcs_state(struct pipe_context *ctx, void *state)
|
|
||||||
{
|
|
||||||
iris_delete_shader_state(ctx, state, MESA_SHADER_TESS_CTRL);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
iris_delete_tes_state(struct pipe_context *ctx, void *state)
|
|
||||||
{
|
|
||||||
iris_delete_shader_state(ctx, state, MESA_SHADER_TESS_EVAL);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
iris_delete_gs_state(struct pipe_context *ctx, void *state)
|
|
||||||
{
|
|
||||||
iris_delete_shader_state(ctx, state, MESA_SHADER_GEOMETRY);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
iris_delete_fs_state(struct pipe_context *ctx, void *state)
|
|
||||||
{
|
|
||||||
iris_delete_shader_state(ctx, state, MESA_SHADER_FRAGMENT);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
iris_delete_cs_state(struct pipe_context *ctx, void *state)
|
|
||||||
{
|
|
||||||
iris_delete_shader_state(ctx, state, MESA_SHADER_COMPUTE);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The pipe->bind_[stage]_state() driver hook.
|
* The pipe->bind_[stage]_state() driver hook.
|
||||||
*
|
*
|
||||||
@@ -2766,12 +2732,12 @@ iris_init_program_functions(struct pipe_context *ctx)
|
|||||||
ctx->create_fs_state = iris_create_fs_state;
|
ctx->create_fs_state = iris_create_fs_state;
|
||||||
ctx->create_compute_state = iris_create_compute_state;
|
ctx->create_compute_state = iris_create_compute_state;
|
||||||
|
|
||||||
ctx->delete_vs_state = iris_delete_vs_state;
|
ctx->delete_vs_state = iris_delete_shader_state;
|
||||||
ctx->delete_tcs_state = iris_delete_tcs_state;
|
ctx->delete_tcs_state = iris_delete_shader_state;
|
||||||
ctx->delete_tes_state = iris_delete_tes_state;
|
ctx->delete_tes_state = iris_delete_shader_state;
|
||||||
ctx->delete_gs_state = iris_delete_gs_state;
|
ctx->delete_gs_state = iris_delete_shader_state;
|
||||||
ctx->delete_fs_state = iris_delete_fs_state;
|
ctx->delete_fs_state = iris_delete_shader_state;
|
||||||
ctx->delete_compute_state = iris_delete_cs_state;
|
ctx->delete_compute_state = iris_delete_shader_state;
|
||||||
|
|
||||||
ctx->bind_vs_state = iris_bind_vs_state;
|
ctx->bind_vs_state = iris_bind_vs_state;
|
||||||
ctx->bind_tcs_state = iris_bind_tcs_state;
|
ctx->bind_tcs_state = iris_bind_tcs_state;
|
||||||
|
Reference in New Issue
Block a user