Commit 162fc7bd authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Properly compare integers in wined3d_bo_slab_vk_compare().

parent 18a6d9ab
...@@ -1883,12 +1883,13 @@ static int wined3d_bo_slab_vk_compare(const void *key, const struct wine_rb_entr ...@@ -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 *slab = WINE_RB_ENTRY_VALUE(entry, const struct wined3d_bo_slab_vk, entry);
const struct wined3d_bo_slab_vk_key *k = key; const struct wined3d_bo_slab_vk_key *k = key;
int ret;
if (k->memory_type != slab->requested_memory_type) if ((ret = wined3d_uint32_compare(k->memory_type, slab->requested_memory_type)))
return k->memory_type - slab->requested_memory_type; return ret;
if (k->usage != slab->bo.usage) if ((ret = wined3d_uint32_compare(k->usage, slab->bo.usage)))
return k->usage - slab->bo.usage; return ret;
return k->size - slab->bo.size; return wined3d_uint64_compare(k->size, slab->bo.size);
} }
static void wined3d_context_vk_init_graphics_pipeline_key(struct wined3d_context_vk *context_vk) static void wined3d_context_vk_init_graphics_pipeline_key(struct wined3d_context_vk *context_vk)
......
...@@ -452,6 +452,11 @@ static inline int wined3d_uint32_compare(uint32_t x, uint32_t y) ...@@ -452,6 +452,11 @@ static inline int wined3d_uint32_compare(uint32_t x, uint32_t y)
return (x > y) - (x < 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_BACKBUFFER 0
#define ORM_FBO 1 #define ORM_FBO 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment