Home | History | Annotate | Download | only in vulkan
      1 /*-------------------------------------------------------------------------
      2  * Vulkan CTS Framework
      3  * --------------------
      4  *
      5  * Copyright (c) 2015 Google Inc.
      6  *
      7  * Licensed under the Apache License, Version 2.0 (the "License");
      8  * you may not use this file except in compliance with the License.
      9  * You may obtain a copy of the License at
     10  *
     11  *      http://www.apache.org/licenses/LICENSE-2.0
     12  *
     13  * Unless required by applicable law or agreed to in writing, software
     14  * distributed under the License is distributed on an "AS IS" BASIS,
     15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     16  * See the License for the specific language governing permissions and
     17  * limitations under the License.
     18  *
     19  *//*!
     20  * \file
     21  * \brief Vulkan platform abstraction.
     22  *//*--------------------------------------------------------------------*/
     23 
     24 #include "vkPlatform.hpp"
     25 #include "tcuFunctionLibrary.hpp"
     26 
     27 namespace vk
     28 {
     29 
     30 PlatformDriver::PlatformDriver (const tcu::FunctionLibrary& library)
     31 {
     32 	m_vk.getInstanceProcAddr	= (GetInstanceProcAddrFunc)library.getFunction("vkGetInstanceProcAddr");
     33 
     34 #define GET_PROC_ADDR(NAME) m_vk.getInstanceProcAddr(DE_NULL, NAME)
     35 #include "vkInitPlatformFunctionPointers.inl"
     36 #undef GET_PROC_ADDR
     37 }
     38 
     39 PlatformDriver::~PlatformDriver (void)
     40 {
     41 }
     42 
     43 InstanceDriver::InstanceDriver (const PlatformInterface& platformInterface, VkInstance instance)
     44 {
     45 #define GET_PROC_ADDR(NAME) platformInterface.getInstanceProcAddr(instance, NAME)
     46 #include "vkInitInstanceFunctionPointers.inl"
     47 #undef GET_PROC_ADDR
     48 }
     49 
     50 InstanceDriver::~InstanceDriver (void)
     51 {
     52 }
     53 
     54 DeviceDriver::DeviceDriver (const InstanceInterface& instanceInterface, VkDevice device)
     55 {
     56 #define GET_PROC_ADDR(NAME) instanceInterface.getDeviceProcAddr(device, NAME)
     57 #include "vkInitDeviceFunctionPointers.inl"
     58 #undef GET_PROC_ADDR
     59 }
     60 
     61 DeviceDriver::~DeviceDriver (void)
     62 {
     63 }
     64 
     65 #include "vkPlatformDriverImpl.inl"
     66 #include "vkInstanceDriverImpl.inl"
     67 #include "vkDeviceDriverImpl.inl"
     68 
     69 wsi::Display* Platform::createWsiDisplay (wsi::Type) const
     70 {
     71 	TCU_THROW(NotSupportedError, "WSI not supported");
     72 }
     73 
     74 void Platform::describePlatform (std::ostream& dst) const
     75 {
     76 	dst << "vk::Platform::describePlatform() not implemented";
     77 }
     78 
     79 } // vk
     80