From 1aa0b2777d86336204edd82afd8a79e5d4e367fc Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 3 Sep 2021 10:06:22 -0400 Subject: [PATCH] zink: simplify shader variant update loop a single continue makes this much easier to read Reviewed-by: Dave Airlie Part-of: --- src/gallium/drivers/zink/zink_program.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gallium/drivers/zink/zink_program.c b/src/gallium/drivers/zink/zink_program.c index bc206c13142..c46121f2c2f 100644 --- a/src/gallium/drivers/zink/zink_program.c +++ b/src/gallium/drivers/zink/zink_program.c @@ -162,11 +162,11 @@ update_shader_modules(struct zink_context *ctx, u_foreach_bit(pstage, mask) { assert(prog->shaders[pstage]); struct zink_shader_module *zm = get_shader_module_for_stage(ctx, screen, prog->shaders[pstage], prog, state); - if (prog->modules[pstage] != zm) { - if (prog->modules[pstage]) - variant_hash ^= prog->modules[pstage]->hash; - hash_changed = true; - } + if (prog->modules[pstage] == zm) + continue; + if (prog->modules[pstage]) + variant_hash ^= prog->modules[pstage]->hash; + hash_changed = true; default_variants &= zm->default_variant; prog->modules[pstage] = zm; variant_hash ^= prog->modules[pstage]->hash;