set_target_properties(deqp PROPERTIES XCODE_ATTRIBUTE_TARGETED_DEVICE_FAMILY "1,2")
set_target_properties(deqp PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer: ${DEQP_IOS_CODE_SIGN_IDENTITY}")
endif ()
+
+if (DE_OS_IS_FUCHSIA)
+ # The default Fuchsia stack is small, so the size needs to be increased to at
+ # least 2**20 bytes, but 2**24 is chosen for safety.
+ set_target_properties(deqp-vk PROPERTIES LINK_FLAGS "-Wl,-z,stack-size=0x1000000")
+endif ()
add_definitions(-D_XOPEN_SOURCE=600)
endif ()
+if (DE_OS_IS_FUCHSIA)
+ add_definitions(-DZ_HAVE_UNISTD_H)
+endif ()
+
set(CMAKE_C_FLAGS ${DE_3RD_PARTY_C_FLAGS})
add_library(z STATIC ${ZLIB_SRCS})
DE_MAKE_ENV_BOOL("DE_OS" "OSX")
DE_MAKE_ENV_BOOL("DE_OS" "ANDROID")
DE_MAKE_ENV_BOOL("DE_OS" "IOS")
+DE_MAKE_ENV_BOOL("DE_OS" "FUCHSIA")
# Prevent mixed compile with GCC and Clang
if (NOT (CMAKE_C_COMPILER_ID MATCHES "GNU") EQUAL (CMAKE_CXX_COMPILER_ID MATCHES "GNU"))
fprintf(stderr, "Assertion '%s' failed at %s:%d\n", reason, file, line);
raise(SIGTRAP);
abort();
-#elif (DE_OS == DE_OS_UNIX)
+#elif (DE_OS == DE_OS_UNIX) || (DE_OS == DE_OS_FUCHSIA)
__assert_fail(reason, file, (unsigned int)line, "Unknown function");
#elif (DE_OS == DE_OS_QNX)
__assert(reason, file, (unsigned int)line, "Unknown function");
#define DE_OS_SYMBIAN 6 /*!< Symbian OS */
#define DE_OS_IOS 7 /*!< iOS */
#define DE_OS_QNX 8 /*!< QNX */
+#define DE_OS_FUCHSIA 9 /*!< Fuchsia */
/* OS detection (set to one of DE_OS_*). */
#if defined(DE_OS)
#if (DE_OS == DE_OS_WIN32 && DE_COMPILER == DE_COMPILER_MSC)
# define DE_DIRITER DE_DIRITER_WIN32
-#elif (DE_OS == DE_OS_UNIX) || (DE_OS == DE_OS_OSX) || (DE_OS == DE_OS_ANDROID) || (DE_OS == DE_OS_SYMBIAN) || (DE_OS == DE_OS_IOS) || (DE_OS == DE_OS_QNX) || (DE_OS == DE_OS_WIN32 && (DE_COMPILER == DE_COMPILER_CLANG || DE_COMPILER == DE_COMPILER_GCC))
+#elif (DE_OS == DE_OS_UNIX) || (DE_OS == DE_OS_OSX) || (DE_OS == DE_OS_ANDROID) || (DE_OS == DE_OS_SYMBIAN) || (DE_OS == DE_OS_IOS) || (DE_OS == DE_OS_QNX) || (DE_OS == DE_OS_WIN32 && (DE_COMPILER == DE_COMPILER_CLANG || DE_COMPILER == DE_COMPILER_GCC)) || (DE_OS == DE_OS_FUCHSIA)
# define DE_DIRITER DE_DIRITER_POSIX
#endif
#if (DE_OS == DE_OS_WIN32)
if (!CreateDirectory(path, DE_NULL))
throw std::runtime_error("Failed to create directory");
-#elif (DE_OS == DE_OS_UNIX) || (DE_OS == DE_OS_OSX) || (DE_OS == DE_OS_IOS) || (DE_OS == DE_OS_ANDROID) || (DE_OS == DE_OS_SYMBIAN) || (DE_OS == DE_OS_QNX)
+#elif (DE_OS == DE_OS_UNIX) || (DE_OS == DE_OS_OSX) || (DE_OS == DE_OS_IOS) || (DE_OS == DE_OS_ANDROID) || (DE_OS == DE_OS_SYMBIAN) || (DE_OS == DE_OS_QNX) || (DE_OS == DE_OS_FUCHSIA)
if (mkdir(path, 0777) != 0)
throw std::runtime_error("Failed to create directory");
#else
set(DETHREAD_LIBS ${DETHREAD_LIBS} pthread)
endif ()
-if (DE_OS_IS_ANDROID OR DE_OS_IS_OSX OR DE_OS_IS_IOS OR DE_OS_IS_QNX)
+if (DE_OS_IS_ANDROID OR DE_OS_IS_OSX OR DE_OS_IS_IOS OR DE_OS_IS_QNX OR DE_OS_IS_FUCHSIA)
add_definitions(-D_XOPEN_SOURCE=600)
endif ()
#include "deMutex.h"
-#if (DE_OS == DE_OS_UNIX || DE_OS == DE_OS_ANDROID || DE_OS == DE_OS_SYMBIAN || DE_OS == DE_OS_QNX || DE_OS == DE_OS_OSX || DE_OS == DE_OS_IOS)
+#if (DE_OS == DE_OS_UNIX || DE_OS == DE_OS_ANDROID || DE_OS == DE_OS_SYMBIAN || DE_OS == DE_OS_QNX || DE_OS == DE_OS_OSX || DE_OS == DE_OS_IOS) || (DE_OS == DE_OS_FUCHSIA)
#include "deMemory.h"
#include "deSemaphore.h"
-#if (DE_OS == DE_OS_UNIX || DE_OS == DE_OS_ANDROID || DE_OS == DE_OS_SYMBIAN || DE_OS == DE_OS_QNX)
+#if (DE_OS == DE_OS_UNIX || DE_OS == DE_OS_ANDROID || DE_OS == DE_OS_SYMBIAN || DE_OS == DE_OS_QNX) || (DE_OS == DE_OS_FUCHSIA)
#include "deMemory.h"
#include "deThreadLocal.h"
-#if (DE_OS == DE_OS_UNIX || DE_OS == DE_OS_OSX || DE_OS == DE_OS_ANDROID || DE_OS == DE_OS_SYMBIAN || DE_OS == DE_OS_IOS || DE_OS == DE_OS_QNX)
+#if (DE_OS == DE_OS_UNIX || DE_OS == DE_OS_OSX || DE_OS == DE_OS_ANDROID || DE_OS == DE_OS_SYMBIAN || DE_OS == DE_OS_IOS || DE_OS == DE_OS_QNX || DE_OS == DE_OS_FUCHSIA)
#if !defined(_XOPEN_SOURCE) || (_XOPEN_SOURCE < 500)
# error You are using too old posix API!
#include "deThread.h"
-#if (DE_OS == DE_OS_UNIX || DE_OS == DE_OS_OSX || DE_OS == DE_OS_ANDROID || DE_OS == DE_OS_SYMBIAN || DE_OS == DE_OS_IOS || DE_OS == DE_OS_QNX)
+#if (DE_OS == DE_OS_UNIX || DE_OS == DE_OS_OSX || DE_OS == DE_OS_ANDROID || DE_OS == DE_OS_SYMBIAN || DE_OS == DE_OS_IOS || DE_OS == DE_OS_QNX || DE_OS == DE_OS_FUCHSIA)
#include "deMemory.h"
#include "deInt32.h"
deDynamicLibrary.h
deFile.c
deFile.h
- deProcess.c
deProcess.h
deSocket.c
deSocket.h
set(DEUTIL_LIBS debase dethread depool)
+if (DE_OS_IS_FUCHSIA)
+ # Process launching isn't currently supported on Fuchsia in this library.
+ # Building executor and execserver will fail.
+else ()
+ set(DEUTIL_SRCS ${DEUTIL_SRCS} deProcess.c)
+endif ()
+
include_directories(
../debase
../dethread
return count.QuadPart / (freq.QuadPart / 1000000);
}
-#elif (DE_OS == DE_OS_UNIX) || (DE_OS == DE_OS_ANDROID) || (DE_OS == DE_OS_QNX)
+#elif (DE_OS == DE_OS_UNIX) || (DE_OS == DE_OS_ANDROID) || (DE_OS == DE_OS_QNX) || (DE_OS == DE_OS_FUCHSIA)
struct timespec currTime;
clock_gettime(CLOCK_MONOTONIC, &currTime);
return (deUint64)currTime.tv_sec*1000000 + ((deUint64)currTime.tv_nsec/1000);
#include "deDynamicLibrary.h"
#include "deMemory.h"
-#if (DE_OS == DE_OS_UNIX) || (DE_OS == DE_OS_ANDROID) || (DE_OS == DE_OS_OSX) || (DE_OS == DE_OS_SYMBIAN) || (DE_OS == DE_OS_IOS) || (DE_OS == DE_OS_QNX)
+#if (DE_OS == DE_OS_UNIX) || (DE_OS == DE_OS_ANDROID) || (DE_OS == DE_OS_OSX) || (DE_OS == DE_OS_SYMBIAN) || (DE_OS == DE_OS_IOS) || (DE_OS == DE_OS_QNX) || (DE_OS == DE_OS_FUCHSIA)
/* Posix implementation. */
#include <dlfcn.h>
#include "deFile.h"
#include "deMemory.h"
-#if (DE_OS == DE_OS_UNIX) || (DE_OS == DE_OS_OSX) || (DE_OS == DE_OS_IOS) || (DE_OS == DE_OS_ANDROID) || (DE_OS == DE_OS_SYMBIAN) || (DE_OS == DE_OS_QNX)
+#if (DE_OS == DE_OS_UNIX) || (DE_OS == DE_OS_OSX) || (DE_OS == DE_OS_IOS) || (DE_OS == DE_OS_ANDROID) || (DE_OS == DE_OS_SYMBIAN) || (DE_OS == DE_OS_QNX) || (DE_OS == DE_OS_FUCHSIA)
#include <sys/types.h>
#include <sys/stat.h>
#if (DE_OS == DE_OS_WIN32)
# define DE_USE_WINSOCK
-#elif (DE_OS == DE_OS_UNIX) || (DE_OS == DE_OS_OSX) || (DE_OS == DE_OS_IOS) || (DE_OS == DE_OS_ANDROID) || (DE_OS == DE_OS_SYMBIAN) || (DE_OS == DE_OS_QNX)
+#elif (DE_OS == DE_OS_UNIX) || (DE_OS == DE_OS_OSX) || (DE_OS == DE_OS_IOS) || (DE_OS == DE_OS_ANDROID) || (DE_OS == DE_OS_SYMBIAN) || (DE_OS == DE_OS_QNX) || (DE_OS == DE_OS_FUCHSIA)
# define DE_USE_BERKELEY_SOCKETS
#else
# error Implement deSocket for your OS.
)
list(APPEND TCUTIL_PLATFORM_LIBS ${QUARTZCORE_LIBRARY} ${COCOA_LIBRARY})
+ elseif (DE_OS_IS_FUCHSIA)
+ set(TCUTIL_PLATFORM_SRCS
+ fuchsia/tcuFuchsiaPlatform.cpp
+ )
+
else ()
set(TCUTIL_PLATFORM_SRCS
vanilla/tcuVanillaPlatform.cpp
--- /dev/null
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program Tester Core
+ * ----------------------------------------
+ *
+ * Copyright (c) 2022 Google, 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 Fuchsia Platform definition.
+ *//*--------------------------------------------------------------------*/
+
+#include "tcuFunctionLibrary.hpp"
+#include "tcuPlatform.hpp"
+#include "vkPlatform.hpp"
+
+class FuchsiaVkLibrary : public vk::Library {
+public:
+ FuchsiaVkLibrary(const char* library_path)
+ : library_(library_path ? library_path : "libvulkan.so"), driver_(library_) {}
+
+ const vk::PlatformInterface& getPlatformInterface() const {
+ return driver_;
+ }
+ const tcu::FunctionLibrary& getFunctionLibrary (void) const
+ {
+ return library_;
+ }
+
+private:
+ const tcu::DynamicFunctionLibrary library_;
+ const vk::PlatformDriver driver_;
+};
+
+class FuchsiaVkPlatform : public vk::Platform {
+public:
+ vk::Library* createLibrary(const char* library_path) const {
+ return new FuchsiaVkLibrary(library_path);
+ }
+
+ void describePlatform (std::ostream& dst) const
+ {
+ dst << "OS: Fuchsia\n";
+ const char* cpu = "Unknown";
+#if defined(__x86_64__)
+ cpu = "x86_64";
+#elif defined(__aarch64__)
+ cpu = "aarch64";
+#endif
+ dst << "CPU: " << cpu << "\n";
+ }
+
+ void getMemoryLimits(tcu::PlatformMemoryLimits& limits) const {
+ // Copied from tcuX11VulkanPlatform.cpp
+ limits.totalSystemMemory = 256 * 1024 * 1024;
+ limits.totalDeviceLocalMemory = 0; // unified memory
+ limits.deviceMemoryAllocationGranularity = 64 * 1024;
+ limits.devicePageSize = 4096;
+ limits.devicePageTableEntrySize = 8;
+ limits.devicePageTableHierarchyLevels = 3;
+ }
+};
+
+class FuchsiaPlatform : public tcu::Platform {
+public:
+ ~FuchsiaPlatform() {}
+
+ const vk::Platform& getVulkanPlatform() const { return vk_platform_; }
+
+private:
+ FuchsiaVkPlatform vk_platform_;
+};
+
+tcu::Platform* createPlatform() {
+ return new FuchsiaPlatform();
+}
--- /dev/null
+message("*** Fuchsia")
+set(DEQP_TARGET_NAME "Fuchsia")
+
+# Fuchsia doesn't support OpenGL natively.
+set(DEQP_SUPPORT_GLES2 OFF)
+set(DEQP_SUPPORT_GLES3 OFF)
+set(DEQP_SUPPORT_OPENGL OFF)
+set(DEQP_SUPPORT_EGL OFF)
+
+set(DEQP_PLATFORM_LIBRARIES "")