Skip to content

Commit

Permalink
Fix build for the surfaceless and null-WS target platforms
Browse files Browse the repository at this point in the history
Both platforms should not be considered for building Vulkan Video, which
is only available in the normal Linux and Win32 targets, and their
createLibrary platform methods do not take a library type argument.

No test results should be affected by these changes.

Components: Framework
VK-GL-CTS issue: 4295

Change-Id: I4de5b42685899099a9cfcf7da64fe299fef61ffc
  • Loading branch information
rg3igalia committed Mar 7, 2023
1 parent fc87a36 commit 664f7fb
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion external/vulkancts/framework/vulkan/vkPlatform.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ class Platform

Platform (void) {}
~Platform (void) {}
#if (DE_OS == DE_OS_WIN32) || (DE_OS == DE_OS_UNIX)
#ifdef DE_PLATFORM_USE_LIBRARY_TYPE
virtual Library* createLibrary (LibraryType libraryType = LIBRARY_TYPE_VULKAN, const char* libraryPath = DE_NULL) const = 0;
#else
virtual Library* createLibrary (const char* libraryPath = DE_NULL) const = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class APIEntryPointsTestInstance : public TestInstance
tcu::TestLog& log = m_context.getTestContext().getLog();
const deUint32 apiVersion = m_context.getUsedApiVersion();
const vk::Platform& platform = m_context.getTestContext().getPlatform().getVulkanPlatform();
#if (DE_OS == DE_OS_WIN32) || (DE_OS == DE_OS_UNIX)
#ifdef DE_PLATFORM_USE_LIBRARY_TYPE
de::MovePtr<vk::Library> vkLibrary = de::MovePtr<vk::Library>(platform.createLibrary(vk::Platform::LibraryType::LIBRARY_TYPE_VULKAN, m_context.getTestContext().getCommandLine().getVkLibraryPath()));
#else
de::MovePtr<vk::Library> vkLibrary = de::MovePtr<vk::Library>(platform.createLibrary(m_context.getTestContext().getCommandLine().getVkLibraryPath()));
Expand Down
5 changes: 4 additions & 1 deletion external/vulkancts/modules/vulkan/video/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
include_directories(..)
include_directories(${FFMPEG_INCLUDE_PATH})
if ((DE_OS_IS_WIN32 OR DE_OS_IS_UNIX) AND NOT DEQP_USE_SURFACELESS AND NOT DEQP_USE_NULLWS)
include_directories(${FFMPEG_INCLUDE_PATH})
add_compile_definitions(DE_BUILD_VIDEO)
endif()

set(DEQP_VK_VIDEO_SRCS
extFFmpegDemuxer.h
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class NvFunctions: public IfcNvFunctions
};

NvFunctions::NvFunctions (const vk::Platform& platform)
#if (DE_OS == DE_OS_WIN32) || (DE_OS == DE_OS_UNIX)
#ifdef DE_PLATFORM_USE_LIBRARY_TYPE
: m_library (de::MovePtr<vk::Library>(platform.createLibrary(vk::Platform::LIBRARY_TYPE_VULKAN_VIDEO_DECODE_PARSER, DE_NULL)))
#else
: m_library (de::MovePtr<vk::Library>(platform.createLibrary()))
Expand Down
2 changes: 1 addition & 1 deletion external/vulkancts/modules/vulkan/vktTestPackage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ static void restoreStandardOutput () { qpRedirectOut(openWrite, open

static MovePtr<vk::Library> createLibrary (tcu::TestContext& testCtx)
{
#if (DE_OS == DE_OS_WIN32) || (DE_OS == DE_OS_UNIX)
#ifdef DE_PLATFORM_USE_LIBRARY_TYPE
return MovePtr<vk::Library>(testCtx.getPlatform().getVulkanPlatform().createLibrary(vk::Platform::LIBRARY_TYPE_VULKAN, testCtx.getCommandLine().getVkLibraryPath()));
#else
return MovePtr<vk::Library>(testCtx.getPlatform().getVulkanPlatform().createLibrary(testCtx.getCommandLine().getVkLibraryPath()));
Expand Down
2 changes: 1 addition & 1 deletion external/vulkancts/vkscpc/vkscpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ int main (int argc, char** argv)
tcu::DirArchive archive {""};
tcu::TestLog log { cmdLine.getOption<opt::LogFile>().c_str() }; log.supressLogging(true);
de::SharedPtr<tcu::Platform> platform {createPlatform()};
#if (DE_OS == DE_OS_WIN32) || (DE_OS == DE_OS_UNIX)
#ifdef DE_PLATFORM_USE_LIBRARY_TYPE
de::SharedPtr<vk::Library> library {platform->getVulkanPlatform().createLibrary(vk::Platform::LIBRARY_TYPE_VULKAN, DE_NULL)};
#else
de::SharedPtr<vk::Library> library {platform->getVulkanPlatform().createLibrary(DE_NULL)};
Expand Down
2 changes: 1 addition & 1 deletion external/vulkancts/vkscserver/vksServices.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ VkscServer* createServerVKSC(const std::string& logFile)
tcu::DirArchive archive {""};
tcu::TestLog log { logFile.c_str() }; log.supressLogging(true);
tcu::Platform* platform {createPlatform()};
#if (DE_OS == DE_OS_WIN32) || (DE_OS == DE_OS_UNIX)
#ifdef DE_PLATFORM_USE_LIBRARY_TYPE
vk::Library* library {platform->getVulkanPlatform().createLibrary(vk::Platform::LIBRARY_TYPE_VULKAN, DE_NULL)};
#else
vk::Library* library {platform->getVulkanPlatform().createLibrary(DE_NULL)};
Expand Down
6 changes: 6 additions & 0 deletions framework/delibs/debase/deDefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@
# error Unknown operating system.
#endif

#if ((DE_OS == DE_OS_WIN32) || (DE_OS == DE_OS_UNIX)) && !defined(DEQP_SURFACELESS) && !defined(NULLWS)
# define DE_PLATFORM_USE_LIBRARY_TYPE 1
#else
# undef DE_PLATFORM_USE_LIBRARY_TYPE
#endif

/* CPUs */
#define DE_CPU_VANILLA 0
#define DE_CPU_X86 1
Expand Down
1 change: 1 addition & 0 deletions framework/platform/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ if (NOT DEFINED TCUTIL_PLATFORM_SRCS)
endif()

elseif (DE_OS_IS_UNIX AND DEQP_USE_SURFACELESS)
add_definitions(-DDEQP_SURFACELESS=1)
set(TCUTIL_PLATFORM_SRCS
surfaceless/tcuSurfacelessPlatform.hpp
surfaceless/tcuSurfacelessPlatform.cpp
Expand Down
1 change: 1 addition & 0 deletions targets/nullws/nullws.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
message("*** Using nullws target")
set(DEQP_TARGET_NAME "nullws")

set(DEQP_USE_NULLWS ON)
add_definitions(-DNULLWS)

find_library(GLES2_LIBRARY NAMES libGLESv2 GLESv2)
Expand Down

0 comments on commit 664f7fb

Please sign in to comment.