win32/tcuWin32VulkanPlatform.cpp
)
- elseif ((DE_OS_IS_UNIX OR DE_OS_IS_OSX) AND DEQP_USE_X11)
- message(STATUS "DEQP_SUPPORT_GLX = ${DEQP_SUPPORT_GLX}")
- if (DEQP_SUPPORT_GLX)
- add_definitions(-DDEQP_SUPPORT_GLX=1)
- endif ()
+ elseif ((DE_OS_IS_UNIX OR DE_OS_IS_OSX) AND (DEQP_USE_X11 OR DEQP_USE_WAYLAND))
set(TCUTIL_PLATFORM_SRCS
- X11/tcuX11.cpp
- X11/tcuX11.hpp
- X11/tcuX11EglPlatform.hpp
- X11/tcuX11EglPlatform.cpp
- X11/tcuX11Platform.hpp
- X11/tcuX11Platform.cpp
- X11/tcuX11VulkanPlatform.hpp
- X11/tcuX11VulkanPlatform.cpp
- )
- if (DEQP_USE_XCB)
+ lnx/tcuLnx.cpp
+ lnx/tcuLnx.cpp
+ lnx/tcuLnxPlatform.cpp
+ lnx/tcuLnxPlatform.hpp
+ lnx/tcuLnxEglPlatform.hpp
+ lnx/tcuLnxEglPlatform.cpp
+ lnx/tcuLnxVulkanPlatform.hpp
+ lnx/tcuLnxVulkanPlatform.cpp
+ )
+
+ include_directories(lnx)
+
+ if (DEQP_USE_X11)
+ add_definitions(-DDEQP_SUPPORT_X11=1)
+ include_directories(lnx/X11)
+
+ message(STATUS "DEQP_SUPPORT_GLX = ${DEQP_SUPPORT_GLX}")
+
+ if (DEQP_SUPPORT_GLX)
+ add_definitions(-DDEQP_SUPPORT_GLX=1)
+ endif ()
+
set(TCUTIL_PLATFORM_SRCS
${TCUTIL_PLATFORM_SRCS}
- X11/tcuX11Xcb.hpp
- X11/tcuX11Xcb.cpp
+ lnx/X11/tcuLnxX11.cpp
+ lnx/X11/tcuLnxX11.hpp
+ lnx/X11/tcuLnxX11EglDisplayFactory.hpp
+ lnx/X11/tcuLnxX11EglDisplayFactory.cpp
)
+
+ if (DEQP_USE_XCB)
+ set(TCUTIL_PLATFORM_SRCS
+ ${TCUTIL_PLATFORM_SRCS}
+ lnx/X11/tcuLnxX11Xcb.hpp
+ lnx/X11/tcuLnxX11Xcb.cpp
+ )
+ endif()
+
+ if (DEQP_SUPPORT_GLX)
+ set(TCUTIL_PLATFORM_SRCS
+ ${TCUTIL_PLATFORM_SRCS}
+ lnx/X11/tcuLnxX11GlxPlatform.hpp
+ lnx/X11/tcuLnxX11GlxPlatform.cpp
+ )
+ endif()
endif()
- if (DEQP_SUPPORT_GLX)
+
+ if (DEQP_USE_WAYLAND)
+ add_definitions(-DDEQP_SUPPORT_WAYLAND=1)
+ include_directories(lnx/wayland)
+
set(TCUTIL_PLATFORM_SRCS
${TCUTIL_PLATFORM_SRCS}
- X11/tcuX11GlxPlatform.hpp
- X11/tcuX11GlxPlatform.cpp
+ lnx/wayland/tcuLnxWayland.hpp
+ lnx/wayland/tcuLnxWayland.cpp
+ lnx/wayland/tcuLnxWaylandEglDisplayFactory.cpp
+ lnx/wayland/tcuLnxWaylandEglDisplayFactory.hpp
)
+ include_directories(wayland)
endif()
+
elseif (DE_OS_IS_ANDROID)
set(TCUTIL_PLATFORM_SRCS
android/tcuAndroidExecService.cpp
if (DEQP_USE_XCB)
find_package(XCB REQUIRED)
target_link_libraries(tcutil-platform ${XCB_LIBRARIES})
- add_definitions(-DDEQP_SUPPORT_XCB=1)
+ add_definitions(-DDEQP_SUPPORT_XCB=1)
endif ()
if (DEQP_SUPPORT_GLX)
# GLX functions don't currently have wrappers, so link directly to libGL.
target_link_libraries(tcutil-platform GL)
endif ()
+ if (DEQP_USE_WAYLAND)
+ find_package(Wayland REQUIRED)
+ target_link_libraries(tcutil-platform ${WAYLAND_LIBRARIES})
+ add_definitions(-DDEQP_SUPPORT_WAYLAND=1)
+ endif ()
endif ()
* \brief X11 utilities.
*//*--------------------------------------------------------------------*/
-#include "tcuX11.hpp"
+#include "tcuLnxX11.hpp"
#include "gluRenderConfig.hpp"
#include "deMemory.h"
namespace tcu
{
-namespace x11
-{
-
-EventState::EventState (void)
- : m_quit(false)
+namespace lnx
{
-}
-
-EventState::~EventState (void)
-{
-}
-
-void EventState::setQuitFlag (bool quit)
-{
- de::ScopedLock lock(m_mutex);
- m_quit = quit;
-}
-
-bool EventState::getQuitFlag (void)
+namespace x11
{
- de::ScopedLock lock(m_mutex);
- return m_quit;
-}
DisplayBase::DisplayBase (EventState& platform)
: m_eventState (platform)
}
} // x11
+} // lnx
} // tcu
-#ifndef _TCUX11_HPP
-#define _TCUX11_HPP
+#ifndef _TCULNXX11_HPP
+#define _TCULNXX11_HPP
/*-------------------------------------------------------------------------
* drawElements Quality Program Tester Core
* ----------------------------------------
#include "tcuDefs.hpp"
#include "gluRenderConfig.hpp"
#include "gluPlatform.hpp"
-#include "deMutex.hpp"
+#include "tcuLnx.hpp"
#include <X11/Xlib.h>
#include <X11/Xutil.h>
namespace tcu
{
-namespace x11
-{
-enum
+namespace lnx
{
- DEFAULT_WINDOW_WIDTH = 400,
- DEFAULT_WINDOW_HEIGHT = 300
-};
-
-class EventState
+namespace x11
{
-public:
- EventState (void);
- virtual ~EventState (void);
- void setQuitFlag (bool quit);
- bool getQuitFlag (void);
-
-protected:
- de::Mutex m_mutex;
- bool m_quit;
-
-private:
- EventState (const EventState&);
- EventState& operator= (const EventState&);
-};
class DisplayBase
{
};
} // x11
+} // lnx
} // tcu
-#endif // _TCUX11_HPP
+#endif // _TCULNXX11_HPP
*
*//*!
* \file
- * \brief X11Egl Platform.
+ * \brief X11Egl Display Factory.
*//*--------------------------------------------------------------------*/
-#include "tcuX11EglPlatform.hpp"
+#include "tcuLnxX11EglDisplayFactory.hpp"
+#include "tcuLnxX11.hpp"
#include "egluGLContextFactory.hpp"
#include "eglwLibrary.hpp"
#include "eglwFunctions.hpp"
#include "eglwEnums.hpp"
+#include "deUniquePtr.hpp"
namespace tcu
{
+namespace lnx
+{
namespace x11
{
namespace egl
return new Display(x11Display);
}
-Platform::Platform (EventState& eventState)
+NativeDisplayFactory* createDisplayFactory (EventState& eventState)
{
- m_nativeDisplayFactoryRegistry.registerFactory(new DisplayFactory(eventState));
+ return new DisplayFactory(eventState);
}
-MovePtr<ContextFactory> Platform::createContextFactory (void)
-{
- return MovePtr<ContextFactory>(new GLContextFactory(m_nativeDisplayFactoryRegistry));
-}
-
-
} // egl
} // x11
+} // lnx
} // tcu
--- /dev/null
+#ifndef _TCULNXX11EGLDISPLAYFACTORY_HPP
+#define _TCULNXX11EGLDISPLAYFACTORY_HPP
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program Tester Core
+ * ----------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *//*!
+ * \file
+ * \brief X11Egl Display Factory.
+ *//*--------------------------------------------------------------------*/
+
+#include "tcuLnx.hpp"
+#include "egluNativeDisplay.hpp"
+
+namespace tcu
+{
+namespace lnx
+{
+namespace x11
+{
+namespace egl
+{
+
+eglu::NativeDisplayFactory* createDisplayFactory (EventState& eventState);
+
+}
+} // x11
+} // lnx
+} // tcu
+
+#endif // _TCULNXX11EGLDISPLAYFACTORY_HPP
* \brief Platform that uses X11 via GLX.
*//*--------------------------------------------------------------------*/
-#include "tcuX11GlxPlatform.hpp"
-#include "tcuX11Platform.hpp"
+#include "tcuLnxX11GlxPlatform.hpp"
#include "tcuRenderTarget.hpp"
#include "glwInitFunctions.hpp"
namespace tcu
{
+namespace lnx
+{
namespace x11
{
namespace glx
extern "C"
{
- static int tcuX11GlxErrorHandler (::Display* display, XErrorEvent* event)
+ static int tcuLnxX11GlxErrorHandler (::Display* display, XErrorEvent* event)
{
char buf[80];
XGetErrorText(display, event->error_code, buf, sizeof(buf));
reinterpret_cast<const GLubyte*>("glXCreateContextAttribsARB")))))
, m_eventState (eventState)
{
- XSetErrorHandler(tcuX11GlxErrorHandler);
+ XSetErrorHandler(tcuLnxX11GlxErrorHandler);
}
RenderContext* GlxContextFactory::createContext (const RenderConfig& config,
} // glx
} // x11
+} // lnx
} // tcu
-#ifndef _TCUX11GLXPLATFORM_HPP
-#define _TCUX11GLXPLATFORM_HPP
+#ifndef _TCULNXX11GLXPLATFORM_HPP
+#define _TCULNXX11GLXPLATFORM_HPP
/*-------------------------------------------------------------------------
* drawElements Quality Program Tester Core
* ----------------------------------------
#include "gluContextFactory.hpp"
#include "deUniquePtr.hpp"
-#include "tcuX11.hpp"
+#include "tcuLnxX11.hpp"
namespace tcu
{
+namespace lnx
+{
namespace x11
{
namespace glx
de::MovePtr<glu::ContextFactory> createContextFactory (EventState& eventState);
} // glx
+} // lnx
} // x11
} // tcu
-#endif // _TCUX11GLXPLATFORM_HPP
+#endif // _TCULNXX11GLXPLATFORM_HPP
* \brief X11 using XCB utilities.
*//*--------------------------------------------------------------------*/
-#include "tcuX11Xcb.hpp"
+#include "tcuLnxX11Xcb.hpp"
#include "deMemory.h"
namespace tcu
{
+namespace lnx
+{
namespace x11
{
}
} // xcb
+} // lnx
} // tcu
-#ifndef _TCUX11XCB_HPP
-#define _TCUX11XCB_HPP
+#ifndef _TCULNXX11XCB_HPP
+#define _TCULNXX11XCB_HPP
/*-------------------------------------------------------------------------
* drawElements Quality Program Tester Core
* ----------------------------------------
* \brief X11 using XCB utilities.
*//*--------------------------------------------------------------------*/
-#include "tcuX11.hpp"
+#include "tcuLnxX11.hpp"
#include <xcb/xcb.h>
namespace tcu
{
+namespace lnx
+{
namespace x11
{
};
} // x11
+} // lnx
} // tcu
-#endif // _TCUX11XCB_HPP
+#endif // _TCULNXX11XCB_HPP
--- /dev/null
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program Tester Core
+ * ----------------------------------------
+ *
+ * Copyright 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *//*!
+ * \file
+ * \brief Linux utilities.
+ *//*--------------------------------------------------------------------*/
+
+#include "tcuLnx.hpp"
+
+
+namespace tcu
+{
+namespace lnx
+{
+
+EventState::EventState (void)
+ : m_quit(false)
+{
+}
+
+EventState::~EventState (void)
+{
+}
+
+void EventState::setQuitFlag (bool quit)
+{
+ de::ScopedLock lock(m_mutex);
+ m_quit = quit;
+}
+
+bool EventState::getQuitFlag (void)
+{
+ de::ScopedLock lock(m_mutex);
+ return m_quit;
+}
+
+} // lnx
+} // tcu
-#ifndef _TCUWAYLANDEGLPLATFORM_HPP
-#define _TCUWAYLANDEGLPLATFORM_HPP
+#ifndef _TCULNX_HPP
+#define _TCULNX_HPP
/*-------------------------------------------------------------------------
* drawElements Quality Program Tester Core
* ----------------------------------------
*
- * Copyright (c) 2014 The Android Open Source Project
- * Copyright (c) 2016 The Khronos Group Inc.
- * Copyright (c) 2016 Mun Gwan-gyeong <elongbug@gmail.com>
+ * Copyright 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
*//*!
* \file
- * \brief wayland Egl Platform.
+ * \brief Linux utilities.
*//*--------------------------------------------------------------------*/
-#include "deUniquePtr.hpp"
-#include "egluPlatform.hpp"
-#include "gluContextFactory.hpp"
-#include "tcuWayland.hpp"
+#include "tcuDefs.hpp"
+#include "deMutex.hpp"
namespace tcu
{
-namespace wayland
+// This namespace should be named 'linux', however some compilers still
+// define obsolete 'linux' macro alongside '__linux__'
+namespace lnx
{
-namespace egl
+enum
{
+ DEFAULT_WINDOW_WIDTH = 400,
+ DEFAULT_WINDOW_HEIGHT = 300
+};
-class Platform : public eglu::Platform
+class EventState
{
public:
- Platform (EventState& eventState);
- ~Platform (void) {}
+ EventState (void);
+ virtual ~EventState (void);
+ void setQuitFlag (bool quit);
+ bool getQuitFlag (void);
+
+ protected:
+ de::Mutex m_mutex;
+ bool m_quit;
- de::MovePtr<glu::ContextFactory> createContextFactory (void);
+private:
+ EventState (const EventState&);
+ EventState& operator= (const EventState&);
};
-}
-} // wayland
+} // lnx
} // tcu
-#endif // _TCUWAYLANDEGLPLATFORM_HPP
+#endif // _TCULNX_HPP
--- /dev/null
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program Tester Core
+ * ----------------------------------------
+ *
+ * Copyright (c) 2016 The Khronos Group Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *//*!
+ * \file
+ * \brief Linux EGL Platform.
+ *//*--------------------------------------------------------------------*/
+
+#include "tcuLnxEglPlatform.hpp"
+
+#if defined (DEQP_SUPPORT_X11)
+# include "tcuLnxX11EglDisplayFactory.hpp"
+#endif // DEQP_SUPPORT_X11
+
+#if defined (DEQP_SUPPORT_WAYLAND)
+# include "tcuLnxWaylandEglDisplayFactory.hpp"
+#endif // DEQP_SUPPORT_WAYLAND
+
+#include "egluGLContextFactory.hpp"
+
+namespace tcu
+{
+namespace lnx
+{
+namespace egl
+{
+
+Platform::Platform (EventState& eventState)
+{
+#if defined (DEQP_SUPPORT_X11)
+ m_nativeDisplayFactoryRegistry.registerFactory(x11::egl::createDisplayFactory(eventState));
+#endif // DEQP_SUPPORT_X11
+
+#if defined (DEQP_SUPPORT_WAYLAND)
+ m_nativeDisplayFactoryRegistry.registerFactory(wayland::egl::createDisplayFactory(eventState));
+#endif // DEQP_SUPPORT_WAYLAND
+
+}
+
+de::MovePtr<glu::ContextFactory> Platform::createContextFactory (void)
+{
+ return de::MovePtr<glu::ContextFactory>(new eglu::GLContextFactory(m_nativeDisplayFactoryRegistry));
+}
+
+} // egl
+} // linux
+} // tcu
+
-#ifndef _TCUX11EGLPLATFORM_HPP
-#define _TCUX11EGLPLATFORM_HPP
+#ifndef _TCULNXEGLPLATFORM_HPP
+#define _TCULNXEGLPLATFORM_HPP
/*-------------------------------------------------------------------------
* drawElements Quality Program Tester Core
* ----------------------------------------
*
- * Copyright 2014 The Android Open Source Project
+ * Copyright (c) 2016 The Khronos Group Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
*//*!
* \file
- * \brief X11Egl Platform.
+ * \brief Linux EGL Platform.
*//*--------------------------------------------------------------------*/
-#include "deUniquePtr.hpp"
+#include "tcuLnx.hpp"
#include "egluPlatform.hpp"
+#include "deUniquePtr.hpp"
#include "gluContextFactory.hpp"
-#include "tcuX11.hpp"
namespace tcu
{
-namespace x11
+namespace lnx
{
namespace egl
{
de::MovePtr<glu::ContextFactory> createContextFactory (void);
};
-}
-} // x11
+} // egl
+} // linux
} // tcu
-#endif // _TCUX11EGLPLATFORM_HPP
+#endif // _TCULNXEGLPLATFORM_HPP
* drawElements Quality Program Tester Core
* ----------------------------------------
*
- * Copyright 2014 The Android Open Source Project
+ * Copyright 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
*//*!
* \file
- * \brief X11 Platform.
+ * \brief Linux Platform.
*//*--------------------------------------------------------------------*/
-#include "tcuX11Platform.hpp"
-#include "vkWsiPlatform.hpp"
+#include "tcuLnxPlatform.hpp"
+
+#include "tcuLnxVulkanPlatform.hpp"
+#include "tcuLnxEglPlatform.hpp"
#include "deUniquePtr.hpp"
#include "gluPlatform.hpp"
#include "vkPlatform.hpp"
-#include "tcuX11.hpp"
-#include "tcuFunctionLibrary.hpp"
-#include "deMemory.h"
-#include "tcuX11VulkanPlatform.hpp"
-#include "tcuX11EglPlatform.hpp"
#if defined (DEQP_SUPPORT_GLX)
-# include "tcuX11GlxPlatform.hpp"
-#endif
-
-#include <sys/utsname.h>
+# include "tcuLnxX11GlxPlatform.hpp"
+#endif // DEQP_SUPPORT_GLX
using de::MovePtr;
using de::UniquePtr;
namespace tcu
{
-namespace x11
+namespace lnx
{
-class X11GLPlatform : public glu::Platform
+class LinuxGLPlatform : public glu::Platform
{
public:
void registerFactory (de::MovePtr<glu::ContextFactory> factory)
}
};
-class X11Platform : public tcu::Platform
+class LinuxPlatform : public tcu::Platform
{
public:
- X11Platform (void);
+ LinuxPlatform (void);
bool processEvents (void) { return !m_eventState.getQuitFlag(); }
const vk::Platform& getVulkanPlatform (void) const { return m_vkPlatform; }
private:
EventState m_eventState;
- x11::VulkanPlatform m_vkPlatform;
- x11::egl::Platform m_eglPlatform;
- X11GLPlatform m_glPlatform;
+ VulkanPlatform m_vkPlatform;
+ egl::Platform m_eglPlatform;
+ LinuxGLPlatform m_glPlatform;
};
-X11Platform::X11Platform (void)
+LinuxPlatform::LinuxPlatform (void)
: m_vkPlatform (m_eventState)
, m_eglPlatform (m_eventState)
{
#if defined (DEQP_SUPPORT_GLX)
- m_glPlatform.registerFactory(glx::createContextFactory(m_eventState));
+ m_glPlatform.registerFactory(x11::glx::createContextFactory(m_eventState));
#endif // DEQP_SUPPORT_GLX
m_glPlatform.registerFactory(m_eglPlatform.createContextFactory());
}
-} // x11
+} // lnx
} // tcu
tcu::Platform* createPlatform (void)
{
- return new tcu::x11::X11Platform();
+ return new tcu::lnx::LinuxPlatform();
}
-#ifndef _TCUX11PLATFORM_HPP
-#define _TCUX11PLATFORM_HPP
+#ifndef _TCULNXPLATFORM_HPP
+#define _TCULNXPLATFORM_HPP
/*-------------------------------------------------------------------------
* drawElements Quality Program Tester Core
* ----------------------------------------
*
- * Copyright 2014 The Android Open Source Project
+ * Copyright 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
*//*!
* \file
- * \brief X11 Platform.
+ * \brief Linux Platform.
*//*--------------------------------------------------------------------*/
#include "tcuPlatform.hpp"
tcu::Platform* createPlatform (void);
-#endif // _TCUX11PLATFORM_HPP
+#endif // _TCULNXPLATFORM_HPP
*
*//*!
* \file
- * \brief X11Vulkan Platform.
+ * \brief Linux Vulkan Platform.
*//*--------------------------------------------------------------------*/
-#include "tcuX11VulkanPlatform.hpp"
-#include "tcuX11Platform.hpp"
+#include "tcuLnxVulkanPlatform.hpp"
+#include "tcuLnxPlatform.hpp"
#include "vkWsiPlatform.hpp"
#include "gluPlatform.hpp"
-#include "tcuX11.hpp"
+#include "tcuLnx.hpp"
#include "tcuFunctionLibrary.hpp"
#include "deUniquePtr.hpp"
#include "deMemory.h"
using de::MovePtr;
using de::UniquePtr;
-#if defined (DEQP_SUPPORT_XCB)
-#include "tcuX11Xcb.hpp"
-#endif // DEQP_SUPPORT_XCB
+#if defined (DEQP_SUPPORT_X11)
+# include "tcuLnxX11.hpp"
+# if defined (DEQP_SUPPORT_XCB)
+# include "tcuLnxX11Xcb.hpp"
+# endif // DEQP_SUPPORT_XCB
+#endif // DEQP_SUPPORT_X11
+
+#if defined (DEQP_SUPPORT_WAYLAND)
+# include "tcuLnxWayland.hpp"
+#endif // DEQP_SUPPORT_WAYLAND
namespace tcu
{
-namespace x11
+namespace lnx
{
+#if defined (DEQP_SUPPORT_X11)
+
class VulkanWindowXlib : public vk::wsi::XlibWindowInterface
{
public:
- VulkanWindowXlib (MovePtr<XlibWindow> window)
+ VulkanWindowXlib (MovePtr<x11::XlibWindow> window)
: vk::wsi::XlibWindowInterface (vk::pt::XlibWindow(window->getXID()))
, m_window (window)
{
}
private:
- UniquePtr<XlibWindow> m_window;
+ UniquePtr<x11::XlibWindow> m_window;
};
class VulkanDisplayXlib : public vk::wsi::XlibDisplayInterface
{
public:
- VulkanDisplayXlib (MovePtr<DisplayBase> display)
- : vk::wsi::XlibDisplayInterface (vk::pt::XlibDisplayPtr(((XlibDisplay*)display.get())->getXDisplay()))
+ VulkanDisplayXlib (MovePtr<x11::DisplayBase> display)
+ : vk::wsi::XlibDisplayInterface (vk::pt::XlibDisplayPtr(((x11::XlibDisplay*)display.get())->getXDisplay()))
, m_display (display)
{
}
vk::wsi::Window* createWindow (const Maybe<UVec2>& initialSize) const
{
- XlibDisplay* instance = (XlibDisplay*)(m_display.get());
- const deUint32 height = !initialSize ? (deUint32)DEFAULT_WINDOW_HEIGHT : initialSize->y();
- const deUint32 width = !initialSize ? (deUint32)DEFAULT_WINDOW_WIDTH : initialSize->x();
- return new VulkanWindowXlib(MovePtr<XlibWindow>(new XlibWindow(*instance, (int)width, (int)height, instance->getVisual(0))));
+ x11::XlibDisplay* instance = (x11::XlibDisplay*)(m_display.get());
+ const deUint32 height = !initialSize ? (deUint32)DEFAULT_WINDOW_HEIGHT : initialSize->y();
+ const deUint32 width = !initialSize ? (deUint32)DEFAULT_WINDOW_WIDTH : initialSize->x();
+ return new VulkanWindowXlib(MovePtr<x11::XlibWindow>(new x11::XlibWindow(*instance, (int)width, (int)height, instance->getVisual(0))));
}
private:
- MovePtr<DisplayBase> m_display;
+ MovePtr<x11::DisplayBase> m_display;
};
+#endif // DEQP_SUPPORT_X11
+
#if defined (DEQP_SUPPORT_XCB)
class VulkanWindowXcb : public vk::wsi::XcbWindowInterface
{
public:
- VulkanWindowXcb (MovePtr<XcbWindow> window)
+ VulkanWindowXcb (MovePtr<x11::XcbWindow> window)
: vk::wsi::XcbWindowInterface (vk::pt::XcbWindow(window->getXID()))
, m_window (window)
{
}
private:
- UniquePtr<XcbWindow> m_window;
+ UniquePtr<x11::XcbWindow> m_window;
};
class VulkanDisplayXcb : public vk::wsi::XcbDisplayInterface
{
public:
- VulkanDisplayXcb (MovePtr<DisplayBase> display)
- : vk::wsi::XcbDisplayInterface (vk::pt::XcbConnectionPtr(((XcbDisplay*)display.get())->getConnection()))
+ VulkanDisplayXcb (MovePtr<x11::DisplayBase> display)
+ : vk::wsi::XcbDisplayInterface (vk::pt::XcbConnectionPtr(((x11::XcbDisplay*)display.get())->getConnection()))
+ , m_display (display)
+ {
+ }
+
+ vk::wsi::Window* createWindow (const Maybe<UVec2>& initialSize) const
+ {
+ x11::XcbDisplay* instance = (x11::XcbDisplay*)(m_display.get());
+ const deUint32 height = !initialSize ? (deUint32)DEFAULT_WINDOW_HEIGHT : initialSize->y();
+ const deUint32 width = !initialSize ? (deUint32)DEFAULT_WINDOW_WIDTH : initialSize->x();
+ return new VulkanWindowXcb(MovePtr<x11::XcbWindow>(new x11::XcbWindow(*instance, (int)width, (int)height, DE_NULL)));
+ }
+
+private:
+ MovePtr<x11::DisplayBase> m_display;
+};
+#endif // DEQP_SUPPORT_XCB
+
+#if defined (DEQP_SUPPORT_WAYLAND)
+class VulkanWindowWayland : public vk::wsi::WaylandWindowInterface
+{
+public:
+ VulkanWindowWayland (MovePtr<wayland::Window> window)
+ : vk::wsi::WaylandWindowInterface (vk::pt::WaylandSurfacePtr(window->getSurface()))
+ , m_window (window)
+ {
+ }
+
+ void resize (const UVec2& newSize)
+ {
+ m_window->setDimensions((int)newSize.x(), (int)newSize.y());
+ }
+
+private:
+ UniquePtr<wayland::Window> m_window;
+};
+
+class VulkanDisplayWayland : public vk::wsi::WaylandDisplayInterface
+{
+public:
+ VulkanDisplayWayland (MovePtr<wayland::Display> display)
+ : vk::wsi::WaylandDisplayInterface (vk::pt::WaylandDisplayPtr(display->getDisplay()))
, m_display (display)
{
}
vk::wsi::Window* createWindow (const Maybe<UVec2>& initialSize) const
{
- XcbDisplay* instance = (XcbDisplay*)(m_display.get());
const deUint32 height = !initialSize ? (deUint32)DEFAULT_WINDOW_HEIGHT : initialSize->y();
const deUint32 width = !initialSize ? (deUint32)DEFAULT_WINDOW_WIDTH : initialSize->x();
- return new VulkanWindowXcb(MovePtr<XcbWindow>(new XcbWindow(*instance, (int)width, (int)height, DE_NULL)));
+ return new VulkanWindowWayland(MovePtr<wayland::Window>(new wayland::Window(*m_display, (int)width, (int)height)));
}
private:
- MovePtr<DisplayBase> m_display;
+ MovePtr<wayland::Display> m_display;
};
-#endif // DEQP_SUPPORT_XCB
+#endif // DEQP_SUPPORT_WAYLAND
class VulkanLibrary : public vk::Library
{
{
switch(wsiType)
{
+#if defined (DEQP_SUPPORT_X11)
case vk::wsi::TYPE_XLIB:
- return new VulkanDisplayXlib(MovePtr<DisplayBase>(new XlibDisplay(m_eventState,"")));
+ return new VulkanDisplayXlib(MovePtr<x11::DisplayBase>(new x11::XlibDisplay(m_eventState,"")));
break;
+#endif // DEQP_SUPPORT_X11
#if defined (DEQP_SUPPORT_XCB)
case vk::wsi::TYPE_XCB:
- return new VulkanDisplayXcb(MovePtr<DisplayBase>(new XcbDisplay(m_eventState,"")));
+ return new VulkanDisplayXcb(MovePtr<x11::DisplayBase>(new x11::XcbDisplay(m_eventState,"")));
break;
#endif // DEQP_SUPPORT_XCB
+#if defined (DEQP_SUPPORT_WAYLAND)
+ case vk::wsi::TYPE_WAYLAND:
+ return new VulkanDisplayWayland(MovePtr<wayland::Display>(new wayland::Display(m_eventState, DE_NULL)));
+ break;
+#endif // DEQP_SUPPORT_WAYLAND
+
default:
TCU_THROW(NotSupportedError, "WSI type not supported");
limits.devicePageTableHierarchyLevels = 3;
}
-} // x11
+} // linux
} // tcu
-#ifndef _TCUX11VULKANPLATFORM_HPP
-#define _TCUX11VULKANPLATFORM_HPP
+#ifndef _TCULNXVULKANPLATFORM_HPP
+#define _TCULNXVULKANPLATFORM_HPP
/*-------------------------------------------------------------------------
* drawElements Quality Program Tester Core
* ----------------------------------------
*
*//*!
* \file
- * \brief X11Vulkan Platform.
+ * \brief Linux Vulkan Platform.
*//*--------------------------------------------------------------------*/
#include "vkWsiPlatform.hpp"
#include "vkPlatform.hpp"
-#include "tcuX11.hpp"
+#include "tcuLnx.hpp"
namespace tcu
{
-namespace x11
+namespace lnx
+
{
class VulkanPlatform : public vk::Platform
};
-} // x11
+} // linux
} // tcu
-#endif // _TCUX11VULKANPLATFORM_HPP
+#endif // _TCULNXVULKANPLATFORM_HPP
* \brief wayland utilities.
*//*--------------------------------------------------------------------*/
-#include "tcuWayland.hpp"
+#include "tcuLnxWayland.hpp"
#include "gluRenderConfig.hpp"
#include "deMemory.h"
namespace tcu
{
-namespace wayland
-{
-
-EventState::EventState (void)
- : m_quit(false)
-{
-}
-
-EventState::~EventState (void)
+namespace lnx
{
-}
-
-void EventState::setQuitFlag (bool quit)
+namespace wayland
{
- de::ScopedLock lock(m_mutex);
- m_quit = quit;
-}
-bool EventState::getQuitFlag (void)
-{
- de::ScopedLock lock(m_mutex);
- return m_quit;
-}
const struct wl_registry_listener Display::s_registryListener =
{
Display::handleGlobal,
}
} // wayland
+} // lnx
} // tcu
-#ifndef _TCUWAYLAND_HPP
-#define _TCUWAYLAND_HPP
+#ifndef _TCULNXWAYLAND_HPP
+#define _TCULNXWAYLAND_HPP
/*-------------------------------------------------------------------------
* drawElements Quality Program Tester Core
* ----------------------------------------
#include "tcuDefs.hpp"
#include "gluRenderConfig.hpp"
#include "gluPlatform.hpp"
-#include "deMutex.hpp"
+#include "tcuLnx.hpp"
#include <wayland-client.h>
#include <wayland-egl.h>
namespace tcu
{
-namespace wayland
-{
-
-enum
+namespace lnx
{
- DEFAULT_WINDOW_WIDTH = 400,
- DEFAULT_WINDOW_HEIGHT = 300
-};
-
-class EventState
+namespace wayland
{
-public:
- EventState (void);
- virtual ~EventState (void);
-
- void setQuitFlag (bool quit);
- bool getQuitFlag (void);
-
-protected:
- de::Mutex m_mutex;
- bool m_quit;
-
-private:
- EventState (const EventState&);
- EventState& operator= (const EventState&);
-};
class Display
{
};
} // wayland
+} // lnx
} // tcu
-#endif // _TCUWAYLAND_HPP
+#endif // _TCULNXWAYLAND_HPP
*
*//*!
* \file
- * \brief wayland Egl Platform.
+ * \brief wayland Egl Display Factory.
*//*--------------------------------------------------------------------*/
-#include "tcuWaylandEglPlatform.hpp"
+#include "tcuLnxWaylandEglDisplayFactory.hpp"
+#include "tcuLnxWayland.hpp"
#include "egluGLContextFactory.hpp"
#include "eglwLibrary.hpp"
#include "eglwFunctions.hpp"
#include "eglwEnums.hpp"
+#include "deUniquePtr.hpp"
namespace tcu
{
+namespace lnx
+{
namespace wayland
{
namespace egl
return new Display(waylandDisplay);
}
-Platform::Platform (EventState& eventState)
-{
- m_nativeDisplayFactoryRegistry.registerFactory(new DisplayFactory(eventState));
-}
-
-MovePtr<ContextFactory> Platform::createContextFactory (void)
+NativeDisplayFactory* createDisplayFactory (EventState& eventState)
{
- return MovePtr<ContextFactory>(new GLContextFactory(m_nativeDisplayFactoryRegistry));
+ return new DisplayFactory(eventState);
}
} // egl
} // wayland
+} // lnx
} // tcu
-#ifndef _TCUWAYLANDPLATFORM_HPP
-#define _TCUWAYLANDPLATFORM_HPP
+#ifndef _TCULNXWAYLANDEGLDISPLAYFACTORY_HPP
+#define _TCULNXWAYLANDEGLDISPLAYFACTORY_HPP
/*-------------------------------------------------------------------------
* drawElements Quality Program Tester Core
* ----------------------------------------
*
*//*!
* \file
- * \brief Wayland Platform.
+ * \brief wayland Egl Display Factory.
*//*--------------------------------------------------------------------*/
-#include "tcuPlatform.hpp"
+#include "tcuLnx.hpp"
+#include "egluNativeDisplay.hpp"
-tcu::Platform* createPlatform (void);
+namespace tcu
+{
+namespace lnx
+{
+namespace wayland
+{
+namespace egl
+{
-#endif // _TCUWAYLANDPLATFORM_HPP
+eglu::NativeDisplayFactory* createDisplayFactory (EventState& eventState);
+
+} // egl
+} // wayland
+} // lnx
+} // tcu
+
+#endif // _TCULNXWAYLANDEGLDISPLAYFACTORY_HPP
+++ /dev/null
-/*-------------------------------------------------------------------------
- * drawElements Quality Program Tester Core
- * ----------------------------------------
- *
- * Copyright (c) 2014 The Android Open Source Project
- * Copyright (c) 2016 The Khronos Group Inc.
- * Copyright (c) 2016 Mun Gwan-gyeong <elongbug@gmail.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *//*!
- * \file
- * \brief wayland Platform.
- *//*--------------------------------------------------------------------*/
-
-#include "tcuWaylandPlatform.hpp"
-#include "tcuWaylandEglPlatform.hpp"
-
-#include "deUniquePtr.hpp"
-#include "gluPlatform.hpp"
-#include "vkPlatform.hpp"
-#include "tcuWayland.hpp"
-#include "tcuWaylandVulkanPlatform.hpp"
-#include "tcuFunctionLibrary.hpp"
-#include "deMemory.h"
-
-#include <sys/utsname.h>
-
-namespace tcu
-{
-namespace wayland
-{
-
-class WaylandGLPlatform : public glu::Platform
-{
-public:
- void registerFactory (de::MovePtr<glu::ContextFactory> factory)
- {
- m_contextFactoryRegistry.registerFactory(factory.release());
- }
-};
-
-class WaylandPlatform : public tcu::Platform
-{
-public:
- WaylandPlatform (void);
- bool processEvents (void) { return !m_eventState.getQuitFlag(); }
- const glu::Platform& getGLPlatform (void) const { return m_glPlatform; }
- const eglu::Platform& getEGLPlatform (void) const { return m_eglPlatform; }
- const vk::Platform& getVulkanPlatform (void) const { return m_vkPlatform; }
-
-
-private:
- EventState m_eventState;
- wayland::egl::Platform m_eglPlatform;
- WaylandGLPlatform m_glPlatform;
- WaylandVulkanPlatform m_vkPlatform;
-};
-
-WaylandPlatform::WaylandPlatform (void)
- : m_eglPlatform (m_eventState)
- , m_vkPlatform (m_eventState)
-{
- m_glPlatform.registerFactory(m_eglPlatform.createContextFactory());
-}
-
-} // wayland
-} // tcu
-
-tcu::Platform* createPlatform (void)
-{
- return new tcu::wayland::WaylandPlatform();
-}
+++ /dev/null
-/*-------------------------------------------------------------------------
- * drawElements Quality Program Tester Core
- * ----------------------------------------
- *
- * Copyright (c) 2016 The Khronos Group Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *//*!
- * \file
- * \brief Wayland Vulkan Platform.
- *//*--------------------------------------------------------------------*/
-
-#include "tcuWaylandVulkanPlatform.hpp"
-#include "tcuWaylandPlatform.hpp"
-#include "vkWsiPlatform.hpp"
-#include "gluPlatform.hpp"
-#include "tcuWayland.hpp"
-#include "tcuFunctionLibrary.hpp"
-#include "deUniquePtr.hpp"
-#include "deMemory.h"
-
-#include <sys/utsname.h>
-
-using de::MovePtr;
-using de::UniquePtr;
-
-namespace tcu
-{
-namespace wayland
-{
-
-class VulkanWindowWayland : public vk::wsi::WaylandWindowInterface
-{
-public:
- VulkanWindowWayland (MovePtr<wayland::Window> window)
- : vk::wsi::WaylandWindowInterface (vk::pt::WaylandSurfacePtr(window->getSurface()))
- , m_window (window)
- {
- }
-
- void resize (const UVec2& newSize)
- {
- m_window->setDimensions((int)newSize.x(), (int)newSize.y());
- }
-
-private:
- UniquePtr<wayland::Window> m_window;
-};
-
-class VulkanDisplayWayland : public vk::wsi::WaylandDisplayInterface
-{
-public:
- VulkanDisplayWayland (MovePtr<wayland::Display> display)
- : vk::wsi::WaylandDisplayInterface (vk::pt::WaylandDisplayPtr(display->getDisplay()))
- , m_display (display)
- {
- }
-
- vk::wsi::Window* createWindow (const Maybe<UVec2>& initialSize) const
- {
- const deUint32 height = !initialSize ? (deUint32)DEFAULT_WINDOW_HEIGHT : initialSize->y();
- const deUint32 width = !initialSize ? (deUint32)DEFAULT_WINDOW_WIDTH : initialSize->x();
- return new VulkanWindowWayland(MovePtr<wayland::Window>(new wayland::Window(*m_display, (int)width, (int)height)));
- }
-
-private:
- MovePtr<wayland::Display> m_display;
-};
-
-class VulkanLibrary : public vk::Library
-{
-public:
- VulkanLibrary (void)
- : m_library ("libvulkan.so.1")
- , m_driver (m_library)
- {
- }
-
- const vk::PlatformInterface& getPlatformInterface (void) const
- {
- return m_driver;
- }
-
-private:
- const DynamicFunctionLibrary m_library;
- const vk::PlatformDriver m_driver;
-};
-
-WaylandVulkanPlatform::WaylandVulkanPlatform (EventState& eventState)
- : m_eventState(eventState)
-{
-}
-
-vk::wsi::Display* WaylandVulkanPlatform::createWsiDisplay (vk::wsi::Type wsiType) const
-{
- switch(wsiType)
- {
- case vk::wsi::TYPE_WAYLAND:
- return new VulkanDisplayWayland(MovePtr<Display>(new Display(m_eventState, DE_NULL)));
- break;
- default:
- TCU_THROW(NotSupportedError, "WSI type not supported");
-
- };
-}
-
-vk::Library* WaylandVulkanPlatform::createLibrary (void) const
-{
- return new VulkanLibrary();
-}
-
-void WaylandVulkanPlatform::describePlatform (std::ostream& dst) const
-{
- utsname sysInfo;
- deMemset(&sysInfo, 0, sizeof(sysInfo));
-
- if (uname(&sysInfo) != 0)
- throw std::runtime_error("uname() failed");
-
- dst << "OS: " << sysInfo.sysname << " " << sysInfo.release << " " << sysInfo.version << "\n";
- dst << "CPU: " << sysInfo.machine << "\n";
-}
-
-void WaylandVulkanPlatform::getMemoryLimits (vk::PlatformMemoryLimits& limits) const
-{
- limits.totalSystemMemory = 256*1024*1024;
- limits.totalDeviceLocalMemory = 128*1024*1024;
- limits.deviceMemoryAllocationGranularity = 64*1024;
- limits.devicePageSize = 4096;
- limits.devicePageTableEntrySize = 8;
- limits.devicePageTableHierarchyLevels = 3;
-}
-
-} // wayland
-} // tcu
-
+++ /dev/null
-#ifndef _TCUWAYLANDVULKANPLATFORM_HPP
-#define _TCUWAYLANDVULKANPLATFORM_HPP
-/*-------------------------------------------------------------------------
- * drawElements Quality Program Tester Core
- * ----------------------------------------
- *
- * Copyright (c) 2016 The Khronos Group Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *//*!
- * \file
- * \brief Wayland Vulkan Platform.
- *//*--------------------------------------------------------------------*/
-
-#include "vkWsiPlatform.hpp"
-#include "vkPlatform.hpp"
-#include "tcuWayland.hpp"
-
-namespace tcu
-{
-namespace wayland
-{
-
-class WaylandVulkanPlatform : public vk::Platform
-{
-public:
- WaylandVulkanPlatform (EventState& eventState);
- vk::wsi::Display* createWsiDisplay (vk::wsi::Type wsiType) const;
- vk::Library* createLibrary (void) const;
- void describePlatform (std::ostream& dst) const;
- void getMemoryLimits (vk::PlatformMemoryLimits& limits) const;
-
-private :
- EventState& m_eventState;
-};
-
-
-} // wayland
-} // tcu
-
-#endif // _TCUWAYLANDVULKANPLATFORM_HPP
set(DEQP_PLATFORM_LIBRARIES ${XCB_LIBRARIES})
include_directories(${XCB_INCLUDE_DIR})
endif ()
+ find_package(Wayland)
+ if (WAYLAND_FOUND)
+ set(DEQP_USE_WAYLAND ON)
+ set(DEQP_PLATFORM_LIBRARIES ${WAYLAND_LIBRARIES})
+ include_directories(${WAYLAND_INCLUDE_DIR})
+ endif ()
endif ()
set(DEQP_USE_WAYLAND ON)
# Add FindWayland module
-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/targets/wayland")
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/targets/default")
find_package(Wayland)
if (NOT WAYLAND_FOUND)
endif ()
set(DEQP_PLATFORM_LIBRARIES ${WAYLAND_LIBRARIES})
-include_directories(${WAYLAND_INCLUDE_DIR})
-
-# Platform sources
-set(TCUTIL_PLATFORM_SRCS
- wayland/tcuWayland.cpp
- wayland/tcuWayland.hpp
- wayland/tcuWaylandPlatform.cpp
- wayland/tcuWaylandPlatform.hpp
- wayland/tcuWaylandEglPlatform.cpp
- wayland/tcuWaylandEglPlatform.hpp
- wayland/tcuWaylandVulkanPlatform.cpp
- wayland/tcuWaylandVulkanPlatform.hpp
- )
+include_directories(${WAYLAND_INCLUDE_DIR})
\ No newline at end of file