1 // VK tests
2 //
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.
7 //
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:
14 //
15 // The above copyright notice(s) and this permission notice shall be included in
16 // all copies or substantial portions of the Materials.
17 //
18 // THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
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.
26
27 #include "vktestframeworkandroid.h"
28
VkTestFramework()29 VkTestFramework::VkTestFramework() {}
~VkTestFramework()30 VkTestFramework::~VkTestFramework() {}
31
32 bool VkTestFramework::m_use_glsl = true;
33
GetFormat(VkInstance instance,vk_testing::Device * device)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
GLSLtoSPV(const VkShaderStageFlagBits shader_type,const char * pshader,std::vector<unsigned int> & spv)53 bool VkTestFramework::GLSLtoSPV(const VkShaderStageFlagBits shader_type,
54 const char *pshader,
55 std::vector<unsigned int> &spv)
56 {
57 assert(false);
58 return false;
59 }
60
InitArgs(int * argc,char * argv[])61 void VkTestFramework::InitArgs(int *argc, char *argv[]) {}
Finish()62 void VkTestFramework::Finish() {}
63
SetUp()64 void TestEnvironment::SetUp()
65 {
66 vk_testing::set_error_callback(test_error_callback);
67 }
68
TearDown()69 void TestEnvironment::TearDown() {}
70