From 755593635076afa86efbe4e39096571cd5db88a3 Mon Sep 17 00:00:00 2001 From: Eric Griffith Date: Mon, 9 Dec 2024 19:39:45 -0800 Subject: [PATCH] IGL: Tidy up platform names Reviewed By: rameshviswanathan Differential Revision: D66903566 fbshipit-source-id: ddf6e6ac68d048afbc9a34c3bae30fd86ca720ef --- IGLU/imgui/Session.cpp | 4 +- IGLU/shaderCross/ShaderCross.cpp | 2 +- samples/desktop/Tiny/Tiny.cpp | 6 +- samples/desktop/Tiny/Tiny_MeshLarge.cpp | 8 +- shell/openxr/XrPlatform.h | 4 +- shell/openxr/mobile/AndroidMain.cpp | 8 +- shell/openxr/mobile/XrApp.cpp | 4 +- shell/renderSessions/GPUStressSession.cpp | 2 +- .../shared/extension/SymbolFactoryLoader.cpp | 2 +- shell/shared/fileLoader/win/FileLoaderWin.cpp | 4 +- .../ScreenshotTestRenderSessionHelper.cpp | 2 +- shell/shared/testShell/TestShell.cpp | 4 +- src/igl/Assert.cpp | 4 +- src/igl/Buffer.h | 2 +- src/igl/Log.cpp | 4 +- src/igl/Macros.h | 36 +++---- src/igl/NameHandle.cpp | 2 +- src/igl/metal/Buffer.mm | 6 +- src/igl/metal/Device.mm | 6 +- src/igl/metal/DeviceFeatureSet.mm | 12 +-- src/igl/metal/HWDevice.mm | 6 +- src/igl/metal/Texture.mm | 96 +++++++++---------- src/igl/opengl/GLIncludes.h | 4 +- src/igl/opengl/HWDevice.h | 2 +- src/igl/opengl/Macros.h | 2 +- src/igl/opengl/wgl/PlatformDevice.h | 2 +- src/igl/tests/Multiview.cpp | 6 +- src/igl/tests/TextureFloat.cpp | 4 +- src/igl/tests/TextureHalfFloat.cpp | 8 +- src/igl/tests/metal/Texture.mm | 14 +-- src/igl/tests/ogl/Context.cpp | 2 +- src/igl/tests/ogl/HWDevice.cpp | 8 +- src/igl/tests/ogl/PlatformDevice.cpp | 8 +- src/igl/tests/util/Common.h | 2 +- src/igl/tests/util/TextureValidationHelpers.h | 2 +- src/igl/tests/util/device/TestDevice.cpp | 4 +- .../tests/util/device/opengl/TestDevice.cpp | 8 +- .../tests/util/device/vulkan/TestDevice.cpp | 8 +- src/igl/tests/vulkan/CommonTest.cpp | 2 +- src/igl/tests/vulkan/Device.cpp | 8 +- .../EnhancedShaderDebuggingStoreTest.cpp | 2 +- .../tests/vulkan/RenderPipelineStateTest.cpp | 2 +- src/igl/tests/vulkan/VulkanImageTest.cpp | 10 +- src/igl/tests/vulkan/VulkanSwapchainTest.cpp | 8 +- src/igl/vulkan/Common.h | 2 +- src/igl/vulkan/VulkanContext.cpp | 6 +- src/igl/vulkan/VulkanExtensions.cpp | 12 +-- src/igl/vulkan/VulkanHelpers.c | 8 +- src/igl/vulkan/VulkanImage.cpp | 12 +-- src/igl/vulkan/VulkanImage.h | 12 +-- src/igl/win/LogDefault.cpp | 4 +- 51 files changed, 198 insertions(+), 198 deletions(-) diff --git a/IGLU/imgui/Session.cpp b/IGLU/imgui/Session.cpp index 30bccd77fa..9daed8d75e 100644 --- a/IGLU/imgui/Session.cpp +++ b/IGLU/imgui/Session.cpp @@ -62,7 +62,7 @@ static std::string getOpenGLVertexShaderSource(igl::ShaderVersion shaderVersion) std::string shader; if (shaderVersion.majorVersion > 1 || shaderVersion.minorVersion > 30 || shaderVersion.family == igl::ShaderFamily::GlslEs) { -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX shader += "#version 100\n"; #endif shader += "precision mediump float;"; @@ -105,7 +105,7 @@ static std::string getOpenGLFragmentShaderSource(igl::ShaderVersion shaderVersio std::string shader; if (shaderVersion.majorVersion > 1 || shaderVersion.minorVersion > 30 || shaderVersion.family == igl::ShaderFamily::GlslEs) { -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX shader += "#version 100\n"; #endif shader += "precision mediump float;"; diff --git a/IGLU/shaderCross/ShaderCross.cpp b/IGLU/shaderCross/ShaderCross.cpp index fc8dd59bc7..f67d1dd0ec 100644 --- a/IGLU/shaderCross/ShaderCross.cpp +++ b/IGLU/shaderCross/ShaderCross.cpp @@ -60,7 +60,7 @@ std::string ShaderCross::crossCompileFromVulkanSource(const char* source, if (device_.getBackendType() == igl::BackendType::Metal) { spirv_cross::CompilerMSL mslCompiler(std::move(spirvCode)); spirv_cross::CompilerMSL::Options options; -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX options.platform = spirv_cross::CompilerMSL::Options::macOS; #else options.platform = spirv_cross::CompilerMSL::Options::iOS; diff --git a/samples/desktop/Tiny/Tiny.cpp b/samples/desktop/Tiny/Tiny.cpp index 5b37fb9875..ccc5678b3a 100644 --- a/samples/desktop/Tiny/Tiny.cpp +++ b/samples/desktop/Tiny/Tiny.cpp @@ -39,7 +39,7 @@ // clang-format off #if USE_OPENGL_BACKEND - #if IGL_PLATFORM_WIN + #if IGL_PLATFORM_WINDOWS #include #include #include @@ -195,7 +195,7 @@ static void initIGL() { // create a device { #if USE_OPENGL_BACKEND -#if IGL_PLATFORM_WIN +#if IGL_PLATFORM_WINDOWS auto ctx = std::make_unique(GetDC(glfwGetWin32Window(window_)), glfwGetWGLContext(window_)); device_ = std::make_unique(std::move(ctx)); @@ -290,7 +290,7 @@ static std::shared_ptr getNativeDrawable() { Result ret; std::shared_ptr drawable; #if USE_OPENGL_BACKEND -#if IGL_PLATFORM_WIN +#if IGL_PLATFORM_WINDOWS const auto& platformDevice = device_->getPlatformDevice(); IGL_DEBUG_ASSERT(platformDevice != nullptr); drawable = platformDevice->createTextureFromNativeDrawable(&ret); diff --git a/samples/desktop/Tiny/Tiny_MeshLarge.cpp b/samples/desktop/Tiny/Tiny_MeshLarge.cpp index afc3171fc2..cba0bdfcae 100644 --- a/samples/desktop/Tiny/Tiny_MeshLarge.cpp +++ b/samples/desktop/Tiny/Tiny_MeshLarge.cpp @@ -76,7 +76,7 @@ #include #include #include - #if IGL_PLATFORM_WIN + #if IGL_PLATFORM_WINDOWS #include #include #include @@ -951,7 +951,7 @@ void initIGL() { { const Result result; #if USE_OPENGL_BACKEND -#if IGL_PLATFORM_WIN +#if IGL_PLATFORM_WINDOWS auto ctx = std::make_unique(GetDC(glfwGetWin32Window(window_)), glfwGetWGLContext(window_)); device_ = std::make_unique(std::move(ctx)); @@ -1736,7 +1736,7 @@ std::shared_ptr getNativeDrawable() { Result ret; std::shared_ptr drawable; #if USE_OPENGL_BACKEND -#if IGL_PLATFORM_WIN +#if IGL_PLATFORM_WINDOWS const auto& platformDevice = device_->getPlatformDevice(); IGL_DEBUG_ASSERT(platformDevice != nullptr); drawable = platformDevice->createTextureFromNativeDrawable(&ret); @@ -1760,7 +1760,7 @@ std::shared_ptr getNativeDepthDrawable() { Result ret; std::shared_ptr drawable; #if USE_OPENGL_BACKEND -#if IGL_PLATFORM_WIN +#if IGL_PLATFORM_WINDOWS const auto& platformDevice = device_->getPlatformDevice(); IGL_DEBUG_ASSERT(platformDevice != nullptr); drawable = platformDevice->createTextureFromNativeDepth(width_, height_, &ret); diff --git a/shell/openxr/XrPlatform.h b/shell/openxr/XrPlatform.h index 35cb2462d7..7622061a23 100644 --- a/shell/openxr/XrPlatform.h +++ b/shell/openxr/XrPlatform.h @@ -27,13 +27,13 @@ #endif // IGL_BACKEND_OPENGL #endif // IGL_PLATFORM_ANDROID -#if IGL_PLATFORM_WIN +#if IGL_PLATFORM_WINDOWS #if !defined(WIN32_LEAN_AND_MEAN) #define WIN32_LEAN_AND_MEAN #endif #include #include -#endif // IGL_PLATFORM_WIN +#endif // IGL_PLATFORM_WINDOWS #include #include diff --git a/shell/openxr/mobile/AndroidMain.cpp b/shell/openxr/mobile/AndroidMain.cpp index 281f565f0f..f93e9411dd 100644 --- a/shell/openxr/mobile/AndroidMain.cpp +++ b/shell/openxr/mobile/AndroidMain.cpp @@ -31,9 +31,9 @@ #include #endif -#if IGL_PLATFORM_WIN +#if IGL_PLATFORM_WINDOWS #include "ShellScalingApi.h" -#endif // IGL_PLATFORM_WIN +#endif // IGL_PLATFORM_WINDOWS XrInstance gInstance_; XrInstance getXrInstance() { @@ -194,9 +194,9 @@ void android_main(struct android_app* app) { #else // To run via MetaXR Simulator or Monado. int main(int argc, const char* argv[]) { -#if IGL_PLATFORM_WIN +#if IGL_PLATFORM_WINDOWS SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE); -#endif // IGL_PLATFORM_WIN +#endif // IGL_PLATFORM_WINDOWS #if defined(USE_VULKAN_BACKEND) // Do not present running on MetaXR Simulator. It has its own composition and present. diff --git a/shell/openxr/mobile/XrApp.cpp b/shell/openxr/mobile/XrApp.cpp index f7099837ab..f3cb8eb40f 100644 --- a/shell/openxr/mobile/XrApp.cpp +++ b/shell/openxr/mobile/XrApp.cpp @@ -28,7 +28,7 @@ #include #include #endif -#if IGL_PLATFORM_WIN +#if IGL_PLATFORM_WINDOWS #include #endif @@ -557,7 +557,7 @@ void XrApp::createShellSession(std::unique_ptr device, AAssetManag static_cast(platform_->getFileLoader()).setAssetManager(assetMgr); #elif IGL_PLATFORM_APPLE platform_ = std::make_shared(std::move(device)); -#elif IGL_PLATFORM_WIN +#elif IGL_PLATFORM_WINDOWS platform_ = std::make_shared(std::move(device)); #endif diff --git a/shell/renderSessions/GPUStressSession.cpp b/shell/renderSessions/GPUStressSession.cpp index 4a72db8d7a..9066590ef8 100644 --- a/shell/renderSessions/GPUStressSession.cpp +++ b/shell/renderSessions/GPUStressSession.cpp @@ -1105,7 +1105,7 @@ std::string GPUStressSession::getCurrentUsageString() const { return output; } void GPUStressSession::setNumLayers(size_t numLayers) { -#if !defined(IGL_PLATFORM_WIN) +#if !defined(IGL_PLATFORM_WINDOWS) igl::shell::QuadLayerParams params; params.layerInfo.reserve(numLayers); for (int i = 0; i < numLayers; i++) { diff --git a/shell/shared/extension/SymbolFactoryLoader.cpp b/shell/shared/extension/SymbolFactoryLoader.cpp index 81ff56891f..b16b98f600 100644 --- a/shell/shared/extension/SymbolFactoryLoader.cpp +++ b/shell/shared/extension/SymbolFactoryLoader.cpp @@ -16,7 +16,7 @@ #define IGL_DL_UNIX 1 #elif (defined(IGL_PLATFORM_ANDROID) && IGL_PLATFORM_ANDROID) #define IGL_DL_UNIX 1 - #elif (defined(IGL_PLATFORM_WIN) && IGL_PLATFORM_WIN) && !defined(IGL_PLATFORM_UWP) + #elif (defined(IGL_PLATFORM_WINDOWS) && IGL_PLATFORM_WINDOWS) && !defined(IGL_PLATFORM_UWP) #define IGL_DL_DLL 1 #endif #endif // !defined(IGL_DL_UNIX) || !defined(IGL_DL_DLL) diff --git a/shell/shared/fileLoader/win/FileLoaderWin.cpp b/shell/shared/fileLoader/win/FileLoaderWin.cpp index e012af335c..6ca49d89a2 100644 --- a/shell/shared/fileLoader/win/FileLoaderWin.cpp +++ b/shell/shared/fileLoader/win/FileLoaderWin.cpp @@ -15,7 +15,7 @@ // @fb-only // @fb-only // @fb-only -#if IGL_PLATFORM_WIN +#if IGL_PLATFORM_WINDOWS #include #endif @@ -49,7 +49,7 @@ std::string findSubdir(const char* subdir, const std::string& fileName) { namespace igl::shell { FileLoaderWin::FileLoaderWin() { -#if IGL_PLATFORM_WIN +#if IGL_PLATFORM_WINDOWS wchar_t path[MAX_PATH] = {0}; if (IGL_DEBUG_VERIFY(GetModuleFileNameW(NULL, path, MAX_PATH) != 0)) { basePath_ = std::filesystem::path(path).parent_path().string(); diff --git a/shell/shared/renderSession/ScreenshotTestRenderSessionHelper.cpp b/shell/shared/renderSession/ScreenshotTestRenderSessionHelper.cpp index 14494667d0..0711f884fd 100644 --- a/shell/shared/renderSession/ScreenshotTestRenderSessionHelper.cpp +++ b/shell/shared/renderSession/ScreenshotTestRenderSessionHelper.cpp @@ -34,7 +34,7 @@ void SaveFrameBufferToPng(const char* absoluteFilename, const size_t numPixels = frameBuffersize.width * frameBuffersize.height * bytesPerPixel; -#if IGL_PLATFORM_WIN +#if IGL_PLATFORM_WINDOWS if (imageData.desc.format == TextureFormat::BGRA_UNorm8) { // Swap B and R channels, as image writer expects RGBA. // Note that this is only defined for the Windows platform, as in practice diff --git a/shell/shared/testShell/TestShell.cpp b/shell/shared/testShell/TestShell.cpp index 4c926affb3..1dce820c26 100644 --- a/shell/shared/testShell/TestShell.cpp +++ b/shell/shared/testShell/TestShell.cpp @@ -65,11 +65,11 @@ void TestShellBase::SetUp(ScreenSize screenSize) { std::shared_ptr iglDevice = createTestDevice(); ASSERT_TRUE(iglDevice != nullptr); // Create platform shell to run the tests with -#if defined(IGL_PLATFORM_MACOS) && IGL_PLATFORM_MACOS +#if defined(IGL_PLATFORM_MACOSX) && IGL_PLATFORM_MACOSX platform_ = std::make_shared(std::move(iglDevice)); #elif defined(IGL_PLATFORM_IOS) && IGL_PLATFORM_IOS platform_ = std::make_shared(std::move(iglDevice)); -#elif defined(IGL_PLATFORM_WIN) && IGL_PLATFORM_WIN +#elif defined(IGL_PLATFORM_WINDOWS) && IGL_PLATFORM_WINDOWS platform_ = std::make_shared(std::move(iglDevice)); #elif defined(IGL_PLATFORM_ANDROID) && IGL_PLATFORM_ANDROID platform_ = std::make_shared(std::move(iglDevice)); diff --git a/src/igl/Assert.cpp b/src/igl/Assert.cpp index a9e36b06cd..bc5806f4b1 100644 --- a/src/igl/Assert.cpp +++ b/src/igl/Assert.cpp @@ -47,7 +47,7 @@ void setDebugBreakEnabled(bool enabled) { #if IGL_PLATFORM_APPLE || IGL_PLATFORM_ANDROID || IGL_PLATFORM_LINUX #define IGL_DEBUGGER_SIGTRAP 1 #include -#elif IGL_PLATFORM_WIN +#elif IGL_PLATFORM_WINDOWS #include #include #endif @@ -57,7 +57,7 @@ void _IGLDebugBreak() { if (igl::isDebugBreakEnabled()) { #ifdef IGL_DEBUGGER_SIGTRAP raise(SIGTRAP); -#elif IGL_PLATFORM_WIN +#elif IGL_PLATFORM_WINDOWS if (!IsDebuggerPresent()) { IGLLog(IGLLogError, "[IGL] Skipping debug break - debugger not present"); return; diff --git a/src/igl/Buffer.h b/src/igl/Buffer.h index 50c1fa3864..e919302892 100644 --- a/src/igl/Buffer.h +++ b/src/igl/Buffer.h @@ -94,7 +94,7 @@ struct BufferDesc { type(type), debugName(std::move(debugName)) { if (storage == ResourceStorage::Invalid) { -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX storage = ResourceStorage::Managed; #else storage = ResourceStorage::Shared; diff --git a/src/igl/Log.cpp b/src/igl/Log.cpp index 237f5b8268..8cb4674a46 100644 --- a/src/igl/Log.cpp +++ b/src/igl/Log.cpp @@ -16,7 +16,7 @@ #if IGL_PLATFORM_ANDROID #include -#elif IGL_PLATFORM_WIN +#elif IGL_PLATFORM_WINDOWS #include #endif @@ -24,7 +24,7 @@ static IGLLogHandlerFunc* GetHandle() { #if IGL_PLATFORM_ANDROID static IGLLogHandlerFunc sHandler = IGLAndroidLogDefaultHandler; -#elif IGL_PLATFORM_WIN +#elif IGL_PLATFORM_WINDOWS static IGLLogHandlerFunc sHandler = IGLWinLogDefaultHandler; #else static IGLLogHandlerFunc sHandler = IGLLogDefaultHandler; diff --git a/src/igl/Macros.h b/src/igl/Macros.h index 8ee08ed99a..0dbe7e6fba 100644 --- a/src/igl/Macros.h +++ b/src/igl/Macros.h @@ -19,13 +19,13 @@ /// The following set of conditionals exist and currently are supported: /// /// Windows: -/// IGL_PLATFORM_WIN +/// IGL_PLATFORM_WINDOWS /// Apple: /// IGL_PLATFORM_APPLE /// IGL_PLATFORM_IOS /// IGL_PLATFORM_IOS_SIMULATOR /// IGL_PLATFORM_MACCATALYST -/// IGL_PLATFORM_MACOS +/// IGL_PLATFORM_MACOSX /// Android: /// IGL_PLATFORM_ANDROID /// Linux: @@ -36,18 +36,18 @@ // clang-format off // Windows #if defined(_WIN32) - #define IGL_PLATFORM_WIN 1 + #define IGL_PLATFORM_WINDOWS 1 #define IGL_PLATFORM_APPLE 0 #define IGL_PLATFORM_IOS 0 #define IGL_PLATFORM_IOS_SIMULATOR 0 #define IGL_PLATFORM_MACCATALYST 0 - #define IGL_PLATFORM_MACOS 0 + #define IGL_PLATFORM_MACOSX 0 #define IGL_PLATFORM_ANDROID 0 #define IGL_PLATFORM_LINUX 0 #define IGL_PLATFORM_EMSCRIPTEN 0 // Apple #elif defined (__APPLE__) - #define IGL_PLATFORM_WIN 0 + #define IGL_PLATFORM_WINDOWS 0 #define IGL_PLATFORM_ANDROID 0 #define IGL_PLATFORM_LINUX 0 #define IGL_PLATFORM_APPLE 1 @@ -58,33 +58,33 @@ #define IGL_PLATFORM_IOS 1 // iOS Simulator is iOS #define IGL_PLATFORM_IOS_SIMULATOR 1 #define IGL_PLATFORM_MACCATALYST 0 - #define IGL_PLATFORM_MACOS 0 + #define IGL_PLATFORM_MACOSX 0 #elif TARGET_OS_MACCATALYST #define IGL_PLATFORM_IOS 0 #define IGL_PLATFORM_IOS_SIMULATOR 0 #define IGL_PLATFORM_MACCATALYST 1 - #define IGL_PLATFORM_MACOS 0 + #define IGL_PLATFORM_MACOSX 0 #elif TARGET_OS_IPHONE #define IGL_PLATFORM_IOS 1 #define IGL_PLATFORM_IOS_SIMULATOR 0 #define IGL_PLATFORM_MACCATALYST 0 - #define IGL_PLATFORM_MACOS 0 + #define IGL_PLATFORM_MACOSX 0 #elif TARGET_OS_OSX #define IGL_PLATFORM_IOS 0 #define IGL_PLATFORM_IOS_SIMULATOR 0 #define IGL_PLATFORM_MACCATALYST 0 - #define IGL_PLATFORM_MACOS 1 + #define IGL_PLATFORM_MACOSX 1 #else #error "Unknown Apple target" #endif // Android #elif defined(__ANDROID__) - #define IGL_PLATFORM_WIN 0 + #define IGL_PLATFORM_WINDOWS 0 #define IGL_PLATFORM_APPLE 0 #define IGL_PLATFORM_IOS 0 #define IGL_PLATFORM_IOS_SIMULATOR 0 #define IGL_PLATFORM_MACCATALYST 0 - #define IGL_PLATFORM_MACOS 0 + #define IGL_PLATFORM_MACOSX 0 #define IGL_PLATFORM_ANDROID 1 #define IGL_PLATFORM_LINUX 0 #define IGL_PLATFORM_EMSCRIPTEN 0 @@ -95,33 +95,33 @@ // Linux #elif defined(__linux__) - #define IGL_PLATFORM_WIN 0 + #define IGL_PLATFORM_WINDOWS 0 #define IGL_PLATFORM_APPLE 0 #define IGL_PLATFORM_IOS 0 #define IGL_PLATFORM_IOS_SIMULATOR 0 #define IGL_PLATFORM_MACCATALYST 0 - #define IGL_PLATFORM_MACOS 0 + #define IGL_PLATFORM_MACOSX 0 #define IGL_PLATFORM_ANDROID 0 #define IGL_PLATFORM_LINUX 1 #define IGL_PLATFORM_EMSCRIPTEN 0 #elif defined(__EMSCRIPTEN__) - #define IGL_PLATFORM_WIN 0 + #define IGL_PLATFORM_WINDOWS 0 #define IGL_PLATFORM_APPLE 0 #define IGL_PLATFORM_IOS 0 #define IGL_PLATFORM_IOS_SIMULATOR 0 #define IGL_PLATFORM_MACCATALYST 0 - #define IGL_PLATFORM_MACOS 0 + #define IGL_PLATFORM_MACOSX 0 #define IGL_PLATFORM_ANDROID 0 #define IGL_PLATFORM_LINUX 0 #define IGL_PLATFORM_EMSCRIPTEN 1 // Rest #else - #define IGL_PLATFORM_WIN 0 + #define IGL_PLATFORM_WINDOWS 0 #define IGL_PLATFORM_APPLE 0 #define IGL_PLATFORM_IOS 0 #define IGL_PLATFORM_IOS_SIMULATOR 0 #define IGL_PLATFORM_MACCATALYST 0 - #define IGL_PLATFORM_MACOS 0 + #define IGL_PLATFORM_MACOSX 0 #define IGL_PLATFORM_ANDROID 0 #define IGL_PLATFORM_LINUX 0 #define IGL_PLATFORM_EMSCRIPTEN 0 @@ -355,7 +355,7 @@ ///-------------------------------------- /// MARK: - Newline -#if IGL_PLATFORM_WIN +#if IGL_PLATFORM_WINDOWS #define IGL_NEWLINE "\r\n" #else #define IGL_NEWLINE "\n" diff --git a/src/igl/NameHandle.cpp b/src/igl/NameHandle.cpp index 1022118ef8..5bd73ac0f6 100644 --- a/src/igl/NameHandle.cpp +++ b/src/igl/NameHandle.cpp @@ -65,7 +65,7 @@ bool detectCrc32() { return hwcaps & HWCAP_CRC32 ? true : false; } } // namespace -#elif IGL_PLATFORM_APPLE || IGL_PLATFORM_IOS || IGL_PLATFORM_MACOS +#elif IGL_PLATFORM_APPLE || IGL_PLATFORM_IOS || IGL_PLATFORM_MACOSX namespace { bool detectCrc32() { // All iphones6+ are support it diff --git a/src/igl/metal/Buffer.mm b/src/igl/metal/Buffer.mm index f6e7bad6d8..11a1cae272 100644 --- a/src/igl/metal/Buffer.mm +++ b/src/igl/metal/Buffer.mm @@ -33,7 +33,7 @@ checked_memcpy_offset(contents, length, range.offset, data, range.size); } -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX if ((resourceOptions & MTLResourceStorageModeMask) == MTLResourceStorageModeManaged) { [buffer didModifyRange:NSMakeRange(range.offset, range.size)]; } @@ -123,11 +123,11 @@ } ResourceStorage Buffer::storage() const noexcept { -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX if ((resourceOptions_ & MTLResourceStorageModeMask) == MTLResourceStorageModeManaged) { return ResourceStorage::Managed; } -#endif // IGL_PLATFORM_MACOS +#endif // IGL_PLATFORM_MACOSX if ((resourceOptions_ & MTLResourceStorageModeMask) == MTLResourceStorageModePrivate) { return ResourceStorage::Private; } diff --git a/src/igl/metal/Device.mm b/src/igl/metal/Device.mm index e37820155c..9fe7af290e 100644 --- a/src/igl/metal/Device.mm +++ b/src/igl/metal/Device.mm @@ -603,7 +603,7 @@ version.majorVersion = 1; version.minorVersion = 1; } -#elif IGL_PLATFORM_MACOS || IGL_PLATFORM_MACCATALYST +#elif IGL_PLATFORM_MACOSX || IGL_PLATFORM_MACCATALYST if (@available(macOS 12.0, *)) { version.majorVersion = 2; version.minorVersion = 4; @@ -659,7 +659,7 @@ return MTLStorageModePrivate; case ResourceStorage::Shared: return MTLStorageModeShared; -#if IGL_PLATFORM_MACOS || IGL_PLATFORM_MACCATALYST +#if IGL_PLATFORM_MACOSX || IGL_PLATFORM_MACCATALYST case ResourceStorage::Managed: default: return MTLStorageModeManaged; @@ -678,7 +678,7 @@ return MTLResourceStorageModePrivate; case ResourceStorage::Shared: return MTLResourceStorageModeShared; -#if IGL_PLATFORM_MACOS || IGL_PLATFORM_MACCATALYST +#if IGL_PLATFORM_MACOSX || IGL_PLATFORM_MACCATALYST case ResourceStorage::Managed: default: return MTLResourceStorageModeManaged; diff --git a/src/igl/metal/DeviceFeatureSet.mm b/src/igl/metal/DeviceFeatureSet.mm index 28a67649e9..f9bcc63e78 100644 --- a/src/igl/metal/DeviceFeatureSet.mm +++ b/src/igl/metal/DeviceFeatureSet.mm @@ -62,7 +62,7 @@ static size_t getGPUFamily(id device) { IGL_DEBUG_ABORT("IGL iOS deployment target is 9.0+"); return 0; } -#elif IGL_PLATFORM_MACOS +#elif IGL_PLATFORM_MACOSX if (@available(macOS 10.14, *)) { featureSets.emplace_back(MTLFeatureSet_macOS_GPUFamily2_v1, 2); featureSets.emplace_back(MTLFeatureSet_macOS_GPUFamily1_v4, 1); @@ -252,7 +252,7 @@ static size_t getGPUFamily(id device) { case DeviceFeatureLimits::BufferAlignment: { // Since IGL currently doesn't distinguish how buffers are being used, for consistency reasons, // we currently assume BufferAlignment means Constant Buffer offset alignment -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX result = 32; #elif IGL_PLATFORM_IOS_SIMULATOR result = 256; @@ -304,19 +304,19 @@ static size_t getGPUFamily(id device) { case TextureFormat::R_UNorm16: return all; case TextureFormat::B5G5R5A1_UNorm: -#if IGL_PLATFORM_MACOS || IGL_PLATFORM_MACCATALYST || IGL_PLATFORM_IOS_SIMULATOR +#if IGL_PLATFORM_MACOSX || IGL_PLATFORM_MACCATALYST || IGL_PLATFORM_IOS_SIMULATOR return unsupported; #else return sampled | attachment | sampledAttachment; #endif case TextureFormat::B5G6R5_UNorm: -#if IGL_PLATFORM_MACOS || IGL_PLATFORM_MACCATALYST || IGL_PLATFORM_IOS_SIMULATOR +#if IGL_PLATFORM_MACOSX || IGL_PLATFORM_MACCATALYST || IGL_PLATFORM_IOS_SIMULATOR return unsupported; #else return sampled | attachment | sampledAttachment; #endif case TextureFormat::ABGR_UNorm4: -#if IGL_PLATFORM_MACOS || IGL_PLATFORM_MACCATALYST || IGL_PLATFORM_IOS_SIMULATOR +#if IGL_PLATFORM_MACOSX || IGL_PLATFORM_MACCATALYST || IGL_PLATFORM_IOS_SIMULATOR return unsupported; #else return sampled | attachment | sampledAttachment; @@ -426,7 +426,7 @@ static size_t getGPUFamily(id device) { case TextureFormat::RGBA_BC7_UNORM_4x4: case TextureFormat::RGBA_BC7_SRGB_4x4: -#if IGL_PLATFORM_MACOS || IGL_PLATFORM_MACCATALYST +#if IGL_PLATFORM_MACOSX || IGL_PLATFORM_MACCATALYST return sampled; #else return unsupported; diff --git a/src/igl/metal/HWDevice.mm b/src/igl/metal/HWDevice.mm index 62d4ace409..7d872e98b6 100644 --- a/src/igl/metal/HWDevice.mm +++ b/src/igl/metal/HWDevice.mm @@ -13,7 +13,7 @@ #include #include -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX #include #else #include @@ -25,7 +25,7 @@ namespace { -#if IGL_PLATFORM_MACOS || IGL_PLATFORM_MACCATALYST +#if IGL_PLATFORM_MACOSX || IGL_PLATFORM_MACCATALYST bool isRemovable(id device) { if (@available(macOS 10.13, macCatalyst 13.0, *)) { return device.removable; @@ -153,7 +153,7 @@ const HWDeviceDesc deviceDesc(deviceNative, return nullptr; } -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX auto iglDevice = std::make_unique(device); #else auto iglDevice = std::make_unique(device); diff --git a/src/igl/metal/Texture.mm b/src/igl/metal/Texture.mm index 6729f10d50..561ecc8051 100644 --- a/src/igl/metal/Texture.mm +++ b/src/igl/metal/Texture.mm @@ -321,19 +321,19 @@ void bgrToRgb(unsigned char* dstImg, size_t width, size_t height, size_t bytesPe return MTLPixelFormatA8Unorm; // 16 bpp case TextureFormat::B5G5R5A1_UNorm: -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX return MTLPixelFormatInvalid; #else return MTLPixelFormatBGR5A1Unorm; #endif case TextureFormat::B5G6R5_UNorm: -#if IGL_PLATFORM_MACOS || IGL_PLATFORM_IOS_SIMULATOR +#if IGL_PLATFORM_MACOSX || IGL_PLATFORM_IOS_SIMULATOR return MTLPixelFormatInvalid; #else return MTLPixelFormatB5G6R5Unorm; #endif case TextureFormat::ABGR_UNorm4: -#if IGL_PLATFORM_MACOS || IGL_PLATFORM_IOS_SIMULATOR +#if IGL_PLATFORM_MACOSX || IGL_PLATFORM_IOS_SIMULATOR return MTLPixelFormatInvalid; #else return MTLPixelFormatABGR4Unorm; @@ -408,224 +408,224 @@ void bgrToRgb(unsigned char* dstImg, size_t width, size_t height, size_t bytesPe // Compressed case TextureFormat::RGBA_ASTC_4x4: -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX return MTLPixelFormatInvalid; #else return MTLPixelFormatASTC_4x4_LDR; #endif case TextureFormat::SRGB8_A8_ASTC_4x4: -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX return MTLPixelFormatInvalid; #else return MTLPixelFormatASTC_4x4_sRGB; #endif case TextureFormat::RGBA_ASTC_5x4: -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX return MTLPixelFormatInvalid; #else return MTLPixelFormatASTC_5x4_LDR; #endif case TextureFormat::SRGB8_A8_ASTC_5x4: -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX return MTLPixelFormatInvalid; #else return MTLPixelFormatASTC_5x4_sRGB; #endif case TextureFormat::RGBA_ASTC_5x5: -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX return MTLPixelFormatInvalid; #else return MTLPixelFormatASTC_5x5_LDR; #endif case TextureFormat::SRGB8_A8_ASTC_5x5: -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX return MTLPixelFormatInvalid; #else return MTLPixelFormatASTC_5x5_sRGB; #endif case TextureFormat::RGBA_ASTC_6x5: -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX return MTLPixelFormatInvalid; #else return MTLPixelFormatASTC_6x5_LDR; #endif case TextureFormat::SRGB8_A8_ASTC_6x5: -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX return MTLPixelFormatInvalid; #else return MTLPixelFormatASTC_6x5_sRGB; #endif case TextureFormat::RGBA_ASTC_6x6: -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX return MTLPixelFormatInvalid; #else return MTLPixelFormatASTC_6x6_LDR; #endif case TextureFormat::SRGB8_A8_ASTC_6x6: -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX return MTLPixelFormatInvalid; #else return MTLPixelFormatASTC_6x6_sRGB; #endif case TextureFormat::RGBA_ASTC_8x5: -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX return MTLPixelFormatInvalid; #else return MTLPixelFormatASTC_8x5_LDR; #endif case TextureFormat::SRGB8_A8_ASTC_8x5: -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX return MTLPixelFormatInvalid; #else return MTLPixelFormatASTC_8x5_sRGB; #endif case TextureFormat::RGBA_ASTC_8x6: -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX return MTLPixelFormatInvalid; #else return MTLPixelFormatASTC_8x6_LDR; #endif case TextureFormat::SRGB8_A8_ASTC_8x6: -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX return MTLPixelFormatInvalid; #else return MTLPixelFormatASTC_8x6_sRGB; #endif case TextureFormat::RGBA_ASTC_8x8: -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX return MTLPixelFormatInvalid; #else return MTLPixelFormatASTC_8x8_LDR; #endif case TextureFormat::SRGB8_A8_ASTC_8x8: -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX return MTLPixelFormatInvalid; #else return MTLPixelFormatASTC_8x8_sRGB; #endif case TextureFormat::RGBA_ASTC_10x5: -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX return MTLPixelFormatInvalid; #else return MTLPixelFormatASTC_10x5_LDR; #endif case TextureFormat::SRGB8_A8_ASTC_10x5: -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX return MTLPixelFormatInvalid; #else return MTLPixelFormatASTC_10x5_sRGB; #endif case TextureFormat::RGBA_ASTC_10x6: -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX return MTLPixelFormatInvalid; #else return MTLPixelFormatASTC_10x6_LDR; #endif case TextureFormat::SRGB8_A8_ASTC_10x6: -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX return MTLPixelFormatInvalid; #else return MTLPixelFormatASTC_10x6_sRGB; #endif case TextureFormat::RGBA_ASTC_10x8: -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX return MTLPixelFormatInvalid; #else return MTLPixelFormatASTC_10x8_LDR; #endif case TextureFormat::SRGB8_A8_ASTC_10x8: -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX return MTLPixelFormatInvalid; #else return MTLPixelFormatASTC_10x8_sRGB; #endif case TextureFormat::RGBA_ASTC_10x10: -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX return MTLPixelFormatInvalid; #else return MTLPixelFormatASTC_10x10_LDR; #endif case TextureFormat::SRGB8_A8_ASTC_10x10: -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX return MTLPixelFormatInvalid; #else return MTLPixelFormatASTC_10x10_sRGB; #endif case TextureFormat::RGBA_ASTC_12x10: -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX return MTLPixelFormatInvalid; #else return MTLPixelFormatASTC_12x10_LDR; #endif case TextureFormat::SRGB8_A8_ASTC_12x10: -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX return MTLPixelFormatInvalid; #else return MTLPixelFormatASTC_12x10_sRGB; #endif case TextureFormat::RGBA_ASTC_12x12: -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX return MTLPixelFormatInvalid; #else return MTLPixelFormatASTC_12x12_LDR; #endif case TextureFormat::SRGB8_A8_ASTC_12x12: -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX return MTLPixelFormatInvalid; #else return MTLPixelFormatASTC_12x12_sRGB; #endif case TextureFormat::RGBA_PVRTC_2BPPV1: -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX return MTLPixelFormatInvalid; #else return MTLPixelFormatPVRTC_RGBA_2BPP; #endif case TextureFormat::RGB_PVRTC_2BPPV1: -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX return MTLPixelFormatInvalid; #else return MTLPixelFormatPVRTC_RGB_2BPP; #endif case TextureFormat::RGBA_PVRTC_4BPPV1: -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX return MTLPixelFormatInvalid; #else return MTLPixelFormatPVRTC_RGBA_4BPP; #endif case TextureFormat::RGB_PVRTC_4BPPV1: -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX return MTLPixelFormatInvalid; #else return MTLPixelFormatPVRTC_RGB_4BPP; @@ -633,56 +633,56 @@ void bgrToRgb(unsigned char* dstImg, size_t width, size_t height, size_t bytesPe case TextureFormat::RGB8_ETC1: case TextureFormat::RGB8_ETC2: -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX return MTLPixelFormatInvalid; #else return MTLPixelFormatETC2_RGB8; #endif case TextureFormat::RGBA8_EAC_ETC2: -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX return MTLPixelFormatInvalid; #else return MTLPixelFormatEAC_RGBA8; #endif case TextureFormat::SRGB8_ETC2: -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX return MTLPixelFormatInvalid; #else return MTLPixelFormatETC2_RGB8_sRGB; #endif case TextureFormat::SRGB8_A8_EAC_ETC2: -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX return MTLPixelFormatInvalid; #else return MTLPixelFormatEAC_RGBA8_sRGB; #endif case TextureFormat::RG_EAC_UNorm: -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX return MTLPixelFormatInvalid; #else return MTLPixelFormatEAC_RG11Unorm; #endif case TextureFormat::RG_EAC_SNorm: -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX return MTLPixelFormatInvalid; #else return MTLPixelFormatEAC_RG11Snorm; #endif case TextureFormat::R_EAC_UNorm: -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX return MTLPixelFormatInvalid; #else return MTLPixelFormatEAC_R11Unorm; #endif case TextureFormat::R_EAC_SNorm: -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX return MTLPixelFormatInvalid; #else return MTLPixelFormatEAC_R11Snorm; @@ -691,13 +691,13 @@ void bgrToRgb(unsigned char* dstImg, size_t width, size_t height, size_t bytesPe // MTLPixelFormatBC7_RGBAUnorm supported only on MacOS and Catalyst // https://developer.apple.com/documentation/metal/mtlpixelformat/mtlpixelformatbc7_rgbaunorm case TextureFormat::RGBA_BC7_UNORM_4x4: -#if IGL_PLATFORM_MACOS || IGL_PLATFORM_MACCATALYST +#if IGL_PLATFORM_MACOSX || IGL_PLATFORM_MACCATALYST return MTLPixelFormatBC7_RGBAUnorm; #else return MTLPixelFormatInvalid; #endif case TextureFormat::RGBA_BC7_SRGB_4x4: -#if IGL_PLATFORM_MACOS || IGL_PLATFORM_MACCATALYST +#if IGL_PLATFORM_MACOSX || IGL_PLATFORM_MACCATALYST return MTLPixelFormatBC7_RGBAUnorm_sRGB; #else return MTLPixelFormatInvalid; @@ -735,7 +735,7 @@ void bgrToRgb(unsigned char* dstImg, size_t width, size_t height, size_t bytesPe return TextureFormat::A_UNorm8; // 16 bpp -#if !IGL_PLATFORM_MACOS // No support for these on macOS +#if !IGL_PLATFORM_MACOSX // No support for these on macOS case MTLPixelFormatBGR5A1Unorm: return TextureFormat::B5G5R5A1_UNorm; case MTLPixelFormatB5G6R5Unorm: @@ -793,7 +793,7 @@ void bgrToRgb(unsigned char* dstImg, size_t width, size_t height, size_t bytesPe return TextureFormat::RGBA_F32; // Compressed -#if !IGL_PLATFORM_MACOS +#if !IGL_PLATFORM_MACOSX case MTLPixelFormatASTC_4x4_LDR: return TextureFormat::RGBA_ASTC_4x4; case MTLPixelFormatASTC_4x4_sRGB: @@ -863,7 +863,7 @@ void bgrToRgb(unsigned char* dstImg, size_t width, size_t height, size_t bytesPe case MTLPixelFormatEAC_RGBA8: return TextureFormat::RGBA8_EAC_ETC2; #endif -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX case MTLPixelFormatBC7_RGBAUnorm: return TextureFormat::RGBA_BC7_UNORM_4x4; case MTLPixelFormatBC7_RGBAUnorm_sRGB: diff --git a/src/igl/opengl/GLIncludes.h b/src/igl/opengl/GLIncludes.h index 16b7be7b2c..3a4f401c3e 100644 --- a/src/igl/opengl/GLIncludes.h +++ b/src/igl/opengl/GLIncludes.h @@ -28,11 +28,11 @@ #include "OpenGLES/ES3/glext.h" #include "OpenGLES/ES2/glext.h" using GLdouble = double; -#elif IGL_PLATFORM_MACOS +#elif IGL_PLATFORM_MACOSX #include #include #include -#elif IGL_PLATFORM_WIN +#elif IGL_PLATFORM_WINDOWS #define GL_GLEXT_PROTOTYPES #if IGL_ANGLE #include diff --git a/src/igl/opengl/HWDevice.h b/src/igl/opengl/HWDevice.h index 324ae6fd3e..04218c8af9 100644 --- a/src/igl/opengl/HWDevice.h +++ b/src/igl/opengl/HWDevice.h @@ -14,7 +14,7 @@ #if IGL_PLATFORM_ANDROID || IGL_PLATFORM_LINUX || IGL_PLATFORM_EMSCRIPTEN #include -#elif IGL_PLATFORM_IOS || IGL_PLATFORM_MACOS +#elif IGL_PLATFORM_IOS || IGL_PLATFORM_MACOSX #define EGLNativeWindowType void* #elif IGL_ANGLE || defined(IGL_CMAKE_BUILD) #include diff --git a/src/igl/opengl/Macros.h b/src/igl/opengl/Macros.h index d2e7a0d207..38d9b1f58e 100644 --- a/src/igl/opengl/Macros.h +++ b/src/igl/opengl/Macros.h @@ -27,7 +27,7 @@ #define IGL_EGL 0 #endif -#if IGL_PLATFORM_WIN && !IGL_OPENGL_ES +#if IGL_PLATFORM_WINDOWS && !IGL_OPENGL_ES #define IGL_WGL 1 #else #define IGL_WGL 0 diff --git a/src/igl/opengl/wgl/PlatformDevice.h b/src/igl/opengl/wgl/PlatformDevice.h index 61c9f760c7..5be7e5fa08 100644 --- a/src/igl/opengl/wgl/PlatformDevice.h +++ b/src/igl/opengl/wgl/PlatformDevice.h @@ -10,7 +10,7 @@ #include #include #include -#if IGL_PLATFORM_WIN +#if IGL_PLATFORM_WINDOWS #include #endif diff --git a/src/igl/tests/Multiview.cpp b/src/igl/tests/Multiview.cpp index e9f99029e9..23d340c517 100644 --- a/src/igl/tests/Multiview.cpp +++ b/src/igl/tests/Multiview.cpp @@ -78,7 +78,7 @@ class MultiviewTest : public ::testing::Test { GTEST_SKIP() << "Multiview is unsupported for this platform."; return; } -#if IGL_PLATFORM_WIN || (IGL_PLATFORM_LINUX && !IGL_PLATFORM_LINUX_USE_EGL) +#if IGL_PLATFORM_WINDOWS || (IGL_PLATFORM_LINUX && !IGL_PLATFORM_LINUX_USE_EGL) if (iglDev_->getBackendType() == igl::BackendType::OpenGL) { GTEST_SKIP() << "Multiview is unsupported for this platform."; return; @@ -95,11 +95,11 @@ class MultiviewTest : public ::testing::Test { auto depthFormat = TextureFormat::S8_UInt_Z32_UNorm; -#ifndef IGL_PLATFORM_MACOS +#ifndef IGL_PLATFORM_MACOSX if (backend_ == util::BACKEND_VUL) { depthFormat = TextureFormat::S8_UInt_Z24_UNorm; } -#endif // IGL_PLATFORM_MACOS +#endif // IGL_PLATFORM_MACOSX TextureDesc depthTexDesc = TextureDesc::new2DArray(depthFormat, kOffScreenWidth, diff --git a/src/igl/tests/TextureFloat.cpp b/src/igl/tests/TextureFloat.cpp index ff46d24c72..52a10f8b71 100644 --- a/src/igl/tests/TextureFloat.cpp +++ b/src/igl/tests/TextureFloat.cpp @@ -192,7 +192,7 @@ class TextureFloatTest : public ::testing::Test { } // Those tests just crash on macos but run fine on android opengles -#if IGL_PLATFORM_MACOS || IGL_PLATFORM_IOS_SIMULATOR +#if IGL_PLATFORM_MACOSX || IGL_PLATFORM_IOS_SIMULATOR if (iglDev_->getBackendType() == BackendType::OpenGL || kUsesOpenGLES) { GTEST_SKIP() << "Skip due to lack of support for OpenGL on Macos"; } @@ -444,7 +444,7 @@ TEST_F(TextureFloatTest, Passthrough_SampleRGBA32) { } TEST_F(TextureFloatTest, Passthrough_SampleRGB32) { -#if IGL_PLATFORM_WIN && !IGL_ANGLE +#if IGL_PLATFORM_WINDOWS && !IGL_ANGLE GTEST_SKIP() << "Skipping due to known issue on Windows without angle"; #endif if (iglDev_->getBackendType() == BackendType::Vulkan || diff --git a/src/igl/tests/TextureHalfFloat.cpp b/src/igl/tests/TextureHalfFloat.cpp index 7e6cfbd1f4..4fb226a35c 100644 --- a/src/igl/tests/TextureHalfFloat.cpp +++ b/src/igl/tests/TextureHalfFloat.cpp @@ -450,13 +450,13 @@ TEST_F(TextureHalfFloatTest, Passthrough_SampleRGBA16) { } TEST_F(TextureHalfFloatTest, Passthrough_SampleRGB16) { -#if IGL_PLATFORM_WIN && !IGL_ANGLE +#if IGL_PLATFORM_WINDOWS && !IGL_ANGLE GTEST_SKIP() << "Skipping due to known issue on Windows without angle"; #endif if (iglDev_->getBackendType() == BackendType::Vulkan || iglDev_->getBackendType() == BackendType::Metal || -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX iglDev_->getBackendType() == BackendType::OpenGL || #endif kUsesOpenGLES) { @@ -466,7 +466,7 @@ TEST_F(TextureHalfFloatTest, Passthrough_SampleRGB16) { } TEST_F(TextureHalfFloatTest, Passthrough_SampleRG16) { -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX if (iglDev_->getBackendType() == BackendType::OpenGL) { GTEST_SKIP() << "Skip due to lack of support for RG on mac OpenGL"; } @@ -475,7 +475,7 @@ TEST_F(TextureHalfFloatTest, Passthrough_SampleRG16) { } TEST_F(TextureHalfFloatTest, Passthrough_SampleR16) { -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX if (iglDev_->getBackendType() == BackendType::OpenGL) { GTEST_SKIP() << "Skip due to lack of support for RG on mac OpenGL"; } diff --git a/src/igl/tests/metal/Texture.mm b/src/igl/tests/metal/Texture.mm index 8fcdc4991c..fa0b7374f1 100644 --- a/src/igl/tests/metal/Texture.mm +++ b/src/igl/tests/metal/Texture.mm @@ -229,10 +229,10 @@ void TearDown() override {} TextureFormat::R_UNorm8, TextureFormat::R_F16, TextureFormat::R_UInt16, -#if !IGL_PLATFORM_MACOS +#if !IGL_PLATFORM_MACOSX TextureFormat::B5G5R5A1_UNorm, #endif -#if !(IGL_PLATFORM_MACOS || IGL_PLATFORM_IOS_SIMULATOR) +#if !(IGL_PLATFORM_MACOSX || IGL_PLATFORM_IOS_SIMULATOR) // https://developer.apple.com/documentation/metal/developing_metal_apps_that_run_in_simulator TextureFormat::B5G6R5_UNorm, TextureFormat::ABGR_UNorm4, @@ -252,7 +252,7 @@ void TearDown() override {} TextureFormat::RGBA_F16, TextureFormat::RGBA_UInt32, TextureFormat::RGBA_F32, -#if !IGL_PLATFORM_MACOS +#if !IGL_PLATFORM_MACOSX TextureFormat::RGBA_ASTC_4x4, TextureFormat::SRGB8_A8_ASTC_4x4, TextureFormat::RGBA_ASTC_5x4, @@ -305,10 +305,10 @@ void TearDown() override {} const std::vector invalidTextureFormats = { TextureFormat::Invalid, TextureFormat::L_UNorm8, -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX TextureFormat::B5G5R5A1_UNorm, #endif -#if IGL_PLATFORM_MACOS || IGL_PLATFORM_IOS_SIMULATOR +#if IGL_PLATFORM_MACOSX || IGL_PLATFORM_IOS_SIMULATOR TextureFormat::B5G6R5_UNorm, TextureFormat::ABGR_UNorm4, #endif @@ -318,7 +318,7 @@ void TearDown() override {} TextureFormat::BGRA_UNorm8_Rev, TextureFormat::RGB_F16, TextureFormat::RGB_F32, -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX TextureFormat::RGBA_ASTC_4x4, TextureFormat::SRGB8_A8_ASTC_4x4, TextureFormat::RGBA_ASTC_5x4, @@ -357,7 +357,7 @@ void TearDown() override {} #endif TextureFormat::RGB8_Punchthrough_A1_ETC2, TextureFormat::SRGB8_Punchthrough_A1_ETC2, -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX TextureFormat::RGBA8_EAC_ETC2, TextureFormat::SRGB8_A8_EAC_ETC2, TextureFormat::RG_EAC_UNorm, diff --git a/src/igl/tests/ogl/Context.cpp b/src/igl/tests/ogl/Context.cpp index 9b0fa69619..2e62b682c7 100644 --- a/src/igl/tests/ogl/Context.cpp +++ b/src/igl/tests/ogl/Context.cpp @@ -313,7 +313,7 @@ TEST_F(ContextOGLTest, CheckForErrorsInvalidFrameBufferOperation) { /// Verify that an object is visible across contexts in the same sharegroup TEST_F(ContextOGLTest, BasicSharedContexts) { -#if IGL_PLATFORM_WIN && !IGL_ANGLE +#if IGL_PLATFORM_WINDOWS && !IGL_ANGLE GTEST_SKIP() << "Context sharing not implemented in opengl::wgl"; #endif // Setup is three contexts, (1) and (2) part of the same sharegroup and (3) not. diff --git a/src/igl/tests/ogl/HWDevice.cpp b/src/igl/tests/ogl/HWDevice.cpp index 4f2f461658..3d267e647e 100644 --- a/src/igl/tests/ogl/HWDevice.cpp +++ b/src/igl/tests/ogl/HWDevice.cpp @@ -13,13 +13,13 @@ #if IGL_PLATFORM_IOS #include -#elif IGL_PLATFORM_MACOS +#elif IGL_PLATFORM_MACOSX #include #elif IGL_PLATFORM_ANDROID || IGL_PLATFORM_LINUX_USE_EGL #include #elif IGL_PLATFORM_LINUX #include -#elif IGL_PLATFORM_WIN +#elif IGL_PLATFORM_WINDOWS #if defined(FORCE_USE_ANGLE) #include #else @@ -51,13 +51,13 @@ class HWDeviceOGLTest : public ::testing::Test { std::shared_ptr createHWTestDevice() { #if IGL_PLATFORM_IOS return std::make_shared(); -#elif IGL_PLATFORM_MACOS +#elif IGL_PLATFORM_MACOSX return std::make_shared(); #elif IGL_PLATFORM_ANDROID || IGL_PLATFORM_LINUX_USE_EGL return std::make_shared(); #elif IGL_PLATFORM_LINUX return std::make_shared(); -#elif IGL_PLATFORM_WIN +#elif IGL_PLATFORM_WINDOWS #if defined(FORCE_USE_ANGLE) return std::make_shared(); #else diff --git a/src/igl/tests/ogl/PlatformDevice.cpp b/src/igl/tests/ogl/PlatformDevice.cpp index ae0f3f524f..152a0ebc85 100644 --- a/src/igl/tests/ogl/PlatformDevice.cpp +++ b/src/igl/tests/ogl/PlatformDevice.cpp @@ -13,13 +13,13 @@ #include #if IGL_PLATFORM_IOS #include -#elif IGL_PLATFORM_MACOS +#elif IGL_PLATFORM_MACOSX #include #elif IGL_PLATFORM_ANDROID || IGL_PLATFORM_LINUX_USE_EGL #include #elif IGL_PLATFORM_LINUX #include -#elif IGL_PLATFORM_WIN +#elif IGL_PLATFORM_WINDOWS #if defined(FORCE_USE_ANGLE) #include #else @@ -33,13 +33,13 @@ #if IGL_PLATFORM_IOS #define PLATFORM_DEVICE opengl::ios::PlatformDevice -#elif IGL_PLATFORM_MACOS +#elif IGL_PLATFORM_MACOSX #define PLATFORM_DEVICE opengl::macos::PlatformDevice #elif IGL_PLATFORM_ANDROID || IGL_PLATFORM_LINUX_USE_EGL #define PLATFORM_DEVICE opengl::egl::PlatformDevice #elif IGL_PLATFORM_LINUX #define PLATFORM_DEVICE opengl::glx::PlatformDevice -#elif IGL_PLATFORM_WIN +#elif IGL_PLATFORM_WINDOWS #if defined(FORCE_USE_ANGLE) #define PLATFORM_DEVICE opengl::egl::PlatformDevice #else diff --git a/src/igl/tests/util/Common.h b/src/igl/tests/util/Common.h index a66db6b106..9fd6dfb69a 100644 --- a/src/igl/tests/util/Common.h +++ b/src/igl/tests/util/Common.h @@ -13,7 +13,7 @@ #include #endif // IGL_BACKEND_OPENGL -#if IGL_PLATFORM_IOS || IGL_PLATFORM_MACOS +#if IGL_PLATFORM_IOS || IGL_PLATFORM_MACOSX #include "simd/simd.h" #else #include "simdstub.h" diff --git a/src/igl/tests/util/TextureValidationHelpers.h b/src/igl/tests/util/TextureValidationHelpers.h index 33df03a386..6ea41df124 100644 --- a/src/igl/tests/util/TextureValidationHelpers.h +++ b/src/igl/tests/util/TextureValidationHelpers.h @@ -12,7 +12,7 @@ #include #include -#if IGL_PLATFORM_IOS || IGL_PLATFORM_MACOS +#if IGL_PLATFORM_IOS || IGL_PLATFORM_MACOSX #include "simd/simd.h" #else #include "simdstub.h" diff --git a/src/igl/tests/util/device/TestDevice.cpp b/src/igl/tests/util/device/TestDevice.cpp index b9275f08b1..3c23dcf574 100644 --- a/src/igl/tests/util/device/TestDevice.cpp +++ b/src/igl/tests/util/device/TestDevice.cpp @@ -10,7 +10,7 @@ #include #include -#if (IGL_PLATFORM_IOS || IGL_PLATFORM_MACOS || IGL_PLATFORM_MACCATALYST) && IGL_BACKEND_METAL +#if (IGL_PLATFORM_IOS || IGL_PLATFORM_MACOSX || IGL_PLATFORM_MACCATALYST) && IGL_BACKEND_METAL #define IGL_METAL_SUPPORTED 1 #else #define IGL_METAL_SUPPORTED 0 @@ -22,7 +22,7 @@ #define IGL_OPENGL_SUPPORTED 0 #endif -#if (IGL_PLATFORM_WIN || IGL_PLATFORM_ANDROID || IGL_PLATFORM_MACOS || IGL_PLATFORM_LINUX) && \ +#if (IGL_PLATFORM_WINDOWS || IGL_PLATFORM_ANDROID || IGL_PLATFORM_MACOSX || IGL_PLATFORM_LINUX) && \ IGL_BACKEND_VULKAN && !defined(IGL_UNIT_TESTS_NO_VULKAN) #define IGL_VULKAN_SUPPORTED 1 #else diff --git a/src/igl/tests/util/device/opengl/TestDevice.cpp b/src/igl/tests/util/device/opengl/TestDevice.cpp index d1e835cd49..4883685c44 100644 --- a/src/igl/tests/util/device/opengl/TestDevice.cpp +++ b/src/igl/tests/util/device/opengl/TestDevice.cpp @@ -12,13 +12,13 @@ #if IGL_PLATFORM_IOS #include -#elif IGL_PLATFORM_MACOS +#elif IGL_PLATFORM_MACOSX #include #elif IGL_PLATFORM_ANDROID || IGL_PLATFORM_LINUX_USE_EGL #include #elif IGL_PLATFORM_LINUX #include -#elif IGL_PLATFORM_WIN +#elif IGL_PLATFORM_WINDOWS #if defined(FORCE_USE_ANGLE) #include #else @@ -69,13 +69,13 @@ std::shared_ptr<::igl::IDevice> createTestDevice(const std::string& backendApi) #if IGL_PLATFORM_IOS iglDev = createDevice<::igl::opengl::ios::HWDevice>(renderingAPI); -#elif IGL_PLATFORM_MACOS +#elif IGL_PLATFORM_MACOSX iglDev = createDevice<::igl::opengl::macos::HWDevice>(renderingAPI); #elif IGL_PLATFORM_ANDROID || IGL_PLATFORM_LINUX_USE_EGL iglDev = createOffscreenDevice<::igl::opengl::egl::HWDevice>(renderingAPI); #elif IGL_PLATFORM_LINUX iglDev = createOffscreenDevice<::igl::opengl::glx::HWDevice>(renderingAPI); -#elif IGL_PLATFORM_WIN +#elif IGL_PLATFORM_WINDOWS #if defined(FORCE_USE_ANGLE) iglDev = createOffscreenDevice<::igl::opengl::egl::HWDevice>(renderingAPI); #else diff --git a/src/igl/tests/util/device/vulkan/TestDevice.cpp b/src/igl/tests/util/device/vulkan/TestDevice.cpp index 003bfaa12d..8cb848fbe7 100644 --- a/src/igl/tests/util/device/vulkan/TestDevice.cpp +++ b/src/igl/tests/util/device/vulkan/TestDevice.cpp @@ -10,14 +10,14 @@ #include #include -#if IGL_PLATFORM_WIN || IGL_PLATFORM_ANDROID || IGL_PLATFORM_MACOS || IGL_PLATFORM_IOS || \ +#if IGL_PLATFORM_WINDOWS || IGL_PLATFORM_ANDROID || IGL_PLATFORM_MACOSX || IGL_PLATFORM_IOS || \ IGL_PLATFORM_LINUX #include #include #include #endif -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX #include #endif @@ -35,7 +35,7 @@ igl::vulkan::VulkanContextConfig getContextConfig(bool enableValidation) { config.enableValidation = enableValidation; config.enableGPUAssistedValidation = enableValidation; -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX config.terminateOnValidationError = false; #elif IGL_DEBUG config.terminateOnValidationError = enableValidation; @@ -54,7 +54,7 @@ igl::vulkan::VulkanContextConfig getContextConfig(bool enableValidation) { } std::shared_ptr<::igl::IDevice> createTestDevice(const igl::vulkan::VulkanContextConfig& config) { -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX ::igl::vulkan::setupMoltenVKEnvironment(); #endif diff --git a/src/igl/tests/vulkan/CommonTest.cpp b/src/igl/tests/vulkan/CommonTest.cpp index 1ec0df1295..e8db2c6658 100644 --- a/src/igl/tests/vulkan/CommonTest.cpp +++ b/src/igl/tests/vulkan/CommonTest.cpp @@ -20,7 +20,7 @@ #include #endif -#if IGL_PLATFORM_WIN || IGL_PLATFORM_ANDROID || IGL_PLATFORM_LINUX +#if IGL_PLATFORM_WINDOWS || IGL_PLATFORM_ANDROID || IGL_PLATFORM_LINUX namespace igl::tests { // diff --git a/src/igl/tests/vulkan/Device.cpp b/src/igl/tests/vulkan/Device.cpp index f4d5b6fb66..41181e638a 100644 --- a/src/igl/tests/vulkan/Device.cpp +++ b/src/igl/tests/vulkan/Device.cpp @@ -10,7 +10,7 @@ #include "../util/TestDevice.h" -#if IGL_PLATFORM_WIN || IGL_PLATFORM_ANDROID || IGL_PLATFORM_MACOS || IGL_PLATFORM_LINUX +#if IGL_PLATFORM_WINDOWS || IGL_PLATFORM_ANDROID || IGL_PLATFORM_MACOSX || IGL_PLATFORM_LINUX #include #include #include @@ -109,7 +109,7 @@ TEST_F(DeviceVulkanTest, PlatformDeviceSampler) { cmdQueue->submit(*cmdBuf); } -#if IGL_PLATFORM_WIN || IGL_PLATFORM_ANDROID || IGL_PLATFORM_MACOS || IGL_PLATFORM_LINUX +#if IGL_PLATFORM_WINDOWS || IGL_PLATFORM_ANDROID || IGL_PLATFORM_MACOSX || IGL_PLATFORM_LINUX TEST_F(DeviceVulkanTest, StagingDeviceLargeBufferTest) { Result ret; @@ -232,7 +232,7 @@ GTEST_TEST(VulkanContext, BufferDeviceAddress) { std::shared_ptr iglDev = nullptr; igl::vulkan::VulkanContextConfig config; -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX config.terminateOnValidationError = false; #elif IGL_DEBUG config.enableValidation = true; @@ -314,7 +314,7 @@ GTEST_TEST(VulkanContext, DescriptorIndexing) { std::shared_ptr iglDev = nullptr; igl::vulkan::VulkanContextConfig config; -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX config.terminateOnValidationError = false; #elif IGL_DEBUG config.enableValidation = true; diff --git a/src/igl/tests/vulkan/EnhancedShaderDebuggingStoreTest.cpp b/src/igl/tests/vulkan/EnhancedShaderDebuggingStoreTest.cpp index 962631c1b2..3cb2d209dc 100644 --- a/src/igl/tests/vulkan/EnhancedShaderDebuggingStoreTest.cpp +++ b/src/igl/tests/vulkan/EnhancedShaderDebuggingStoreTest.cpp @@ -14,7 +14,7 @@ #include "../util/Common.h" #include "../util/TestDevice.h" -#if IGL_PLATFORM_WIN || IGL_PLATFORM_ANDROID || IGL_PLATFORM_MACOS || IGL_PLATFORM_LINUX +#if IGL_PLATFORM_WINDOWS || IGL_PLATFORM_ANDROID || IGL_PLATFORM_MACOSX || IGL_PLATFORM_LINUX #include #include #include diff --git a/src/igl/tests/vulkan/RenderPipelineStateTest.cpp b/src/igl/tests/vulkan/RenderPipelineStateTest.cpp index 53b9432785..3c33a35458 100644 --- a/src/igl/tests/vulkan/RenderPipelineStateTest.cpp +++ b/src/igl/tests/vulkan/RenderPipelineStateTest.cpp @@ -22,7 +22,7 @@ #include #endif -#if IGL_PLATFORM_WIN || IGL_PLATFORM_ANDROID || IGL_PLATFORM_LINUX +#if IGL_PLATFORM_WINDOWS || IGL_PLATFORM_ANDROID || IGL_PLATFORM_LINUX namespace igl::tests { // diff --git a/src/igl/tests/vulkan/VulkanImageTest.cpp b/src/igl/tests/vulkan/VulkanImageTest.cpp index fff18ac73c..c6d6da925b 100644 --- a/src/igl/tests/vulkan/VulkanImageTest.cpp +++ b/src/igl/tests/vulkan/VulkanImageTest.cpp @@ -20,7 +20,7 @@ #include #endif -#if IGL_PLATFORM_WIN || IGL_PLATFORM_ANDROID || IGL_PLATFORM_LINUX +#if IGL_PLATFORM_WINDOWS || IGL_PLATFORM_ANDROID || IGL_PLATFORM_LINUX namespace igl::tests { @@ -73,7 +73,7 @@ TEST_F(VulkanImageTest, CreateImageWithExportedMemory) { "Image: vulkan export memory"); ASSERT_NE(vulkanImage.valid(), false); EXPECT_TRUE(vulkanImage.isExported_); -#if IGL_PLATFORM_WIN +#if IGL_PLATFORM_WINDOWS EXPECT_NE(vulkanImage.exportedMemoryHandle_, nullptr); EXPECT_NE(vulkanImage.getVkImage(), static_cast(VK_NULL_HANDLE)); #elif IGL_PLATFORM_ANDROID || IGL_PLATFORM_LINUX @@ -82,7 +82,7 @@ TEST_F(VulkanImageTest, CreateImageWithExportedMemory) { #endif } -#if IGL_PLATFORM_WIN +#if IGL_PLATFORM_WINDOWS TEST_F(VulkanImageTest, CreateImageWithImportedMemoryWin32) { auto exportedImage = igl::vulkan::VulkanImage::createWithExportMemory( *context_, @@ -117,8 +117,8 @@ TEST_F(VulkanImageTest, CreateImageWithImportedMemoryWin32) { EXPECT_TRUE(importedImage.isImported_); EXPECT_NE(importedImage.getVkImage(), static_cast(VK_NULL_HANDLE)); } -#endif // IGL_PLATFORM_WIN +#endif // IGL_PLATFORM_WINDOWS } // namespace igl::tests -#endif // IGL_PLATFORM_WIN || IGL_PLATFORM_ANDROID || IGL_PLATFORM_LINUX +#endif // IGL_PLATFORM_WINDOWS || IGL_PLATFORM_ANDROID || IGL_PLATFORM_LINUX diff --git a/src/igl/tests/vulkan/VulkanSwapchainTest.cpp b/src/igl/tests/vulkan/VulkanSwapchainTest.cpp index ef4f901f3d..4f89dc7565 100644 --- a/src/igl/tests/vulkan/VulkanSwapchainTest.cpp +++ b/src/igl/tests/vulkan/VulkanSwapchainTest.cpp @@ -19,7 +19,7 @@ #include #endif -#if IGL_PLATFORM_WIN || IGL_PLATFORM_ANDROID || IGL_PLATFORM_LINUX +#if IGL_PLATFORM_WINDOWS || IGL_PLATFORM_ANDROID || IGL_PLATFORM_LINUX namespace igl::tests { @@ -37,7 +37,7 @@ class VulkanSwapchainTest : public ::testing::Test { public: // Set up common resources. void SetUp() override { -#if IGL_PLATFORM_WIN || IGL_PLATFORM_ANDROID +#if IGL_PLATFORM_WINDOWS || IGL_PLATFORM_ANDROID // @fb-only GTEST_SKIP() << "Fix these tests on Windows and Android, no headless surface support there."; #else @@ -61,7 +61,7 @@ class VulkanSwapchainTest : public ::testing::Test { }; TEST_F(VulkanSwapchainTest, CreateVulkanSwapchain) { -#if IGL_PLATFORM_WIN || IGL_PLATFORM_ANDROID +#if IGL_PLATFORM_WINDOWS || IGL_PLATFORM_ANDROID // @fb-only GTEST_SKIP() << "Fix these tests on Windows and Android, no headless surface support there."; #else @@ -85,4 +85,4 @@ TEST_F(VulkanSwapchainTest, CreateVulkanSwapchain) { } // namespace igl::tests -#endif // IGL_PLATFORM_WIN || IGL_PLATFORM_ANDROID || IGL_PLATFORM_LINUX +#endif // IGL_PLATFORM_WINDOWS || IGL_PLATFORM_ANDROID || IGL_PLATFORM_LINUX diff --git a/src/igl/vulkan/Common.h b/src/igl/vulkan/Common.h index 3f10c9fd43..535eb51cc1 100644 --- a/src/igl/vulkan/Common.h +++ b/src/igl/vulkan/Common.h @@ -18,7 +18,7 @@ #include #include -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX #include #endif diff --git a/src/igl/vulkan/VulkanContext.cpp b/src/igl/vulkan/VulkanContext.cpp index 91b078dbfb..029454efb5 100644 --- a/src/igl/vulkan/VulkanContext.cpp +++ b/src/igl/vulkan/VulkanContext.cpp @@ -67,7 +67,7 @@ const uint32_t kBinding_Sampler = 4; const uint32_t kBinding_SamplerShadow = 5; const uint32_t kBinding_StorageImages = 6; -#if defined(VK_EXT_debug_utils) && IGL_PLATFORM_WIN +#if defined(VK_EXT_debug_utils) && IGL_PLATFORM_WINDOWS VKAPI_ATTR VkBool32 VKAPI_CALL vulkanDebugCallback(VkDebugUtilsMessageSeverityFlagBitsEXT msgSeverity, [[maybe_unused]] VkDebugUtilsMessageTypeFlagsEXT msgType, @@ -565,12 +565,12 @@ void VulkanContext::createInstance(const size_t numExtraExtensions, vulkan::functions::loadInstanceFunctions(*tableImpl_, vkInstance_); -#if defined(VK_EXT_debug_utils) && IGL_PLATFORM_WIN +#if defined(VK_EXT_debug_utils) && IGL_PLATFORM_WINDOWS if (extensions_.enabled(VK_EXT_DEBUG_UTILS_EXTENSION_NAME)) { VK_ASSERT(ivkCreateDebugUtilsMessenger( &vf_, vkInstance_, &vulkanDebugCallback, this, &vkDebugUtilsMessenger_)); } -#endif // if defined(VK_EXT_debug_utils) && IGL_PLATFORM_WIN +#endif // if defined(VK_EXT_debug_utils) && IGL_PLATFORM_WINDOWS #if IGL_DEBUG || defined(IGL_FORCE_ENABLE_LOGS) if (config_.enableExtraLogs) { diff --git a/src/igl/vulkan/VulkanExtensions.cpp b/src/igl/vulkan/VulkanExtensions.cpp index 8498f790b3..e13ee39188 100644 --- a/src/igl/vulkan/VulkanExtensions.cpp +++ b/src/igl/vulkan/VulkanExtensions.cpp @@ -91,17 +91,17 @@ void VulkanExtensions::enableCommonInstanceExtensions(const VulkanContextConfig& #if defined(VK_EXT_debug_utils) enable(VK_EXT_DEBUG_UTILS_EXTENSION_NAME, ExtensionType::Instance); #endif -#if IGL_PLATFORM_WIN +#if IGL_PLATFORM_WINDOWS enable(VK_KHR_WIN32_SURFACE_EXTENSION_NAME, ExtensionType::Instance); #elif IGL_PLATFORM_ANDROID enable("VK_KHR_android_surface", ExtensionType::Instance); #elif IGL_PLATFORM_LINUX enable("VK_KHR_xlib_surface", ExtensionType::Instance); -#elif IGL_PLATFORM_MACOS +#elif IGL_PLATFORM_MACOSX enable(VK_EXT_METAL_SURFACE_EXTENSION_NAME, ExtensionType::Instance); #endif -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX // https://vulkan.lunarg.com/doc/sdk/1.3.216.0/mac/getting_started.html if (!enable(VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME, ExtensionType::Instance)) { IGL_LOG_ERROR("VK_KHR_portability_enumeration extension not supported\n"); @@ -168,13 +168,13 @@ void VulkanExtensions::enableCommonDeviceExtensions(const VulkanContextConfig& c #endif // VK_KHR_shader_non_semantic_info enable(VK_KHR_SWAPCHAIN_EXTENSION_NAME, ExtensionType::Device); -#if IGL_PLATFORM_MACOS +#if IGL_PLATFORM_MACOSX std::ignore = IGL_DEBUG_VERIFY(enable("VK_KHR_portability_subset", ExtensionType::Device)); #endif -#if IGL_PLATFORM_WIN +#if IGL_PLATFORM_WINDOWS enable(VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME, ExtensionType::Device); -#endif // IGL_PLATFORM_WIN +#endif // IGL_PLATFORM_WINDOWS #if IGL_PLATFORM_LINUX enable(VK_KHR_EXTERNAL_MEMORY_EXTENSION_NAME, ExtensionType::Device); diff --git a/src/igl/vulkan/VulkanHelpers.c b/src/igl/vulkan/VulkanHelpers.c index cd9474e537..38d8f2b5f4 100644 --- a/src/igl/vulkan/VulkanHelpers.c +++ b/src/igl/vulkan/VulkanHelpers.c @@ -112,7 +112,7 @@ VkResult ivkCreateInstance(const struct VulkanFunctionTable* vt, const char** extensions, VkInstance* outInstance) { // Validation Features not available on most Android devices -#if !IGL_PLATFORM_ANDROID && !IGL_PLATFORM_MACOS +#if !IGL_PLATFORM_ANDROID && !IGL_PLATFORM_MACOSX VkValidationFeatureEnableEXT validationFeaturesEnabled[2]; int validationFeaturesCount = 0; if (enableGPUAssistedValidation) { @@ -144,17 +144,17 @@ VkResult ivkCreateInstance(const struct VulkanFunctionTable* vt, const VkInstanceCreateInfo ci = { .sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO, -#if !IGL_PLATFORM_ANDROID && !IGL_PLATFORM_MACOS +#if !IGL_PLATFORM_ANDROID && !IGL_PLATFORM_MACOSX .pNext = enableValidation ? &features : NULL, #endif .pApplicationInfo = &appInfo, -#if !IGL_PLATFORM_ANDROID && !IGL_PLATFORM_MACOS +#if !IGL_PLATFORM_ANDROID && !IGL_PLATFORM_MACOSX .enabledLayerCount = enableValidation ? IGL_ARRAY_NUM_ELEMENTS(kDefaultValidationLayers) : 0, .ppEnabledLayerNames = enableValidation ? kDefaultValidationLayers : NULL, #endif .enabledExtensionCount = (uint32_t)numExtensions, .ppEnabledExtensionNames = extensions, -#if IGL_PLATFORM_MACOS || IGL_PLATFORM_MACCATALYST +#if IGL_PLATFORM_MACOSX || IGL_PLATFORM_MACCATALYST .flags = VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR, #endif }; diff --git a/src/igl/vulkan/VulkanImage.cpp b/src/igl/vulkan/VulkanImage.cpp index 327794a224..3ae664441b 100644 --- a/src/igl/vulkan/VulkanImage.cpp +++ b/src/igl/vulkan/VulkanImage.cpp @@ -43,7 +43,7 @@ uint32_t ivkGetMemoryTypeIndex(const VkPhysicalDeviceMemoryProperties& memProps, } // VkImage export and import is only implemented on Windows, Linux and Android platforms. -#if IGL_PLATFORM_WIN +#if IGL_PLATFORM_WINDOWS constexpr auto kHandleType = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT; #elif IGL_PLATFORM_LINUX || IGL_PLATFORM_ANDROID constexpr auto kHandleType = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT; @@ -491,7 +491,7 @@ VulkanImage::VulkanImage(const VulkanContext& ctx, // @fb-only } -#if IGL_PLATFORM_WIN +#if IGL_PLATFORM_WINDOWS VulkanImage::VulkanImage(const VulkanContext& ctx, void* windowsHandle, VkDevice device, @@ -581,9 +581,9 @@ VulkanImage::VulkanImage(const VulkanContext& ctx, VK_ASSERT(ctx_->vf_.vkAllocateMemory(device_, &memoryAllocateInfo, nullptr, &vkMemory_[0])); VK_ASSERT(ctx_->vf_.vkBindImageMemory(device_, vkImage_, vkMemory_[0], 0)); } -#endif // IGL_PLATFORM_WIN +#endif // IGL_PLATFORM_WINDOWS -#if IGL_PLATFORM_WIN || IGL_PLATFORM_LINUX || IGL_PLATFORM_ANDROID +#if IGL_PLATFORM_WINDOWS || IGL_PLATFORM_LINUX || IGL_PLATFORM_ANDROID VulkanImage VulkanImage::createWithExportMemory(const VulkanContext& ctx, VkDevice device, VkExtent3D extent, @@ -850,7 +850,7 @@ VulkanImage::VulkanImage(const VulkanContext& ctx, } VK_ASSERT(ctx_->vf_.vkBindImageMemory2(device_, numPlanes, bindInfo.data())); -#if IGL_PLATFORM_WIN +#if IGL_PLATFORM_WINDOWS const VkMemoryGetWin32HandleInfoKHR getHandleInfo{ VK_STRUCTURE_TYPE_MEMORY_GET_WIN32_HANDLE_INFO_KHR, nullptr, vkMemory_[0], kHandleType}; VK_ASSERT(ctx_->vf_.vkGetMemoryWin32HandleKHR(device_, &getHandleInfo, &exportedMemoryHandle_)); @@ -868,7 +868,7 @@ VulkanImage::VulkanImage(const VulkanContext& ctx, #endif // defined(IGL_ANDROID_HWBUFFER_SUPPORTED) #endif } -#endif // IGL_PLATFORM_WIN || IGL_PLATFORM_LINUX || IGL_PLATFORM_ANDROID +#endif // IGL_PLATFORM_WINDOWS || IGL_PLATFORM_LINUX || IGL_PLATFORM_ANDROID VulkanImage::~VulkanImage() { IGL_PROFILER_FUNCTION_COLOR(IGL_PROFILER_COLOR_DESTROY); diff --git a/src/igl/vulkan/VulkanImage.h b/src/igl/vulkan/VulkanImage.h index 4368861735..afc1cc104e 100644 --- a/src/igl/vulkan/VulkanImage.h +++ b/src/igl/vulkan/VulkanImage.h @@ -174,7 +174,7 @@ class VulkanImage final { VkSampleCountFlagBits samples, const char* debugName = nullptr); -#if IGL_PLATFORM_WIN +#if IGL_PLATFORM_WINDOWS /** * @brief Creates a `VulkanImage` with memory imported from a Windows handle. * NOTE: @@ -196,9 +196,9 @@ class VulkanImage final { VkImageCreateFlags createFlags, VkSampleCountFlagBits samples, const char* debugName = nullptr); -#endif // IGL_PLATFORM_WIN +#endif // IGL_PLATFORM_WINDOWS -#if IGL_PLATFORM_WIN || IGL_PLATFORM_LINUX || IGL_PLATFORM_ANDROID +#if IGL_PLATFORM_WINDOWS || IGL_PLATFORM_LINUX || IGL_PLATFORM_ANDROID /** * @brief Creates a `VulkanImage` object whose memory can be exported externally. * On Windows, the exported `HANDLE` will be stored in `exportedMemoryHandle_`. @@ -219,7 +219,7 @@ class VulkanImage final { AHardwareBuffer* hwBuffer, #endif // defined(IGL_ANDROID_HWBUFFER_SUPPORTED) const char* debugName = nullptr); -#endif // IGL_PLATFORM_WIN || IGL_PLATFORM_LINUX || IGL_PLATFORM_ANDROID +#endif // IGL_PLATFORM_WINDOWS || IGL_PLATFORM_LINUX || IGL_PLATFORM_ANDROID ~VulkanImage(); @@ -342,7 +342,7 @@ class VulkanImage final { VkImageTiling tiling_ = VK_IMAGE_TILING_OPTIMAL; bool isCoherentMemory_ = false; -#if IGL_PLATFORM_WIN || IGL_PLATFORM_LINUX || IGL_PLATFORM_ANDROID +#if IGL_PLATFORM_WINDOWS || IGL_PLATFORM_LINUX || IGL_PLATFORM_ANDROID /** * @brief Constructs a `VulkanImage` object and a `VkImage` object. Except for the debug name, all * other parameters are required. The debug name, if provided, is associated with the newly @@ -377,7 +377,7 @@ class VulkanImage final { AHardwareBuffer* hwBuffer, #endif // defined(IGL_ANDROID_HWBUFFER_SUPPORTED) const char* debugName); -#endif // IGL_PLATFORM_WIN || IGL_PLATFORM_LINUX || IGL_PLATFORM_ANDROID +#endif // IGL_PLATFORM_WINDOWS || IGL_PLATFORM_LINUX || IGL_PLATFORM_ANDROID // No-op in all builds except DEBUG void setName(const std::string& name) noexcept; diff --git a/src/igl/win/LogDefault.cpp b/src/igl/win/LogDefault.cpp index d6d43c1005..1b8f3a4ec3 100644 --- a/src/igl/win/LogDefault.cpp +++ b/src/igl/win/LogDefault.cpp @@ -7,9 +7,9 @@ #include -#if !IGL_PLATFORM_WIN +#if !IGL_PLATFORM_WINDOWS #error This file should only be compiled on Windows targets -#endif // !IGL_PLATFORM_WIN +#endif // !IGL_PLATFORM_WINDOWS #include #include