zink: assert that pstage is within range
This makes it clearer that these don't include the compute-stage. Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9898>
This commit is contained in:
parent
2de07d1ad2
commit
c0609b1585
|
@ -856,6 +856,7 @@ zink_shader_free(struct zink_context *ctx, struct zink_shader *shader)
|
||||||
} else {
|
} else {
|
||||||
struct zink_gfx_program *prog = (void*)entry->key;
|
struct zink_gfx_program *prog = (void*)entry->key;
|
||||||
enum pipe_shader_type pstage = pipe_shader_type_from_mesa(shader->nir->info.stage);
|
enum pipe_shader_type pstage = pipe_shader_type_from_mesa(shader->nir->info.stage);
|
||||||
|
assert(pstage < ZINK_SHADER_COUNT);
|
||||||
bool in_use = prog == ctx->curr_program;
|
bool in_use = prog == ctx->curr_program;
|
||||||
if (shader->nir->info.stage != MESA_SHADER_TESS_CTRL || !shader->is_generated)
|
if (shader->nir->info.stage != MESA_SHADER_TESS_CTRL || !shader->is_generated)
|
||||||
_mesa_hash_table_remove_key(ctx->program_cache, prog->shaders);
|
_mesa_hash_table_remove_key(ctx->program_cache, prog->shaders);
|
||||||
|
|
|
@ -374,6 +374,7 @@ update_shader_modules(struct zink_context *ctx, struct zink_shader *stages[ZINK_
|
||||||
|
|
||||||
for (int i = 0; i < ZINK_SHADER_COUNT; ++i) {
|
for (int i = 0; i < ZINK_SHADER_COUNT; ++i) {
|
||||||
enum pipe_shader_type type = pipe_shader_type_from_mesa(i);
|
enum pipe_shader_type type = pipe_shader_type_from_mesa(i);
|
||||||
|
assert(type < ZINK_SHADER_COUNT);
|
||||||
if (dirty[i]) {
|
if (dirty[i]) {
|
||||||
struct zink_shader_module *zm;
|
struct zink_shader_module *zm;
|
||||||
zm = get_shader_module_for_stage(ctx, dirty[i], prog);
|
zm = get_shader_module_for_stage(ctx, dirty[i], prog);
|
||||||
|
@ -790,7 +791,7 @@ static void
|
||||||
gfx_program_remove_shader(struct zink_gfx_program *prog, struct zink_shader *shader)
|
gfx_program_remove_shader(struct zink_gfx_program *prog, struct zink_shader *shader)
|
||||||
{
|
{
|
||||||
enum pipe_shader_type p_stage = pipe_shader_type_from_mesa(shader->nir->info.stage);
|
enum pipe_shader_type p_stage = pipe_shader_type_from_mesa(shader->nir->info.stage);
|
||||||
|
assert(p_stage < ZINK_SHADER_COUNT);
|
||||||
assert(prog->shaders[p_stage] == shader);
|
assert(prog->shaders[p_stage] == shader);
|
||||||
prog->shaders[p_stage] = NULL;
|
prog->shaders[p_stage] = NULL;
|
||||||
_mesa_set_remove_key(shader->programs, prog);
|
_mesa_set_remove_key(shader->programs, prog);
|
||||||
|
|
Loading…
Reference in New Issue