Browse Source

Fix a few bugs

master
Brian Ho 6 years ago
parent
commit
2a344b33b3
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      triangle.cc

+ 2
- 2
triangle.cc View File

@@ -376,7 +376,7 @@ uint32_t FindMemoryType(uint32_t valid_image_memory_types,
VkMemoryPropertyFlags memory_property_flags) {
for (uint32_t i = 0; i < device_memory_properties.memoryTypeCount; i++) {
// We don't care about performance, so just choose the first mappable memory type.
if ((valid_image_memory_types % (1 << i)) &&
if ((valid_image_memory_types & (1 << i)) &&
((device_memory_properties.memoryTypes[i].propertyFlags & memory_property_flags) ==
memory_property_flags)) {
return i;
@@ -415,7 +415,7 @@ VkDeviceMemory AllocateAndBindMemory(VkPhysicalDevice physical_device, VkDevice

inline VkDeviceMemory AllocateAndBindRenderMemory(VkPhysicalDevice physical_device,
VkDevice device, VkImage image) {
return AllocateAndBindMemory(physical_device, device, image, VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT);
return AllocateAndBindMemory(physical_device, device, image, VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT);
}

inline VkDeviceMemory AllocateAndBindScanoutMemory(VkPhysicalDevice physical_device,

Loading…
Cancel
Save