diff options
| author | Courtney Goeltzenleuchter <courtney@LunarG.com> | 2015-10-22 11:03:31 -0600 |
|---|---|---|
| committer | Courtney Goeltzenleuchter <courtney@LunarG.com> | 2015-10-23 17:32:04 -0600 |
| commit | 87a0ef0feb2ab734b890c8b509fe064e64ec2e88 (patch) | |
| tree | 3e08fc4da579802390a4405a28046bf74319025a /layers/screenshot.cpp | |
| parent | 34d57d56eb667f2fe69a602d839074d1485c1931 (diff) | |
| download | usermoji-87a0ef0feb2ab734b890c8b509fe064e64ec2e88.tar.xz | |
bug-14542: Remove VK_UNSUPPORTED from success return codes
Diffstat (limited to 'layers/screenshot.cpp')
| -rw-r--r-- | layers/screenshot.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/layers/screenshot.cpp b/layers/screenshot.cpp index ee39d0b5..e9ec3eb8 100644 --- a/layers/screenshot.cpp +++ b/layers/screenshot.cpp @@ -96,7 +96,7 @@ static vector<int> screenshotFrames; // Flag indicating we have queried _VK_SCREENSHOT env var static bool screenshotEnvQueried = false; -static VkResult memory_type_from_properties( +static bool memory_type_from_properties( VkPhysicalDeviceMemoryProperties *memory_properties, uint32_t typeBits, VkFlags requirements_mask, @@ -108,13 +108,13 @@ static VkResult memory_type_from_properties( // Type is available, does it match user properties? if ((memory_properties->memoryTypes[i].propertyFlags & requirements_mask) == requirements_mask) { *typeIndex = i; - return VK_SUCCESS; + return true; } } typeBits >>= 1; } // No memory types matched, return failure - return VK_UNSUPPORTED; + return false; } static void init_screenshot() @@ -135,6 +135,7 @@ static void writePPM( const char *filename, VkImage image1) { VkImage image2; VkResult err; + bool pass; int x, y; const char *ptr; VkDeviceMemory mem2; @@ -216,11 +217,11 @@ static void writePPM( const char *filename, VkImage image1) pInstanceTable = instance_dispatch_table(instance); pInstanceTable->GetPhysicalDeviceMemoryProperties(physicalDevice, &memory_properties); - err = memory_type_from_properties(&memory_properties, + pass = memory_type_from_properties(&memory_properties, memRequirements.memoryTypeBits, VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT, &memAllocInfo.memoryTypeIndex); - assert(!err); + assert(pass); err = pTableDevice->AllocMemory(device, &memAllocInfo, &mem2); assert(!err); |
