• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1From 4f53bcbb597a91bab715bc8d555cfd6c81263ac1 Mon Sep 17 00:00:00 2001
2From: Daniel Stone <daniels@collabora.com>
3Date: Wed, 29 Jan 2025 12:50:33 +0000
4Subject: [PATCH] Build: Don't build Vulkan utilities for GL builds
5
6Change-Id: Ie412f914bb6264ffbd502deea57d80cc11a9948e
7Signed-off-by: Daniel Stone <daniels@collabora.com>
8---
9 framework/platform/CMakeLists.txt             |   9 --
10 .../platform/android/tcuAndroidPlatform.cpp   | 118 ------------------
11 framework/platform/lnx/tcuLnxPlatform.cpp     |   9 +-
12 .../surfaceless/tcuSurfacelessPlatform.cpp    |  54 --------
13 4 files changed, 1 insertion(+), 189 deletions(-)
14
15diff --git a/framework/platform/CMakeLists.txt b/framework/platform/CMakeLists.txt
16index ec1deb5c2..49fe412a7 100644
17--- a/framework/platform/CMakeLists.txt
18+++ b/framework/platform/CMakeLists.txt
19@@ -15,8 +15,6 @@ if (NOT DEFINED TCUTIL_PLATFORM_SRCS)
20 			win32/tcuWin32Window.hpp
21 			win32/tcuWin32EGLNativeDisplayFactory.hpp
22 			win32/tcuWin32EGLNativeDisplayFactory.cpp
23-			win32/tcuWin32VulkanPlatform.hpp
24-			win32/tcuWin32VulkanPlatform.cpp
25 			)
26
27 	elseif ((DE_OS_IS_UNIX OR DE_OS_IS_OSX) AND (DEQP_USE_X11 OR DEQP_USE_WAYLAND OR DEQP_USE_HEADLESS))
28@@ -28,8 +26,6 @@ if (NOT DEFINED TCUTIL_PLATFORM_SRCS)
29 			lnx/tcuLnxPlatform.hpp
30 			lnx/tcuLnxEglPlatform.hpp
31 			lnx/tcuLnxEglPlatform.cpp
32-			lnx/tcuLnxVulkanPlatform.hpp
33-			lnx/tcuLnxVulkanPlatform.cpp
34 		)
35
36 		include_directories(lnx)
37@@ -164,8 +160,6 @@ if (NOT DEFINED TCUTIL_PLATFORM_SRCS)
38 		set(TCUTIL_PLATFORM_SRCS
39 			osx/tcuOSXPlatform.cpp
40 			osx/tcuOSXPlatform.hpp
41-			osx/tcuOSXVulkanPlatform.cpp
42-			osx/tcuOSXVulkanPlatform.hpp
43 			osx/tcuOSXMetalView.mm
44 			osx/tcuOSXMetalView.hpp
45 			)
46@@ -191,9 +185,6 @@ if (DEQP_USE_WAYLAND)
47 	add_dependencies(tcutil-platform deqp-xdg-shell)
48 endif()
49
50-# Add vkutil to the deps before tcutil so that it picks up the c++11 dependencies
51-target_link_libraries(tcutil-platform vkutil)
52-
53 target_link_libraries(tcutil-platform tcutil ${TCUTIL_PLATFORM_LIBS})
54
55 # Always link to glutil as some platforms such as Win32 always support GL
56diff --git a/framework/platform/android/tcuAndroidPlatform.cpp b/framework/platform/android/tcuAndroidPlatform.cpp
57index 0472fa615..87033ad56 100644
58--- a/framework/platform/android/tcuAndroidPlatform.cpp
59+++ b/framework/platform/android/tcuAndroidPlatform.cpp
60@@ -31,7 +31,6 @@
61 #include "eglwLibrary.hpp"
62 #include "eglwEnums.hpp"
63 #include "tcuFunctionLibrary.hpp"
64-#include "vkWsiPlatform.hpp"
65
66 // Assume no call translation is needed
67 #include <android/native_window.h>
68@@ -217,102 +216,6 @@ eglu::NativeDisplay *NativeDisplayFactory::createDisplay(const EGLAttrib *attrib
69     return new NativeDisplay();
70 }
71
72-// Vulkan
73-
74-class VulkanLibrary : public vk::Library
75-{
76-public:
77-    VulkanLibrary(const char *libraryPath)
78-        : m_library(libraryPath != DE_NULL ? libraryPath : "libvulkan.so")
79-        , m_driver(m_library)
80-    {
81-    }
82-
83-    const vk::PlatformInterface &getPlatformInterface(void) const
84-    {
85-        return m_driver;
86-    }
87-
88-    const tcu::FunctionLibrary &getFunctionLibrary(void) const
89-    {
90-        return m_library;
91-    }
92-
93-private:
94-    const tcu::DynamicFunctionLibrary m_library;
95-    const vk::PlatformDriver m_driver;
96-};
97-
98-DE_STATIC_ASSERT(sizeof(vk::pt::AndroidNativeWindowPtr) == sizeof(ANativeWindow *));
99-
100-class VulkanWindow : public vk::wsi::AndroidWindowInterface
101-{
102-public:
103-    VulkanWindow(tcu::Android::Window &window)
104-        : vk::wsi::AndroidWindowInterface(vk::pt::AndroidNativeWindowPtr(window.getNativeWindow()))
105-        , m_window(window)
106-    {
107-    }
108-
109-    void setVisible(bool visible)
110-    {
111-        DE_UNREF(visible);
112-    }
113-
114-    void resize(const UVec2 &newSize)
115-    {
116-        DE_UNREF(newSize);
117-    }
118-
119-    void setMinimized(bool minimized)
120-    {
121-        DE_UNREF(minimized);
122-        TCU_THROW(NotSupportedError, "Minimized on Android is not implemented");
123-    }
124-
125-    ~VulkanWindow(void)
126-    {
127-        m_window.release();
128-    }
129-
130-private:
131-    tcu::Android::Window &m_window;
132-};
133-
134-class VulkanDisplay : public vk::wsi::Display
135-{
136-public:
137-    VulkanDisplay(WindowRegistry &windowRegistry) : m_windowRegistry(windowRegistry)
138-    {
139-    }
140-
141-    vk::wsi::Window *createWindow(const Maybe<UVec2> &initialSize) const
142-    {
143-        Window *const window = m_windowRegistry.tryAcquireWindow();
144-
145-        if (window)
146-        {
147-            try
148-            {
149-                if (initialSize)
150-                    window->setBuffersGeometry((int)initialSize->x(), (int)initialSize->y(), WINDOW_FORMAT_RGBA_8888);
151-
152-                return new VulkanWindow(*window);
153-            }
154-            catch (...)
155-            {
156-                window->release();
157-                throw;
158-            }
159-        }
160-        else
161-            TCU_THROW(ResourceError, "Native window is not available");
162-    }
163-
164-private:
165-    WindowRegistry &m_windowRegistry;
166-};
167-
168 static size_t getTotalSystemMemory(ANativeActivity *activity)
169 {
170     const size_t MiB = (size_t)(1 << 20);
171@@ -355,11 +258,6 @@ bool Platform::processEvents(void)
172     return true;
173 }
174
175-vk::Library *Platform::createLibrary(const char *libraryPath) const
176-{
177-    return new VulkanLibrary(libraryPath);
178-}
179-
180 void Platform::describePlatform(std::ostream &dst) const
181 {
182     tcu::Android::describePlatform(m_activity.getNativeActivity(), dst);
183@@ -398,21 +296,5 @@ void Platform::getMemoryLimits(tcu::PlatformMemoryLimits &limits) const
184     limits.devicePageTableHierarchyLevels    = 3;
185 }
186
187-vk::wsi::Display *Platform::createWsiDisplay(vk::wsi::Type wsiType) const
188-{
189-    if (wsiType == vk::wsi::TYPE_ANDROID)
190-        return new VulkanDisplay(const_cast<WindowRegistry &>(m_windowRegistry));
191-    else
192-        TCU_THROW(NotSupportedError, "WSI type not supported on Android");
193-}
194-
195-bool Platform::hasDisplay(vk::wsi::Type wsiType) const
196-{
197-    if (wsiType == vk::wsi::TYPE_ANDROID)
198-        return true;
199-
200-    return false;
201-}
202-
203 } // namespace Android
204 } // namespace tcu
205diff --git a/framework/platform/lnx/tcuLnxPlatform.cpp b/framework/platform/lnx/tcuLnxPlatform.cpp
206index 8c0a3ef06..6b1a4985a 100644
207--- a/framework/platform/lnx/tcuLnxPlatform.cpp
208+++ b/framework/platform/lnx/tcuLnxPlatform.cpp
209@@ -23,12 +23,10 @@
210
211 #include "tcuLnxPlatform.hpp"
212
213-#include "tcuLnxVulkanPlatform.hpp"
214 #include "tcuLnxEglPlatform.hpp"
215
216 #include "deUniquePtr.hpp"
217 #include "gluPlatform.hpp"
218-#include "vkPlatform.hpp"
219
220 #if defined(DEQP_SUPPORT_X11)
221 #include <X11/Xlib.h>
222@@ -64,10 +62,6 @@ public:
223         return !m_eventState.getQuitFlag();
224     }
225
226-    const vk::Platform &getVulkanPlatform(void) const
227-    {
228-        return m_vkPlatform;
229-    }
230     const eglu::Platform &getEGLPlatform(void) const
231     {
232         return m_eglPlatform;
233@@ -79,12 +73,11 @@ public:
234
235 private:
236     EventState m_eventState;
237-    VulkanPlatform m_vkPlatform;
238     egl::Platform m_eglPlatform;
239     LinuxGLPlatform m_glPlatform;
240 };
241
242-LinuxPlatform::LinuxPlatform(void) : m_vkPlatform(m_eventState), m_eglPlatform(m_eventState)
243+LinuxPlatform::LinuxPlatform(void) : m_eglPlatform(m_eventState)
244 {
245 #if defined(DEQP_SUPPORT_GLX)
246     m_glPlatform.registerFactory(x11::glx::createContextFactory(m_eventState));
247diff --git a/framework/platform/surfaceless/tcuSurfacelessPlatform.cpp b/framework/platform/surfaceless/tcuSurfacelessPlatform.cpp
248index 1cea9dd97..3d5bd8b62 100644
249--- a/framework/platform/surfaceless/tcuSurfacelessPlatform.cpp
250+++ b/framework/platform/surfaceless/tcuSurfacelessPlatform.cpp
251@@ -43,7 +43,6 @@
252 #include "tcuPixelFormat.hpp"
253 #include "tcuPlatform.hpp"
254 #include "tcuRenderTarget.hpp"
255-#include "vkPlatform.hpp"
256
257 #include <EGL/egl.h>
258
259@@ -93,52 +92,6 @@ namespace tcu
260 namespace surfaceless
261 {
262
263-class VulkanLibrary : public vk::Library
264-{
265-public:
266-    VulkanLibrary(const char *libraryPath)
267-        : m_library(libraryPath != DE_NULL ? libraryPath : DEQP_VULKAN_LIBRARY_PATH)
268-        , m_driver(m_library)
269-    {
270-    }
271-
272-    const vk::PlatformInterface &getPlatformInterface(void) const
273-    {
274-        return m_driver;
275-    }
276-    const tcu::FunctionLibrary &getFunctionLibrary(void) const
277-    {
278-        return m_library;
279-    }
280-
281-private:
282-    const tcu::DynamicFunctionLibrary m_library;
283-    const vk::PlatformDriver m_driver;
284-};
285-
286-// Copied from tcuX11Platform.cpp
287-class VulkanPlatform : public vk::Platform
288-{
289-public:
290-    vk::Library *createLibrary(const char *libraryPath) const
291-    {
292-        return new VulkanLibrary(libraryPath);
293-    }
294-
295-    void describePlatform(std::ostream &dst) const
296-    {
297-        utsname sysInfo;
298-
299-        deMemset(&sysInfo, 0, sizeof(sysInfo));
300-
301-        if (uname(&sysInfo) != 0)
302-            throw std::runtime_error("uname() failed");
303-
304-        dst << "OS: " << sysInfo.sysname << " " << sysInfo.release << " " << sysInfo.version << "\n";
305-        dst << "CPU: " << sysInfo.machine << "\n";
306-    }
307-};
308-
309 bool isEGLExtensionSupported(const eglw::Library &egl, eglw::EGLDisplay, const std::string &extName)
310 {
311     const vector<string> exts = eglu::getClientExtensions(egl);
312@@ -185,13 +138,6 @@ public:
313     {
314         return *this;
315     }
316-    const vk::Platform &getVulkanPlatform(void) const
317-    {
318-        return m_vkPlatform;
319-    }
320-
321-private:
322-    VulkanPlatform m_vkPlatform;
323 };
324
325 class ContextFactory : public glu::ContextFactory
326--
3272.48.1
328
329