Signed-off-by: Henri Verbeet hverbeet@codeweavers.com --- dlls/wined3d/context_vk.c | 11 ++++++----- dlls/wined3d/wined3d_private.h | 5 +++++ 2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/dlls/wined3d/context_vk.c b/dlls/wined3d/context_vk.c index cf6247387ca..686c9fe090f 100644 --- a/dlls/wined3d/context_vk.c +++ b/dlls/wined3d/context_vk.c @@ -1883,12 +1883,13 @@ static int wined3d_bo_slab_vk_compare(const void *key, const struct wine_rb_entr { const struct wined3d_bo_slab_vk *slab = WINE_RB_ENTRY_VALUE(entry, const struct wined3d_bo_slab_vk, entry); const struct wined3d_bo_slab_vk_key *k = key; + int ret;
- if (k->memory_type != slab->requested_memory_type) - return k->memory_type - slab->requested_memory_type; - if (k->usage != slab->bo.usage) - return k->usage - slab->bo.usage; - return k->size - slab->bo.size; + if ((ret = wined3d_uint32_compare(k->memory_type, slab->requested_memory_type))) + return ret; + if ((ret = wined3d_uint32_compare(k->usage, slab->bo.usage))) + return ret; + return wined3d_uint64_compare(k->size, slab->bo.size); }
static void wined3d_context_vk_init_graphics_pipeline_key(struct wined3d_context_vk *context_vk) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index e297169b6e1..95a3b08f78a 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -452,6 +452,11 @@ static inline int wined3d_uint32_compare(uint32_t x, uint32_t y) return (x > y) - (x < y); }
+static inline int wined3d_uint64_compare(uint64_t x, uint64_t y) +{ + return (x > y) - (x < y); +} + #define ORM_BACKBUFFER 0 #define ORM_FBO 1