turnip: use 32-bit offset in tu_cs_entry
authorChia-I Wu <olvaffe@gmail.com>
Mon, 25 Feb 2019 22:44:52 +0000 (14:44 -0800)
committerChia-I Wu <olvaffe@gmail.com>
Mon, 11 Mar 2019 17:02:13 +0000 (10:02 -0700)
We don't support nor expect BOs to be that big in tu_cs.

src/freedreno/vulkan/tu_cs.c
src/freedreno/vulkan/tu_private.h

index 193ae5cc9fe4670d62e0a440faaff69706302ca9..11e1737d5d3d247804930177cd08d117b34ce5ab 100644 (file)
@@ -307,7 +307,11 @@ tu_cs_reserve_space(struct tu_device *dev,
       VkResult result = tu_cs_add_bo(dev, cs, new_size);
       if (result != VK_SUCCESS)
          return result;
-      cs->next_bo_size = new_size * 2;
+
+      /* double the size for the next bo */
+      new_size <<= 1;
+      if (cs->next_bo_size < new_size)
+         cs->next_bo_size = new_size;
    }
 
    assert(tu_cs_get_space(cs) >= reserved_size);
index 2f46134f962dcb4c47a3ac54d786ab132463646f..f4c455d0d9dce7a059961a621f2b1a24d951007e 100644 (file)
@@ -484,7 +484,7 @@ struct tu_cs_entry
    const struct tu_bo *bo;
 
    uint32_t size;
-   uint64_t offset;
+   uint32_t offset;
 };
 
 enum tu_cs_mode