blob: 692472cc0ed5149b742b20227e833beaab69712a [file] [log] [blame]
Michael Lentine83ab3412015-11-03 16:20:30 -08001// VK tests
2//
Karl Schultz929a1002016-02-04 11:33:21 -07003// 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 Lentine83ab3412015-11-03 16:20:30 -08007//
Karl Schultz929a1002016-02-04 11:33:21 -07008// 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 Lentine83ab3412015-11-03 16:20:30 -080014//
Karl Schultz929a1002016-02-04 11:33:21 -070015// The above copyright notice(s) and this permission notice shall be included in
16// all copies or substantial portions of the Materials.
Michael Lentine83ab3412015-11-03 16:20:30 -080017//
Karl Schultz929a1002016-02-04 11:33:21 -070018// 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 Lentine83ab3412015-11-03 16:20:30 -080023// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
Karl Schultz929a1002016-02-04 11:33:21 -070024// 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 Lentine83ab3412015-11-03 16:20:30 -080030
31#include "vktestframeworkandroid.h"
32
33VkTestFramework::VkTestFramework() {}
34VkTestFramework::~VkTestFramework() {}
35
36bool VkTestFramework::m_use_glsl = true;
37
Michael Lentineb62cc052015-12-09 08:44:25 -080038VkFormat 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 Lentinedcbb5532015-11-24 09:50:46 -060057bool VkTestFramework::GLSLtoSPV(const VkShaderStageFlagBits shader_type,
58 const char *pshader,
59 std::vector<unsigned int> &spv)
Michael Lentine83ab3412015-11-03 16:20:30 -080060{
61 assert(false);
62}
63
64void VkTestFramework::InitArgs(int *argc, char *argv[]) {}
65void VkTestFramework::Finish() {}
66
67void TestEnvironment::SetUp()
68{
69 vk_testing::set_error_callback(test_error_callback);
70}
71
72void TestEnvironment::TearDown() {}