mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
vkd3d-shader/spirv: Properly compare integers in vkd3d_spirv_declaration_compare().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
e2c9423611
commit
7e08773d4e
@ -511,11 +511,12 @@ static int vkd3d_spirv_declaration_compare(const void *key, const struct rb_entr
|
||||
{
|
||||
const struct vkd3d_spirv_declaration *a = key;
|
||||
const struct vkd3d_spirv_declaration *b = RB_ENTRY_VALUE(e, const struct vkd3d_spirv_declaration, entry);
|
||||
int ret;
|
||||
|
||||
if (a->op != b->op)
|
||||
return a->op - b->op;
|
||||
if (a->parameter_count != b->parameter_count)
|
||||
return a->parameter_count - b->parameter_count;
|
||||
if ((ret = vkd3d_u32_compare(a->op, b->op)))
|
||||
return ret;
|
||||
if ((ret = vkd3d_u32_compare(a->parameter_count, b->parameter_count)))
|
||||
return ret;
|
||||
assert(a->parameter_count <= ARRAY_SIZE(a->parameters));
|
||||
return memcmp(&a->parameters, &b->parameters, a->parameter_count * sizeof(*a->parameters));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user