From 661c329a5d6501bcd878e76a10802891f82d79c6 Mon Sep 17 00:00:00 2001 From: Jon Ashburn Date: Thu, 22 Jan 2015 11:40:11 -0700 Subject: [PATCH] tests: Fix testbinding alloc_mem method Set memProps for BUFFER allocations. Keep track of primary_mem if have multiple allocations based on which allocation req has a BUFFER or IMAGE type. --- tests/xgltestbinding.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/xgltestbinding.cpp b/tests/xgltestbinding.cpp index 56341f4..88528af 100644 --- a/tests/xgltestbinding.cpp +++ b/tests/xgltestbinding.cpp @@ -300,7 +300,19 @@ void Object::alloc_memory(const Device &dev, bool for_buf, bool for_img) for (int i = 0; i < mem_reqs.size(); i++) { info = GpuMemory::alloc_info(mem_reqs[i], next_info); - primary_mem_ = &internal_mems_[i]; + switch (info.memType) { + case XGL_MEMORY_TYPE_BUFFER: + EXPECT(for_buf); + info.memProps |= XGL_MEMORY_PROPERTY_CPU_VISIBLE_BIT; + primary_mem_ = &internal_mems_[i]; + break; + case XGL_MEMORY_TYPE_IMAGE: + EXPECT(for_img); + primary_mem_ = &internal_mems_[i]; + break; + default: + break; + } internal_mems_[i].init(dev, info); bind_memory(i, internal_mems_[i], 0); -- 2.7.4