• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 void * properties,const void * properties2,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 void *properties, const void *properties2,
33                                      const std::vector<std::string> &instance_extensions,
34                                      const std::vector<std::string> &device_extensions, uint32_t queueIdx, void *queue,
35                                      void *getInstanceProcAddr)
36 {
37     amber::VulkanEngineConfig *cfg     = new amber::VulkanEngineConfig();
38     cfg->vkGetInstanceProcAddr         = reinterpret_cast<PFN_vkGetInstanceProcAddr>(getInstanceProcAddr);
39     cfg->instance                      = static_cast<VkInstance>(instance);
40     cfg->physical_device               = static_cast<VkPhysicalDevice>(physicalDevice);
41     cfg->available_features            = *static_cast<const VkPhysicalDeviceFeatures *>(features);
42     cfg->available_features2           = *static_cast<const VkPhysicalDeviceFeatures2KHR *>(features2);
43     cfg->available_properties          = *static_cast<const VkPhysicalDeviceProperties *>(properties);
44     cfg->available_properties2         = *static_cast<const VkPhysicalDeviceProperties2KHR *>(properties2);
45     cfg->available_instance_extensions = instance_extensions;
46     cfg->available_device_extensions   = device_extensions;
47     cfg->queue_family_index            = queueIdx;
48     cfg->device                        = static_cast<VkDevice>(device);
49     cfg->queue                         = static_cast<VkQueue>(queue);
50     return cfg;
51 }
52 
53 } // namespace cts_amber
54 } // namespace vkt
55