blob: 8fb47b0abc3721e17eaac9b70830c1ad66afc200 [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 PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
Michael Lentine83ab3412015-11-03 16:20:30 -080019// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
Karl Schultz929a1002016-02-04 11:33:21 -070020// 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 Lentine83ab3412015-11-03 16:20:30 -080026
27#include "vktestframeworkandroid.h"
28
29VkTestFramework::VkTestFramework() {}
30VkTestFramework::~VkTestFramework() {}
31
32bool VkTestFramework::m_use_glsl = true;
33
Michael Lentineb62cc052015-12-09 08:44:25 -080034VkFormat 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 Lentinedcbb5532015-11-24 09:50:46 -060053bool VkTestFramework::GLSLtoSPV(const VkShaderStageFlagBits shader_type,
54 const char *pshader,
55 std::vector<unsigned int> &spv)
Michael Lentine83ab3412015-11-03 16:20:30 -080056{
57 assert(false);
Michael Lentine0a369f62016-02-03 16:51:46 -060058 return false;
Michael Lentine83ab3412015-11-03 16:20:30 -080059}
60
61void VkTestFramework::InitArgs(int *argc, char *argv[]) {}
62void VkTestFramework::Finish() {}
63
64void TestEnvironment::SetUp()
65{
66 vk_testing::set_error_callback(test_error_callback);
67}
68
69void TestEnvironment::TearDown() {}