Fix external memory opaque fd tests for MacOS
authorziga-lunarg <ziga@lunarg.com>
Wed, 21 Sep 2022 21:00:04 +0000 (23:00 +0200)
committerMatthew Netsch <quic_mnetsch@quicinc.com>
Thu, 6 Oct 2022 15:47:24 +0000 (15:47 +0000)
Components: Vulkan

VK-GL-CTS issue: 3981

Affected tests:
dEQP-VK.api.external.memory.*

Change-Id: I21a169aab047e58bc716d2aa69426b23af9295f2

external/vulkancts/modules/vulkan/util/vktExternalMemoryUtil.cpp

index 233e0cc..0a8ef0b 100644 (file)
@@ -23,7 +23,7 @@
 
 #include "vkQueryUtil.hpp"
 
-#if (DE_OS == DE_OS_ANDROID) || (DE_OS == DE_OS_UNIX)
+#if (DE_OS == DE_OS_ANDROID) || (DE_OS == DE_OS_UNIX) || (DE_OS == DE_OS_OSX)
 #      include <unistd.h>
 #      include <fcntl.h>
 #      include <errno.h>
@@ -73,7 +73,7 @@ NativeHandle::NativeHandle (const NativeHandle& other)
 {
        if (other.m_fd >= 0)
        {
-#if (DE_OS == DE_OS_ANDROID) || (DE_OS == DE_OS_UNIX)
+#if (DE_OS == DE_OS_ANDROID) || (DE_OS == DE_OS_UNIX) || (DE_OS == DE_OS_OSX)
                DE_ASSERT(!other.m_win32Handle.internal);
                DE_ASSERT(!other.m_androidHardwareBuffer.internal);
                m_fd = dup(other.m_fd);
@@ -164,7 +164,7 @@ void NativeHandle::reset (void)
 {
        if (m_fd >= 0)
        {
-#if (DE_OS == DE_OS_ANDROID) || (DE_OS == DE_OS_UNIX)
+#if (DE_OS == DE_OS_ANDROID) || (DE_OS == DE_OS_UNIX) || (DE_OS == DE_OS_OSX)
                DE_ASSERT(!m_win32Handle.internal);
                DE_ASSERT(!m_androidHardwareBuffer.internal);
                ::close(m_fd);