1 /*------------------------------------------------------------------------
2 * Vulkan Conformance Tests
3 * ------------------------
4 *
5 * Copyright (c) 2019 Google LLC
6 * Copyright (c) 2019 The Khronos Group Inc.
7 *
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 *
20 *//*--------------------------------------------------------------------*/
21
22 #include "vktAmberHelper.hpp"
23
24 #include "amber/amber_vulkan.h"
25
26 namespace vkt
27 {
28 namespace cts_amber
29 {
30
GetVulkanConfig(void * instance,void * physicalDevice,void * device,const void * features,const void * features2,const std::vector<std::string> & instance_extensions,const std::vector<std::string> & device_extensions,uint32_t queueIdx,void * queue,void * getInstanceProcAddr)31 amber::EngineConfig *GetVulkanConfig(void *instance, void *physicalDevice, void *device, const void *features,
32 const void *features2, const std::vector<std::string> &instance_extensions,
33 const std::vector<std::string> &device_extensions, uint32_t queueIdx, void *queue,
34 void *getInstanceProcAddr)
35 {
36 amber::VulkanEngineConfig *cfg = new amber::VulkanEngineConfig();
37 cfg->vkGetInstanceProcAddr = reinterpret_cast<PFN_vkGetInstanceProcAddr>(getInstanceProcAddr);
38 cfg->instance = static_cast<VkInstance>(instance);
39 cfg->physical_device = static_cast<VkPhysicalDevice>(physicalDevice);
40 cfg->available_features = *static_cast<const VkPhysicalDeviceFeatures *>(features);
41 cfg->available_features2 = *static_cast<const VkPhysicalDeviceFeatures2KHR *>(features2);
42 cfg->available_instance_extensions = instance_extensions;
43 cfg->available_device_extensions = device_extensions;
44 cfg->queue_family_index = queueIdx;
45 cfg->device = static_cast<VkDevice>(device);
46 cfg->queue = static_cast<VkQueue>(queue);
47 return cfg;
48 }
49
50 } // namespace cts_amber
51 } // namespace vkt
52