1 #ifndef _TCUNULLWSPLATFORM_HPP 2 #define _TCUNULLWSPLATFORM_HPP 3 /*------------------------------------------------------------------------- 4 * OpenGL Conformance Test Suite 5 * ----------------------------- 6 * 7 * Copyright (c) 2016 Google Inc. 8 * Copyright (c) 2016 The Khronos Group Inc. 9 * 10 * Licensed under the Apache License, Version 2.0 (the "License"); 11 * you may not use this file except in compliance with the License. 12 * You may obtain a copy of the License at 13 * 14 * http://www.apache.org/licenses/LICENSE-2.0 15 * 16 * Unless required by applicable law or agreed to in writing, software 17 * distributed under the License is distributed on an "AS IS" BASIS, 18 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 * See the License for the specific language governing permissions and 20 * limitations under the License. 21 * 22 *//*! 23 * \file 24 * \brief 25 *//*--------------------------------------------------------------------*/ 26 27 #include "deDynamicLibrary.hpp" 28 #include "tcuFunctionLibrary.hpp" 29 #include "tcuDefs.hpp" 30 #include "tcuPlatform.hpp" 31 #include "gluPlatform.hpp" 32 #include "egluPlatform.hpp" 33 #include "vkPlatform.hpp" 34 35 namespace tcu 36 { 37 namespace nullws 38 { 39 class VulkanLibrary : public vk::Library 40 { 41 public: VulkanLibrary(const char * libraryPath)42 VulkanLibrary (const char* libraryPath) 43 : m_library (libraryPath != DE_NULL ? libraryPath : "libvulkan.so.1") 44 , m_driver (m_library) 45 { 46 } 47 getPlatformInterface(void) const48 const vk::PlatformInterface& getPlatformInterface (void) const 49 { 50 return m_driver; 51 } getFunctionLibrary(void) const52 const tcu::FunctionLibrary& getFunctionLibrary (void) const 53 { 54 return m_library; 55 } 56 private: 57 const tcu::DynamicFunctionLibrary m_library; 58 const vk::PlatformDriver m_driver; 59 }; 60 61 62 class Platform: public tcu::Platform, private glu::Platform, private eglu::Platform, private vk::Platform 63 { 64 public: 65 Platform (); 66 virtual ~Platform (); 67 getGLPlatform() const68 virtual const glu::Platform& getGLPlatform () const { return static_cast<const glu::Platform&>(*this); } getEGLPlatform() const69 virtual const eglu::Platform& getEGLPlatform () const { return static_cast<const eglu::Platform&>(*this); } getVulkanPlatform() const70 virtual const vk::Platform& getVulkanPlatform() const { return static_cast<const vk::Platform&>(*this); } 71 createLibrary(const char * libraryPath) const72 vk::Library* createLibrary (const char* libraryPath) const 73 { 74 return new VulkanLibrary(libraryPath); 75 } 76 }; 77 78 } // nullws 79 } // tcu 80 81 #endif // _TCUNULLWSPLATFORM_HPP 82