Mesa (master): radv: Don't try to find gaps for non-freeable descriptors.
Bas Nieuwenhuizen
bnieuwenhuizen at kemper.freedesktop.org
Wed Apr 19 18:40:37 UTC 2017
Module: Mesa
Branch: master
Commit: f7b14ff4bee61159a880371748511a2d449b9756
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=f7b14ff4bee61159a880371748511a2d449b9756
Author: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Date: Wed Apr 19 01:08:06 2017 +0200
radv: Don't try to find gaps for non-freeable descriptors.
With this we don't have any operations on a pool with non-freeable
descriptors left that have O(#descriptors) complexity.
Signed-off-by: Bas Nieuwenhuizen <basni at google.com>
Reviewed-by: Bas Nieuwenhuizen <basni at google.com>
---
src/amd/vulkan/radv_descriptor_set.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/amd/vulkan/radv_descriptor_set.c b/src/amd/vulkan/radv_descriptor_set.c
index 89945f1773..1bb37aad17 100644
--- a/src/amd/vulkan/radv_descriptor_set.c
+++ b/src/amd/vulkan/radv_descriptor_set.c
@@ -300,7 +300,7 @@ radv_descriptor_set_create(struct radv_device *device,
set->va = device->ws->buffer_get_va(set->bo) + pool->current_offset;
pool->current_offset += layout_size;
list_addtail(&set->vram_list, &pool->vram_list);
- } else {
+ } else if (!pool->host_memory_base) {
uint64_t offset = 0;
struct list_head *prev = &pool->vram_list;
struct radv_descriptor_set *cur;
@@ -324,7 +324,8 @@ radv_descriptor_set_create(struct radv_device *device,
set->mapped_ptr = (uint32_t*)(pool->mapped_ptr + offset);
set->va = device->ws->buffer_get_va(set->bo) + offset;
list_add(&set->vram_list, prev);
- }
+ } else
+ return vk_error(VK_ERROR_OUT_OF_POOL_MEMORY_KHR);
}
for (unsigned i = 0; i < layout->binding_count; ++i) {
More information about the mesa-commit
mailing list