• 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 std::vector<std::string> & instance_extensions,const std::vector<std::string> & device_extensions,deUint32 queueIdx,void * queue,void * getInstanceProcAddr)31 amber::EngineConfig* GetVulkanConfig	(void*			instance,
32 										 void*			physicalDevice,
33 										 void*			device,
34 										 const void*	features,
35 										 const void*	features2,
36 										 const			std::vector<std::string>& instance_extensions,
37 										 const			std::vector<std::string>& device_extensions,
38 										 deUint32		queueIdx,
39 										 void*			queue,
40 										 void*			getInstanceProcAddr)
41 {
42 	amber::VulkanEngineConfig *cfg = new amber::VulkanEngineConfig();
43 	cfg->vkGetInstanceProcAddr = reinterpret_cast<PFN_vkGetInstanceProcAddr>(getInstanceProcAddr);
44 	cfg->instance = static_cast<VkInstance>(instance);
45 	cfg->physical_device = static_cast<VkPhysicalDevice>(physicalDevice);
46 	cfg->available_features = *static_cast<const VkPhysicalDeviceFeatures*>(features);
47 	cfg->available_features2 = *static_cast<const VkPhysicalDeviceFeatures2KHR*>(features2);
48 	cfg->available_instance_extensions = instance_extensions;
49 	cfg->available_device_extensions = device_extensions;
50 	cfg->queue_family_index = queueIdx;
51 	cfg->device = static_cast<VkDevice>(device);
52 	cfg->queue = static_cast<VkQueue>(queue);
53 	return cfg;
54 }
55 
56 } // cts_amber
57 } // vkt
58