• R/O
  • SSH

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

コミットメタ情報

リビジョン4f4831471708220b4be919f80d90fbb081416805 (tree)
日時2023-07-08 02:34:47
作者sebastian_bugiu
コミッターsebastian_bugiu

ログメッセージ

Added xrOS support as a subplatform of iOS.

変更サマリ

差分

diff -r 338aa963b202 -r 4f4831471708 CMake/Utils/OgreConfigTargets.cmake
--- a/CMake/Utils/OgreConfigTargets.cmake Thu Mar 02 10:04:11 2023 +0200
+++ b/CMake/Utils/OgreConfigTargets.cmake Fri Jul 07 20:34:47 2023 +0300
@@ -243,7 +243,8 @@
243243 PROPERTIES BUILD_WITH_INSTALL_RPATH 1
244244 INSTALL_NAME_DIR "@executable_path/../Frameworks"
245245 )
246- set_target_properties(${LIBNAME} PROPERTIES PUBLIC_HEADER "${HEADER_FILES};${PLATFORM_HEADERS};" )
246+ set_source_files_properties("${HEADER_FILES}" PROPERTIES MACOSX_PACKAGE_LOCATION Headers)
247+ set_source_files_properties("${PLATFORM_HEADERS}" PROPERTIES MACOSX_PACKAGE_LOCATION Headers)
247248 set_target_properties(${LIBNAME} PROPERTIES XCODE_ATTRIBUTE_GCC_PRECOMPILE_PREFIX_HEADER "YES")
248249 set_target_properties(${LIBNAME} PROPERTIES XCODE_ATTRIBUTE_GCC_PREFIX_HEADER "${OGRE_SOURCE_DIR}/OgreMain/include/OgreStableHeaders.h")
249250 set_target_properties(${LIBNAME} PROPERTIES RESOURCE "${RESOURCE_FILES}")
diff -r 338aa963b202 -r 4f4831471708 CMakeLists.txt
--- a/CMakeLists.txt Thu Mar 02 10:04:11 2023 +0200
+++ b/CMakeLists.txt Fri Jul 07 20:34:47 2023 +0300
@@ -242,6 +242,8 @@
242242 set(OGRE_STATIC TRUE)
243243 else ()
244244 include_directories("${OGRE_SOURCE_DIR}/OgreMain/include/OSX")
245+ # Set static early for proper dependency detection
246+ set(OGRE_STATIC TRUE)
245247 endif ()
246248 endif (APPLE)
247249
diff -r 338aa963b202 -r 4f4831471708 OgreMain/src/OgreRoot.cpp
--- a/OgreMain/src/OgreRoot.cpp Thu Mar 02 10:04:11 2023 +0200
+++ b/OgreMain/src/OgreRoot.cpp Fri Jul 07 20:34:47 2023 +0300
@@ -114,7 +114,7 @@
114114 #elif (OGRE_PLATFORM == OGRE_PLATFORM_WIN32)
115115 //#include "RenderSystems/GL3Plus/include/OgreGL3PlusRenderSystem.h"
116116 #include "RenderSystems/Direct3D11/include/OgreD3D11RenderSystem.h"
117-#elif OGRE_PLATFORM == OGRE_PLATFORM_APPLE_IOS
117+#elif (OGRE_PLATFORM == OGRE_PLATFORM_APPLE_IOS || OGRE_PLATFORM == OGRE_PLATFORM_APPLE)
118118 //#include "../../../RenderSystems/Metal/include/OgreMetalRenderSystem.h"
119119 #include "../../../RenderSystems/Metal/include/OgreMetalPlugin.h"
120120 #endif
diff -r 338aa963b202 -r 4f4831471708 RenderSystems/Metal/include/OgreMetalPrerequisites.h
--- a/RenderSystems/Metal/include/OgreMetalPrerequisites.h Thu Mar 02 10:04:11 2023 +0200
+++ b/RenderSystems/Metal/include/OgreMetalPrerequisites.h Fri Jul 07 20:34:47 2023 +0300
@@ -90,4 +90,6 @@
9090 # define _OgreMetalExport
9191 #endif
9292
93+#define PLATFORM_XROS
94+
9395 #endif //#ifndef _OgreMetalPrerequisites_H_
diff -r 338aa963b202 -r 4f4831471708 RenderSystems/Metal/src/OgreMetalHardwarePixelBuffer.mm
--- a/RenderSystems/Metal/src/OgreMetalHardwarePixelBuffer.mm Thu Mar 02 10:04:11 2023 +0200
+++ b/RenderSystems/Metal/src/OgreMetalHardwarePixelBuffer.mm Fri Jul 07 20:34:47 2023 +0300
@@ -422,7 +422,7 @@
422422 bytesPerRow:rowPitch
423423 bytesPerImage:bytesPerImage];
424424 break;
425-#if OGRE_PLATFORM != OGRE_PLATFORM_APPLE_IOS
425+#if OGRE_PLATFORM != OGRE_PLATFORM_APPLE_IOS || defined(PLATFORM_XROS)
426426 case MTLTextureTypeCubeArray:
427427 [mTexture replaceRegion:MTLRegionMake3D( dest.left, dest.top, dest.front,
428428 dest.getWidth(),
diff -r 338aa963b202 -r 4f4831471708 RenderSystems/Metal/src/OgreMetalRenderSystem.mm
--- a/RenderSystems/Metal/src/OgreMetalRenderSystem.mm Thu Mar 02 10:04:11 2023 +0200
+++ b/RenderSystems/Metal/src/OgreMetalRenderSystem.mm Fri Jul 07 20:34:47 2023 +0300
@@ -627,7 +627,7 @@
627627 if( renderTarget->prefersDepthTexture() )
628628 desc.usage |= MTLTextureUsageShaderRead;
629629
630-#if OGRE_PLATFORM != OGRE_PLATFORM_APPLE_IOS
630+#if OGRE_PLATFORM != OGRE_PLATFORM_APPLE_IOS || defined(PLATFORM_XROS)
631631 desc.storageMode = MTLStorageModePrivate;
632632 #endif
633633
@@ -1192,7 +1192,7 @@
11921192 ++itor;
11931193 }
11941194
1195-#if OGRE_PLATFORM != OGRE_PLATFORM_APPLE_IOS
1195+#if OGRE_PLATFORM != OGRE_PLATFORM_APPLE_IOS || defined(PLATFORM_XROS)
11961196 vertexDescriptor.attributes[15].format = MTLVertexFormatUInt;
11971197 vertexDescriptor.attributes[15].bufferIndex = 15;
11981198 vertexDescriptor.attributes[15].offset = 0;
@@ -1629,7 +1629,7 @@
16291629 "VertexArrayObject::setPrimitiveRange, you've entered an invalid "
16301630 "primStart; not supported by the Metal API." );
16311631 #endif
1632-#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE_IOS
1632+#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE_IOS && !defined(PLATFORM_XROS)
16331633 for( size_t j=0; j<numVertexBuffers; ++j )
16341634 {
16351635 //Manually set vertex buffer offsets since in iOS baseVertex is not supported
@@ -1681,7 +1681,7 @@
16811681
16821682 for( uint32 i=cmd->numDraws; i--; )
16831683 {
1684-#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE_IOS
1684+#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE_IOS && !defined(PLATFORM_XROS)
16851685 //Setup baseInstance.
16861686 [mActiveRenderEncoder setVertexBufferOffset:drawCmd->baseInstance * sizeof(uint32)
16871687 atIndex:15];
@@ -1724,7 +1724,7 @@
17241724 size_t offsetStart;
17251725 metalVertexBuffers[slot] = metalBuffer->getBufferName( offsetStart );
17261726 offsets[slot] = offsetStart;
1727-#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE_IOS
1727+#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE_IOS && !defined(PLATFORM_XROS)
17281728 offsets[slot] += cmd->vertexData->vertexStart * metalBuffer->getVertexSize();
17291729 #endif
17301730 ++itor;
@@ -1753,7 +1753,7 @@
17531753 static_cast<v1::MetalHardwareIndexBuffer*>( mCurrentIndexBuffer->indexBuffer.get() );
17541754 __unsafe_unretained id<MTLBuffer> indexBuffer = metalBuffer->getBufferName( offsetStart );
17551755
1756-#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE_IOS
1756+#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE_IOS && !defined(PLATFORM_XROS)
17571757 #if OGRE_DEBUG_MODE
17581758 assert( ((cmd->firstVertexIndex * bytesPerIndexElement) & 0x03) == 0
17591759 && "Index Buffer must be aligned to 4 bytes. If you're messing with "
@@ -1785,7 +1785,7 @@
17851785 //-------------------------------------------------------------------------
17861786 void MetalRenderSystem::_render( const v1::CbDrawCallStrip *cmd )
17871787 {
1788-#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE_IOS
1788+#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE_IOS && !defined(PLATFORM_XROS)
17891789 //Setup baseInstance.
17901790 [mActiveRenderEncoder setVertexBufferOffset:cmd->baseInstance * sizeof(uint32)
17911791 atIndex:15];
@@ -1836,7 +1836,7 @@
18361836 static_cast<v1::MetalHardwareIndexBuffer*>( mCurrentIndexBuffer->indexBuffer.get() );
18371837 __unsafe_unretained id<MTLBuffer> indexBuffer = metalBuffer->getBufferName( offsetStart );
18381838
1839-#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE_IOS
1839+#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE_IOS && !defined(PLATFORM_XROS)
18401840 #if OGRE_DEBUG_MODE
18411841 assert( ((mCurrentIndexBuffer->indexStart * bytesPerIndexElement) & 0x03) == 0
18421842 && "Index Buffer must be aligned to 4 bytes. If you're messing with "
@@ -1876,7 +1876,7 @@
18761876 clamp:0.0f];
18771877 }
18781878
1879-#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE_IOS
1879+#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE_IOS && !defined(PLATFORM_XROS)
18801880 const uint32 vertexStart = 0;
18811881 #else
18821882 const uint32 vertexStart = static_cast<uint32>( mCurrentVertexBuffer->vertexStart );