diff options
author | Mike Blumenkrantz <michael.blumenkrantz@gmail.com> | 2021-11-09 19:42:16 -0500 |
---|---|---|
committer | Eric Engestrom <eric@engestrom.ch> | 2021-11-10 21:58:07 +0000 |
commit | 0f40fdd4d9bad458fd568ee814d32116ede7b2d1 (patch) | |
tree | da562281db18ca522642ffa08909b4c0e09d5780 | |
parent | 6108b3c7f2f9c2a785df6f7c238a77035b3e109f (diff) | |
download | mesa-0f40fdd4d9bad458fd568ee814d32116ede7b2d1.tar.gz |
zink: be more consistent about applying module hash for gfx pipeline
this was a little spaghetti-ish: the module hash was sometimes being applied
during module update, sometimes in draw during program create, and then also
it was removed when a shader unbind would cause the program to no longer be reachable
now things are more consistent:
* keep removing module hash when program becomes unreachable
* only apply module hash in draw during updates there
cc: mesa-stable
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13727>
(cherry picked from commit bfa81c1e8c8f1885ab63c4c09e57e4c0bbb37bb2)
-rw-r--r-- | .pick_status.json | 2 | ||||
-rw-r--r-- | src/gallium/drivers/zink/zink_draw.cpp | 4 | ||||
-rw-r--r-- | src/gallium/drivers/zink/zink_program.c | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/.pick_status.json b/.pick_status.json index 3906dad1dfa..f813abcab23 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -94,7 +94,7 @@ "description": "zink: be more consistent about applying module hash for gfx pipeline", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/gallium/drivers/zink/zink_draw.cpp b/src/gallium/drivers/zink/zink_draw.cpp index c1bbe5d49ee..b724f962bcc 100644 --- a/src/gallium/drivers/zink/zink_draw.cpp +++ b/src/gallium/drivers/zink/zink_draw.cpp @@ -207,7 +207,11 @@ update_gfx_program(struct zink_context *ctx) ctx->gfx_pipeline_state.final_hash ^= ctx->curr_program->last_variant_hash; ctx->gfx_dirty = false; } else if (ctx->dirty_shader_stages & bits) { + /* remove old hash */ + ctx->gfx_pipeline_state.final_hash ^= ctx->curr_program->last_variant_hash; zink_update_gfx_program(ctx, ctx->curr_program); + /* apply new hash */ + ctx->gfx_pipeline_state.final_hash ^= ctx->curr_program->last_variant_hash; } ctx->dirty_shader_stages &= ~bits; } diff --git a/src/gallium/drivers/zink/zink_program.c b/src/gallium/drivers/zink/zink_program.c index 8c23d57851e..bfa06611d02 100644 --- a/src/gallium/drivers/zink/zink_program.c +++ b/src/gallium/drivers/zink/zink_program.c @@ -179,9 +179,6 @@ update_shader_modules(struct zink_context *ctx, } if (hash_changed && state) { - if (!first && likely(state->pipeline)) //avoid on first hash - state->final_hash ^= prog->last_variant_hash; - if (default_variants && !first) prog->last_variant_hash = prog->default_variant_hash; else { @@ -192,7 +189,6 @@ update_shader_modules(struct zink_context *ctx, } } - state->final_hash ^= prog->last_variant_hash; state->modules_changed = true; } } |