From d691d77b03f05e2365f9d58e46bfb10138d26143 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jarkko=20P=C3=B6yry?= Date: Fri, 24 Jul 2015 15:06:08 -0700 Subject: [PATCH] Load libvulkan.so on X11 platform. Change-Id: Ia8900b6f61acd5349d2c4b13a5e07e44e310f9a7 --- framework/platform/X11/tcuX11Platform.cpp | 41 ++++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/framework/platform/X11/tcuX11Platform.cpp b/framework/platform/X11/tcuX11Platform.cpp index e3f9257..e10db47 100644 --- a/framework/platform/X11/tcuX11Platform.cpp +++ b/framework/platform/X11/tcuX11Platform.cpp @@ -25,7 +25,9 @@ #include "deUniquePtr.hpp" #include "gluPlatform.hpp" +#include "vkPlatform.hpp" #include "tcuX11.hpp" +#include "tcuFunctionLibrary.hpp" #if defined (DEQP_SUPPORT_GLX) # include "tcuX11GlxPlatform.hpp" @@ -49,23 +51,54 @@ public: } }; +class VulkanLibrary : public vk::Library +{ +public: + VulkanLibrary (void) + : m_library ("libvulkan.so") + , m_driver (m_library) + { + } + + const vk::PlatformInterface& getPlatformInterface (void) const + { + return m_driver; + } + +private: + const tcu::DynamicFunctionLibrary m_library; + const vk::PlatformDriver m_driver; +}; + +class X11VulkanPlatform : public vk::Platform +{ +public: + vk::Library* createLibrary (void) const + { + return new VulkanLibrary(); + } +}; + class X11Platform : public tcu::Platform { public: - X11Platform (void); - bool processEvents (void) { return !m_eventState.getQuitFlag(); } - const glu::Platform& getGLPlatform (void) const { return m_glPlatform; } + X11Platform (void); + bool processEvents (void) { return !m_eventState.getQuitFlag(); } + const glu::Platform& getGLPlatform (void) const { return m_glPlatform; } #if defined (DEQP_SUPPORT_EGL) - const eglu::Platform& getEGLPlatform (void) const { return m_eglPlatform; } + const eglu::Platform& getEGLPlatform (void) const { return m_eglPlatform; } #endif // DEQP_SUPPORT_EGL + const vk::Platform& getVulkanPlatform (void) const { return m_vkPlatform; } + private: EventState m_eventState; #if defined (DEQP_SUPPORT_EGL) x11::egl::Platform m_eglPlatform; #endif // DEQP_SPPORT_EGL X11GLPlatform m_glPlatform; + X11VulkanPlatform m_vkPlatform; }; X11Platform::X11Platform (void) -- 2.7.4