diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2018-05-03 17:17:05 -0400 |
|---|---|---|
| committer | Tim Foley <tfoleyNV@users.noreply.github.com> | 2018-05-03 14:17:05 -0700 |
| commit | c216f00f1eaff368229cb8430422972fcac801b7 (patch) | |
| tree | c214700d1cbcdf590b2ecd2f50c9d152169275b8 /tools/render-test/vk-api.cpp | |
| parent | 367f3a78a40731da45ee12b9a18c94707f1d1429 (diff) | |
Fixes based on review of vulkan-first-render PR #545 (#546)
Diffstat (limited to 'tools/render-test/vk-api.cpp')
| -rw-r--r-- | tools/render-test/vk-api.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/render-test/vk-api.cpp b/tools/render-test/vk-api.cpp index 9d721f18f..df222d8ad 100644 --- a/tools/render-test/vk-api.cpp +++ b/tools/render-test/vk-api.cpp @@ -89,12 +89,14 @@ Slang::Result VulkanApi::initDeviceProcs(VkDevice device) int VulkanApi::findMemoryTypeIndex(uint32_t typeBits, VkMemoryPropertyFlags properties) const { + assert(typeBits); + const int numMemoryTypes = int(m_deviceMemoryProperties.memoryTypeCount); // bit holds current test bit against typeBits. Ie bit == 1 << typeBits uint32_t bit = 1; - for (int i = 0; (typeBits != 0) && i < numMemoryTypes; ++i, bit += bit) + for (int i = 0; i < numMemoryTypes; ++i, bit += bit) { auto const& memoryType = m_deviceMemoryProperties.memoryTypes[i]; if ((typeBits & bit) && (memoryType.propertyFlags & properties) == properties) @@ -102,7 +104,7 @@ int VulkanApi::findMemoryTypeIndex(uint32_t typeBits, VkMemoryPropertyFlags prop return i; } } - + //assert(!"failed to find a usable memory type"); return -1; } |
