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 PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
Michael Lentine | 83ab341 | 2015-11-03 16:20:30 -0800 | [diff] [blame] | 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
Karl Schultz | 929a100 | 2016-02-04 11:33:21 -0700 | [diff] [blame] | 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
| 21 | // |
| 22 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
| 23 | // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR |
| 24 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE |
| 25 | // USE OR OTHER DEALINGS IN THE MATERIALS. |
Michael Lentine | 83ab341 | 2015-11-03 16:20:30 -0800 | [diff] [blame] | 26 | |
| 27 | #include "vktestframeworkandroid.h" |
| 28 | |
| 29 | VkTestFramework::VkTestFramework() {} |
| 30 | VkTestFramework::~VkTestFramework() {} |
| 31 | |
| 32 | bool VkTestFramework::m_use_glsl = true; |
| 33 | |
Michael Lentine | b62cc05 | 2015-12-09 08:44:25 -0800 | [diff] [blame] | 34 | VkFormat VkTestFramework::GetFormat(VkInstance instance, vk_testing::Device *device) |
| 35 | { |
| 36 | VkFormatProperties format_props; |
| 37 | vkGetPhysicalDeviceFormatProperties(device->phy().handle(), VK_FORMAT_B8G8R8A8_UNORM, &format_props); |
| 38 | if (format_props.linearTilingFeatures & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT || |
| 39 | format_props.optimalTilingFeatures & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT) |
| 40 | { |
| 41 | return VK_FORMAT_B8G8R8A8_UNORM; |
| 42 | } |
| 43 | vkGetPhysicalDeviceFormatProperties(device->phy().handle(), VK_FORMAT_R8G8B8A8_UNORM, &format_props); |
| 44 | if (format_props.linearTilingFeatures & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT || |
| 45 | format_props.optimalTilingFeatures & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT) |
| 46 | { |
| 47 | return VK_FORMAT_R8G8B8A8_UNORM; |
| 48 | } |
| 49 | printf("Error - device does not support VK_FORMAT_B8G8R8A8_UNORM nor VK_FORMAT_R8G8B8A8_UNORM - exiting\n"); |
| 50 | exit(0); |
| 51 | } |
| 52 | |
Michael Lentine | dcbb553 | 2015-11-24 09:50:46 -0600 | [diff] [blame] | 53 | bool VkTestFramework::GLSLtoSPV(const VkShaderStageFlagBits shader_type, |
| 54 | const char *pshader, |
| 55 | std::vector<unsigned int> &spv) |
Michael Lentine | 83ab341 | 2015-11-03 16:20:30 -0800 | [diff] [blame] | 56 | { |
| 57 | assert(false); |
Michael Lentine | 0a369f6 | 2016-02-03 16:51:46 -0600 | [diff] [blame] | 58 | return false; |
Michael Lentine | 83ab341 | 2015-11-03 16:20:30 -0800 | [diff] [blame] | 59 | } |
| 60 | |
| 61 | void VkTestFramework::InitArgs(int *argc, char *argv[]) {} |
| 62 | void VkTestFramework::Finish() {} |
| 63 | |
| 64 | void TestEnvironment::SetUp() |
| 65 | { |
| 66 | vk_testing::set_error_callback(test_error_callback); |
| 67 | } |
| 68 | |
| 69 | void TestEnvironment::TearDown() {} |