summaryrefslogtreecommitdiffstats
path: root/src/vulkan
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2015-08-03 00:35:19 -0700
committerJason Ekstrand <[email protected]>2015-08-03 00:35:19 -0700
commit481122f4ac11fff402fa5b0884757462bcb1e933 (patch)
tree4102b7dd883e57976dcf4675c6d451a0682b4bca /src/vulkan
parente65953146c817e8bb98dd91788ad4d46775d40b8 (diff)
vk/allocator: Make a few things more consistant
Diffstat (limited to 'src/vulkan')
-rw-r--r--src/vulkan/anv_allocator.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/vulkan/anv_allocator.c b/src/vulkan/anv_allocator.c
index 96c06fbcc18..04293f0d9be 100644
--- a/src/vulkan/anv_allocator.c
+++ b/src/vulkan/anv_allocator.c
@@ -153,9 +153,9 @@ round_to_power_of_two(uint32_t value)
static bool
anv_free_list_pop(union anv_free_list *list, void **map, uint32_t *offset)
{
- union anv_free_list current, next, old;
+ union anv_free_list current, new, old;
- current = *list;
+ current.u64 = list->u64;
while (current.offset != EMPTY) {
/* We have to add a memory barrier here so that the list head (and
* offset) gets read before we read the map pointer. This way we
@@ -165,9 +165,9 @@ anv_free_list_pop(union anv_free_list *list, void **map, uint32_t *offset)
__sync_synchronize();
uint32_t *next_ptr = *map + current.offset;
- next.offset = VG_NOACCESS_READ(next_ptr);
- next.count = current.count + 1;
- old.u64 = __sync_val_compare_and_swap(&list->u64, current.u64, next.u64);
+ new.offset = VG_NOACCESS_READ(next_ptr);
+ new.count = current.count + 1;
+ old.u64 = __sync_val_compare_and_swap(&list->u64, current.u64, new.u64);
if (old.u64 == current.u64) {
*offset = current.offset;
return true;