Commit 46c7f66c authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Compare requested memory types in wined3d_bo_slab_vk_compare().

Instead of comparing the requested memory type against what we actually got. For example, we may have gotten coherent memory without having explicitly requested it, in which case wined3d_context_vk_create_slab_bo() would fail to find an existing slab to allocate from. Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 7b2c78c3
......@@ -371,6 +371,7 @@ static bool wined3d_context_vk_create_slab_bo(struct wined3d_context_vk *context
return false;
}
slab->requested_memory_type = memory_type;
if (!wined3d_context_vk_create_bo(context_vk, key.size, usage, memory_type, &slab->bo))
{
ERR("Failed to create slab bo.\n");
......@@ -625,7 +626,7 @@ static void wined3d_bo_slab_vk_free_slice(struct wined3d_bo_slab_vk *slab,
if (!slab->map)
{
key.memory_type = slab->bo.memory_type;
key.memory_type = slab->requested_memory_type;
key.usage = slab->bo.usage;
key.size = slab->bo.size;
......@@ -1677,8 +1678,8 @@ 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;
if (k->memory_type != slab->bo.memory_type)
return k->memory_type - slab->bo.memory_type;
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;
......
......@@ -1626,6 +1626,7 @@ struct wined3d_bo_slab_vk
{
struct wine_rb_entry entry;
struct wined3d_bo_slab_vk *next;
VkMemoryPropertyFlags requested_memory_type;
struct wined3d_bo_vk bo;
unsigned int map_count;
void *map_ptr;
......
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