Michael Lentine | 83ab341 | 2015-11-03 16:20:30 -0800 | [diff] [blame] | 1 | // VK tests |
| 2 | // |
Karl Schultz | 929a100 | 2016-02-04 11:33:21 -0700 | [diff] [blame^] | 3 | // Copyright (c) 2015-2016 The Khronos Group Inc. |
| 4 | // Copyright (c) 2015-2016 Valve Corporation |
| 5 | // Copyright (c) 2015-2016 LunarG, Inc. |
| 6 | // Copyright (c) 2015-2016 Google, Inc. |
Michael Lentine | 83ab341 | 2015-11-03 16:20:30 -0800 | [diff] [blame] | 7 | // |
Karl Schultz | 929a100 | 2016-02-04 11:33:21 -0700 | [diff] [blame^] | 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy |
| 9 | // of this software and/or associated documentation files (the "Materials"), to |
| 10 | // deal in the Materials without restriction, including without limitation the |
| 11 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
| 12 | // sell copies of the Materials, and to permit persons to whom the Materials are |
| 13 | // furnished to do so, subject to the following conditions: |
Michael Lentine | 83ab341 | 2015-11-03 16:20:30 -0800 | [diff] [blame] | 14 | // |
Karl Schultz | 929a100 | 2016-02-04 11:33:21 -0700 | [diff] [blame^] | 15 | // The above copyright notice(s) and this permission notice shall be included in |
| 16 | // all copies or substantial portions of the Materials. |
Michael Lentine | 83ab341 | 2015-11-03 16:20:30 -0800 | [diff] [blame] | 17 | // |
Karl Schultz | 929a100 | 2016-02-04 11:33:21 -0700 | [diff] [blame^] | 18 | // The Materials are Confidential Information as defined by the Khronos |
| 19 | // Membership Agreement until designated non-confidential by Khronos, at which |
| 20 | // point this condition clause shall be removed. |
| 21 | // |
| 22 | // THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
Michael Lentine | 83ab341 | 2015-11-03 16:20:30 -0800 | [diff] [blame] | 23 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
Karl Schultz | 929a100 | 2016-02-04 11:33:21 -0700 | [diff] [blame^] | 24 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
| 25 | // |
| 26 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
| 27 | // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR |
| 28 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE |
| 29 | // USE OR OTHER DEALINGS IN THE MATERIALS. |
Michael Lentine | 83ab341 | 2015-11-03 16:20:30 -0800 | [diff] [blame] | 30 | |
| 31 | #include "vktestframeworkandroid.h" |
| 32 | |
| 33 | VkTestFramework::VkTestFramework() {} |
| 34 | VkTestFramework::~VkTestFramework() {} |
| 35 | |
| 36 | bool VkTestFramework::m_use_glsl = true; |
| 37 | |
Michael Lentine | b62cc05 | 2015-12-09 08:44:25 -0800 | [diff] [blame] | 38 | VkFormat VkTestFramework::GetFormat(VkInstance instance, vk_testing::Device *device) |
| 39 | { |
| 40 | VkFormatProperties format_props; |
| 41 | vkGetPhysicalDeviceFormatProperties(device->phy().handle(), VK_FORMAT_B8G8R8A8_UNORM, &format_props); |
| 42 | if (format_props.linearTilingFeatures & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT || |
| 43 | format_props.optimalTilingFeatures & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT) |
| 44 | { |
| 45 | return VK_FORMAT_B8G8R8A8_UNORM; |
| 46 | } |
| 47 | vkGetPhysicalDeviceFormatProperties(device->phy().handle(), VK_FORMAT_R8G8B8A8_UNORM, &format_props); |
| 48 | if (format_props.linearTilingFeatures & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT || |
| 49 | format_props.optimalTilingFeatures & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT) |
| 50 | { |
| 51 | return VK_FORMAT_R8G8B8A8_UNORM; |
| 52 | } |
| 53 | printf("Error - device does not support VK_FORMAT_B8G8R8A8_UNORM nor VK_FORMAT_R8G8B8A8_UNORM - exiting\n"); |
| 54 | exit(0); |
| 55 | } |
| 56 | |
Michael Lentine | dcbb553 | 2015-11-24 09:50:46 -0600 | [diff] [blame] | 57 | bool VkTestFramework::GLSLtoSPV(const VkShaderStageFlagBits shader_type, |
| 58 | const char *pshader, |
| 59 | std::vector<unsigned int> &spv) |
Michael Lentine | 83ab341 | 2015-11-03 16:20:30 -0800 | [diff] [blame] | 60 | { |
| 61 | assert(false); |
| 62 | } |
| 63 | |
| 64 | void VkTestFramework::InitArgs(int *argc, char *argv[]) {} |
| 65 | void VkTestFramework::Finish() {} |
| 66 | |
| 67 | void TestEnvironment::SetUp() |
| 68 | { |
| 69 | vk_testing::set_error_callback(test_error_callback); |
| 70 | } |
| 71 | |
| 72 | void TestEnvironment::TearDown() {} |