diff --git a/CMakeLists.txt b/CMakeLists.txt index 5bd963b57c..1ff2bb9a7b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -116,8 +116,9 @@ include_directories(external/jsoncpp/src/include) # RenderDoc API include_directories(external/renderdoc/src) -# FFmpeg used in vulkan video won't be part of android target -if (NOT DE_OS_IS_ANDROID) +# FFmpeg used in vulkan video won't be part of android, fushia, or macos target +if (DE_OS_IS_WIN32 OR DE_OS_IS_UNIX) + # FFmpeg if (DE_OS_IS_WIN32) add_subdirectory(external/ffmpeg) endif() diff --git a/external/fetch_sources.py b/external/fetch_sources.py index 4f405263c4..212a39966f 100644 --- a/external/fetch_sources.py +++ b/external/fetch_sources.py @@ -66,25 +66,28 @@ def __init__(self, url, filename, checksum, baseDir, extractDir = "src", postExt self.checksum = checksum self.archiveDir = "packages" self.postExtract = postExtract + self.sysNdx = {"Windows":0, "Linux":1, "Darwin":2}[platform.system()] + self.FFmpeg = "FFmpeg" in url - if ("FFmpeg" in url): - ndx = {"Windows":0, "Linux":1}[platform.system()] - self.url = self.url.split()[ndx] - self.checksum = self.checksum.split()[ndx] - self.filename = self.filename.split()[ndx] + if self.FFmpeg: + if self.sysNdx != 2: + self.url = self.url.split()[self.sysNdx] + self.checksum = self.checksum.split()[self.sysNdx] + self.filename = self.filename.split()[self.sysNdx] def clean (self): Source.clean(self) self.removeArchives() def update (self, cmdProtocol = None, force = False): - if not self.isArchiveUpToDate(): - self.fetchAndVerifyArchive() + if self.sysNdx != 2: + if not self.isArchiveUpToDate(): + self.fetchAndVerifyArchive() - if self.getExtractedChecksum() != self.checksum: - Source.clean(self) - self.extract() - self.storeExtractedChecksum(self.checksum) + if self.getExtractedChecksum() != self.checksum: + Source.clean(self) + self.extract() + self.storeExtractedChecksum(self.checksum) def removeArchives (self): archiveDir = os.path.join(EXTERNAL_DIR, pkg.baseDir, pkg.archiveDir) @@ -397,7 +400,7 @@ def run(*popenargs, **kwargs): if __name__ == "__main__": # Rerun script with python3 as python2 does not have lzma (xz) decompression support if sys.version_info < (3, 0): - cmd = {"Windows": ['py', '-3'], "Linux": ['python3']}[platform.system()] + cmd = {"Windows": ['py', '-3'], "Linux": ['python3'], "Darwin": ['python3']}[platform.system()] cmd = cmd + sys.argv run(cmd) else: diff --git a/external/vulkancts/framework/vulkan/vkPlatform.hpp b/external/vulkancts/framework/vulkan/vkPlatform.hpp index 77ab2c45a9..bec39d3263 100644 --- a/external/vulkancts/framework/vulkan/vkPlatform.hpp +++ b/external/vulkancts/framework/vulkan/vkPlatform.hpp @@ -399,10 +399,10 @@ class Platform Platform (void) {} ~Platform (void) {} -#if (DE_OS == DE_OS_ANDROID) - virtual Library* createLibrary (const char* libraryPath = DE_NULL) const = 0; -#else +#if (DE_OS == DE_OS_WIN32) || (DE_OS == DE_OS_UNIX) 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; #endif virtual wsi::Display* createWsiDisplay (wsi::Type wsiType) const; diff --git a/external/vulkancts/modules/vulkan/CMakeLists.txt b/external/vulkancts/modules/vulkan/CMakeLists.txt index eade987984..792a5ae1e4 100644 --- a/external/vulkancts/modules/vulkan/CMakeLists.txt +++ b/external/vulkancts/modules/vulkan/CMakeLists.txt @@ -49,7 +49,9 @@ add_subdirectory(reconvergence) add_subdirectory(mesh_shader) add_subdirectory(fragment_shading_barycentric) add_subdirectory(sc) +if (DE_OS_IS_WIN32 OR DE_OS_IS_UNIX) add_subdirectory(video) +endif() include_directories( api @@ -100,9 +102,12 @@ include_directories( fragment_shading_barycentric ${DEQP_INL_DIR} sc - video ) +if (DE_OS_IS_WIN32 OR DE_OS_IS_UNIX) +include_directories(video) +endif() + set(DEQP_VK_SRCS vktTestCaseDefs.hpp vktTestCase.cpp @@ -121,7 +126,7 @@ set(DEQP_VK_SRCS vktCustomInstancesDevices.hpp ) -set(DEQP_VK_LIBS +set(DEQP_VK_STANDARD_LIBS tcutil vkutil glutil @@ -170,9 +175,18 @@ set(DEQP_VK_LIBS deqp-vk-reconvergence deqp-vk-mesh-shader deqp-vk-fragment-shading-barycentric - deqp-vk-video ) +set(DEQP_VK_VIDEO_LIB deqp-vk-video) + +if (DE_OS_IS_WIN32 OR DE_OS_IS_UNIX) +set(DEQP_VK_LIBS + ${DEQP_VK_STANDARD_LIBS} + ${DEQP_VK_VIDEO_LIB} + ) +else() + set(DEQP_VK_LIBS ${DEQP_VK_STANDARD_LIBS}) +endif() set(DEQP_VKSC_LIBS tcutil @@ -253,19 +267,14 @@ ENDFOREACH() set(BINARY_COPY_DIR "./") +# Video parser used in vulkan video won't be part of non supported platforms if (DE_OS_IS_WIN32) add_data_dir(deqp-vk ../../../ffmpeg/src/bin ${BINARY_COPY_DIR}) + add_data_dir(deqp-vk ../../../video-parser/src/vk_video_decoder/bin/libs/nv_vkvideo_parser/wddm2_amd64_release ${BINARY_COPY_DIR}) endif() -# Video parser used in vulkan video won't be part of android target -if (NOT DE_OS_IS_ANDROID) - if (DE_OS_IS_WIN32) - add_data_dir(deqp-vk ../../../video-parser/src/vk_video_decoder/bin/libs/nv_vkvideo_parser/wddm2_amd64_release ${BINARY_COPY_DIR}) - elseif(DE_OS_IS_UNIX) - add_data_dir(deqp-vk ../../../video-parser/src/vk_video_decoder/bin/libs/nv_vkvideo_parser/linux_amd64_release ${BINARY_COPY_DIR}) - else() - message(FATAL_ERROR "System is not supported") - endif() +if(DE_OS_IS_UNIX) + add_data_dir(deqp-vk ../../../video-parser/src/vk_video_decoder/bin/libs/nv_vkvideo_parser/linux_amd64_release ${BINARY_COPY_DIR}) endif() diff --git a/external/vulkancts/modules/vulkan/api/vktApiVersionCheck.cpp b/external/vulkancts/modules/vulkan/api/vktApiVersionCheck.cpp index 1498e93c28..5f6d884f4f 100644 --- a/external/vulkancts/modules/vulkan/api/vktApiVersionCheck.cpp +++ b/external/vulkancts/modules/vulkan/api/vktApiVersionCheck.cpp @@ -133,10 +133,10 @@ 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_ANDROID) - de::MovePtr vkLibrary = de::MovePtr(platform.createLibrary(m_context.getTestContext().getCommandLine().getVkLibraryPath())); -#else +#if (DE_OS == DE_OS_WIN32) || (DE_OS == DE_OS_UNIX) de::MovePtr vkLibrary = de::MovePtr(platform.createLibrary(vk::Platform::LibraryType::LIBRARY_TYPE_VULKAN, m_context.getTestContext().getCommandLine().getVkLibraryPath())); +#else + de::MovePtr vkLibrary = de::MovePtr(platform.createLibrary(m_context.getTestContext().getCommandLine().getVkLibraryPath())); #endif const tcu::FunctionLibrary& funcLibrary = vkLibrary->getFunctionLibrary(); deUint32 failsQuantity = 0u; diff --git a/external/vulkancts/modules/vulkan/video/CMakeLists.txt b/external/vulkancts/modules/vulkan/video/CMakeLists.txt index 62b75bb1a6..dc9c835ff3 100644 --- a/external/vulkancts/modules/vulkan/video/CMakeLists.txt +++ b/external/vulkancts/modules/vulkan/video/CMakeLists.txt @@ -1,7 +1,7 @@ include_directories(..) include_directories(${FFMPEG_INCLUDE_PATH}) -set(DEQP_VK_VIDEO_SRC_TARGET_DEPENDENT +set(DEQP_VK_VIDEO_SRCS extFFmpegDemuxer.h extNvidiaVideoParserIf.hpp vktVideoSessionNvUtils.cpp @@ -10,29 +10,18 @@ set(DEQP_VK_VIDEO_SRC_TARGET_DEPENDENT vktVideoSessionFfmpegUtils.hpp vktVideoBaseDecodeUtils.hpp vktVideoBaseDecodeUtils.cpp - ) - -set(DEQP_VK_VIDEO_SRCS_TARGET_INDEPENDENT + vktVideoDecodeTests.cpp + vktVideoDecodeTests.hpp vktVideoPictureUtils.cpp vktVideoPictureUtils.hpp vktVideoCapabilitiesTests.cpp vktVideoCapabilitiesTests.hpp - vktVideoDecodeTests.cpp - vktVideoDecodeTests.hpp vktVideoTestUtils.cpp vktVideoTestUtils.hpp vktVideoTests.cpp vktVideoTests.hpp ) -if (DE_OS_IS_ANDROID) - set(DEQP_VK_VIDEO_SRCS ${DEQP_VK_VIDEO_SRCS_TARGET_INDEPENDENT}) - else() - set(DEQP_VK_VIDEO_SRCS - ${DEQP_VK_VIDEO_SRC_TARGET_DEPENDENT} - ${DEQP_VK_VIDEO_SRCS_TARGET_INDEPENDENT} - ) -endif() set(DEQP_VK_VIDEO_LIBS tcutil diff --git a/external/vulkancts/modules/vulkan/video/vktVideoSessionNvUtils.cpp b/external/vulkancts/modules/vulkan/video/vktVideoSessionNvUtils.cpp index 50ebefd001..96b9fc2aba 100644 --- a/external/vulkancts/modules/vulkan/video/vktVideoSessionNvUtils.cpp +++ b/external/vulkancts/modules/vulkan/video/vktVideoSessionNvUtils.cpp @@ -148,10 +148,10 @@ class NvFunctions: public IfcNvFunctions }; NvFunctions::NvFunctions (const vk::Platform& platform) -#if (DE_OS == DE_OS_ANDROID) - : m_library (de::MovePtr(platform.createLibrary())) -#else +#if (DE_OS == DE_OS_WIN32) || (DE_OS == DE_OS_UNIX) : m_library (de::MovePtr(platform.createLibrary(vk::Platform::LIBRARY_TYPE_VULKAN_VIDEO_DECODE_PARSER, DE_NULL))) +#else + : m_library (de::MovePtr(platform.createLibrary())) #endif { const tcu::FunctionLibrary& funcsLibrary = m_library->getFunctionLibrary(); diff --git a/external/vulkancts/modules/vulkan/vktTestPackage.cpp b/external/vulkancts/modules/vulkan/vktTestPackage.cpp index 77b53561a1..27729213fe 100644 --- a/external/vulkancts/modules/vulkan/vktTestPackage.cpp +++ b/external/vulkancts/modules/vulkan/vktTestPackage.cpp @@ -120,7 +120,9 @@ #ifdef CTS_USES_VULKANSC #include "vktSafetyCriticalTests.hpp" #endif // CTS_USES_VULKANSC +#if (DE_OS == DE_OS_WIN32) || (DE_OS == DE_OS_UNIX) #include "vktVideoTests.hpp" +#endif #include #include @@ -204,10 +206,10 @@ static void restoreStandardOutput () { qpRedirectOut(openWrite, open static MovePtr createLibrary (tcu::TestContext& testCtx) { -#if (DE_OS == DE_OS_ANDROID) - return MovePtr(testCtx.getPlatform().getVulkanPlatform().createLibrary(testCtx.getCommandLine().getVkLibraryPath())); -#else +#if (DE_OS == DE_OS_WIN32) || (DE_OS == DE_OS_UNIX) return MovePtr(testCtx.getPlatform().getVulkanPlatform().createLibrary(vk::Platform::LIBRARY_TYPE_VULKAN, testCtx.getCommandLine().getVkLibraryPath())); +#else + return MovePtr(testCtx.getPlatform().getVulkanPlatform().createLibrary(testCtx.getCommandLine().getVkLibraryPath())); #endif } @@ -1137,7 +1139,9 @@ void TestPackage::init (void) addChild(FragmentShadingBarycentric::createTests(m_testCtx)); // Amber depth pipeline tests addChild(cts_amber::createAmberDepthGroup (m_testCtx)); +#if (DE_OS == DE_OS_WIN32) || (DE_OS == DE_OS_UNIX) addChild(video::createTests (m_testCtx)); +#endif } void ExperimentalTestPackage::init (void) diff --git a/external/vulkancts/vkscpc/vkscpc.cpp b/external/vulkancts/vkscpc/vkscpc.cpp index 1dc60faa3f..55b5665c8f 100644 --- a/external/vulkancts/vkscpc/vkscpc.cpp +++ b/external/vulkancts/vkscpc/vkscpc.cpp @@ -288,7 +288,11 @@ int main (int argc, char** argv) tcu::DirArchive archive {""}; tcu::TestLog log { cmdLine.getOption().c_str() }; log.supressLogging(true); de::SharedPtr platform {createPlatform()}; +#if (DE_OS == DE_OS_WIN32) || (DE_OS == DE_OS_UNIX) de::SharedPtr library {platform->getVulkanPlatform().createLibrary(vk::Platform::LIBRARY_TYPE_VULKAN, DE_NULL)}; +#else + de::SharedPtr library {platform->getVulkanPlatform().createLibrary(DE_NULL)}; +#endif tcu::TestContext tcx {*platform, archive, log, cmdLineDummy, nullptr}; vk::BinaryCollection collection {}; vkt::Context context (tcx, library->getPlatformInterface(), collection, de::SharedPtr{new vk::ResourceInterfaceStandard{ tcx }}); diff --git a/external/vulkancts/vkscserver/vksServices.cpp b/external/vulkancts/vkscserver/vksServices.cpp index 0b4850b6e1..461c7a349f 100644 --- a/external/vulkancts/vkscserver/vksServices.cpp +++ b/external/vulkancts/vkscserver/vksServices.cpp @@ -163,7 +163,11 @@ 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) vk::Library* library {platform->getVulkanPlatform().createLibrary(vk::Platform::LIBRARY_TYPE_VULKAN, DE_NULL)}; +#else + vk::Library* library {platform->getVulkanPlatform().createLibrary(DE_NULL)}; +#endif tcu::TestContext* tcx = new tcu::TestContext{*platform, archive, log, cmdLine, nullptr}; vk::ResourceInterface* resource = new vk::ResourceInterfaceStandard{*tcx}; vk::BinaryCollection* collection = new vk::BinaryCollection{};