zink: verify program key sizes before checking for default variant

currently keys for shaders are always the same size, but this will change
in the future, at which point the keysize becomes relevant

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12547>
This commit is contained in:
Mike Blumenkrantz
2021-08-25 16:13:10 -04:00
committed by Marge Bot
parent 4a3395f35a
commit 325fbc3fd2
+1 -1
View File
@@ -208,7 +208,7 @@ get_shader_module_for_stage(struct zink_context *ctx, struct zink_shader *zs, st
/* if comparing against the existing default, use the base variant key size since
* we're only checking the stage-specific data
*/
key.is_default_variant = !memcmp(tmp->data, &key, key.size);
key.is_default_variant = tmp->size == key.size && !memcmp(tmp->data, &key, key.size);
} else
key.is_default_variant = true;