demos: Use device local heap for depth
authorJeremy Hayes <jeremy@lunarg.com>
Wed, 22 Feb 2017 15:53:13 +0000 (08:53 -0700)
committerJeremy Hayes <jeremy-lunarg@users.noreply.github.com>
Wed, 22 Feb 2017 16:49:18 +0000 (09:49 -0700)
Fix GH 116: Cube demo does not allocate depth buffer in device local
heap.

Change-Id: Ic368bc039fc555f0d8739b0aeb6648237a6fcc5c

demos/cube.c
demos/cube.cpp

index f43935b..9180875 100644 (file)
@@ -1093,7 +1093,7 @@ static void demo_prepare_depth(struct demo *demo) {
     demo->depth.mem_alloc.memoryTypeIndex = 0;
 
     pass = memory_type_from_properties(demo, mem_reqs.memoryTypeBits,
-                                       0, /* No requirements */
+                                       VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT,
                                        &demo->depth.mem_alloc.memoryTypeIndex);
     assert(pass);
 
index 5d56ecc..011c456 100644 (file)
@@ -1446,8 +1446,8 @@ struct Demo {
         depth.mem_alloc.setAllocationSize(mem_reqs.size);
         depth.mem_alloc.setMemoryTypeIndex(0);
 
-        auto const pass =
-            memory_type_from_properties(mem_reqs.memoryTypeBits, vk::MemoryPropertyFlagBits(0), &depth.mem_alloc.memoryTypeIndex);
+        auto const pass = memory_type_from_properties(mem_reqs.memoryTypeBits, vk::MemoryPropertyFlagBits::eDeviceLocal,
+                                                      &depth.mem_alloc.memoryTypeIndex);
         VERIFY(pass);
 
         result = device.allocateMemory(&depth.mem_alloc, nullptr, &depth.mem);