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