リビジョン | 4f4831471708220b4be919f80d90fbb081416805 (tree) |
---|---|
日時 | 2023-07-08 02:34:47 |
作者 | sebastian_bugiu |
コミッター | sebastian_bugiu |
Added xrOS support as a subplatform of iOS.
@@ -243,7 +243,8 @@ | ||
243 | 243 | PROPERTIES BUILD_WITH_INSTALL_RPATH 1 |
244 | 244 | INSTALL_NAME_DIR "@executable_path/../Frameworks" |
245 | 245 | ) |
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) | |
247 | 248 | set_target_properties(${LIBNAME} PROPERTIES XCODE_ATTRIBUTE_GCC_PRECOMPILE_PREFIX_HEADER "YES") |
248 | 249 | set_target_properties(${LIBNAME} PROPERTIES XCODE_ATTRIBUTE_GCC_PREFIX_HEADER "${OGRE_SOURCE_DIR}/OgreMain/include/OgreStableHeaders.h") |
249 | 250 | set_target_properties(${LIBNAME} PROPERTIES RESOURCE "${RESOURCE_FILES}") |
@@ -242,6 +242,8 @@ | ||
242 | 242 | set(OGRE_STATIC TRUE) |
243 | 243 | else () |
244 | 244 | include_directories("${OGRE_SOURCE_DIR}/OgreMain/include/OSX") |
245 | + # Set static early for proper dependency detection | |
246 | + set(OGRE_STATIC TRUE) | |
245 | 247 | endif () |
246 | 248 | endif (APPLE) |
247 | 249 |
@@ -114,7 +114,7 @@ | ||
114 | 114 | #elif (OGRE_PLATFORM == OGRE_PLATFORM_WIN32) |
115 | 115 | //#include "RenderSystems/GL3Plus/include/OgreGL3PlusRenderSystem.h" |
116 | 116 | #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) | |
118 | 118 | //#include "../../../RenderSystems/Metal/include/OgreMetalRenderSystem.h" |
119 | 119 | #include "../../../RenderSystems/Metal/include/OgreMetalPlugin.h" |
120 | 120 | #endif |
@@ -90,4 +90,6 @@ | ||
90 | 90 | # define _OgreMetalExport |
91 | 91 | #endif |
92 | 92 | |
93 | +#define PLATFORM_XROS | |
94 | + | |
93 | 95 | #endif //#ifndef _OgreMetalPrerequisites_H_ |
@@ -422,7 +422,7 @@ | ||
422 | 422 | bytesPerRow:rowPitch |
423 | 423 | bytesPerImage:bytesPerImage]; |
424 | 424 | break; |
425 | -#if OGRE_PLATFORM != OGRE_PLATFORM_APPLE_IOS | |
425 | +#if OGRE_PLATFORM != OGRE_PLATFORM_APPLE_IOS || defined(PLATFORM_XROS) | |
426 | 426 | case MTLTextureTypeCubeArray: |
427 | 427 | [mTexture replaceRegion:MTLRegionMake3D( dest.left, dest.top, dest.front, |
428 | 428 | dest.getWidth(), |
@@ -627,7 +627,7 @@ | ||
627 | 627 | if( renderTarget->prefersDepthTexture() ) |
628 | 628 | desc.usage |= MTLTextureUsageShaderRead; |
629 | 629 | |
630 | -#if OGRE_PLATFORM != OGRE_PLATFORM_APPLE_IOS | |
630 | +#if OGRE_PLATFORM != OGRE_PLATFORM_APPLE_IOS || defined(PLATFORM_XROS) | |
631 | 631 | desc.storageMode = MTLStorageModePrivate; |
632 | 632 | #endif |
633 | 633 |
@@ -1192,7 +1192,7 @@ | ||
1192 | 1192 | ++itor; |
1193 | 1193 | } |
1194 | 1194 | |
1195 | -#if OGRE_PLATFORM != OGRE_PLATFORM_APPLE_IOS | |
1195 | +#if OGRE_PLATFORM != OGRE_PLATFORM_APPLE_IOS || defined(PLATFORM_XROS) | |
1196 | 1196 | vertexDescriptor.attributes[15].format = MTLVertexFormatUInt; |
1197 | 1197 | vertexDescriptor.attributes[15].bufferIndex = 15; |
1198 | 1198 | vertexDescriptor.attributes[15].offset = 0; |
@@ -1629,7 +1629,7 @@ | ||
1629 | 1629 | "VertexArrayObject::setPrimitiveRange, you've entered an invalid " |
1630 | 1630 | "primStart; not supported by the Metal API." ); |
1631 | 1631 | #endif |
1632 | -#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE_IOS | |
1632 | +#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE_IOS && !defined(PLATFORM_XROS) | |
1633 | 1633 | for( size_t j=0; j<numVertexBuffers; ++j ) |
1634 | 1634 | { |
1635 | 1635 | //Manually set vertex buffer offsets since in iOS baseVertex is not supported |
@@ -1681,7 +1681,7 @@ | ||
1681 | 1681 | |
1682 | 1682 | for( uint32 i=cmd->numDraws; i--; ) |
1683 | 1683 | { |
1684 | -#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE_IOS | |
1684 | +#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE_IOS && !defined(PLATFORM_XROS) | |
1685 | 1685 | //Setup baseInstance. |
1686 | 1686 | [mActiveRenderEncoder setVertexBufferOffset:drawCmd->baseInstance * sizeof(uint32) |
1687 | 1687 | atIndex:15]; |
@@ -1724,7 +1724,7 @@ | ||
1724 | 1724 | size_t offsetStart; |
1725 | 1725 | metalVertexBuffers[slot] = metalBuffer->getBufferName( offsetStart ); |
1726 | 1726 | offsets[slot] = offsetStart; |
1727 | -#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE_IOS | |
1727 | +#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE_IOS && !defined(PLATFORM_XROS) | |
1728 | 1728 | offsets[slot] += cmd->vertexData->vertexStart * metalBuffer->getVertexSize(); |
1729 | 1729 | #endif |
1730 | 1730 | ++itor; |
@@ -1753,7 +1753,7 @@ | ||
1753 | 1753 | static_cast<v1::MetalHardwareIndexBuffer*>( mCurrentIndexBuffer->indexBuffer.get() ); |
1754 | 1754 | __unsafe_unretained id<MTLBuffer> indexBuffer = metalBuffer->getBufferName( offsetStart ); |
1755 | 1755 | |
1756 | -#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE_IOS | |
1756 | +#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE_IOS && !defined(PLATFORM_XROS) | |
1757 | 1757 | #if OGRE_DEBUG_MODE |
1758 | 1758 | assert( ((cmd->firstVertexIndex * bytesPerIndexElement) & 0x03) == 0 |
1759 | 1759 | && "Index Buffer must be aligned to 4 bytes. If you're messing with " |
@@ -1785,7 +1785,7 @@ | ||
1785 | 1785 | //------------------------------------------------------------------------- |
1786 | 1786 | void MetalRenderSystem::_render( const v1::CbDrawCallStrip *cmd ) |
1787 | 1787 | { |
1788 | -#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE_IOS | |
1788 | +#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE_IOS && !defined(PLATFORM_XROS) | |
1789 | 1789 | //Setup baseInstance. |
1790 | 1790 | [mActiveRenderEncoder setVertexBufferOffset:cmd->baseInstance * sizeof(uint32) |
1791 | 1791 | atIndex:15]; |
@@ -1836,7 +1836,7 @@ | ||
1836 | 1836 | static_cast<v1::MetalHardwareIndexBuffer*>( mCurrentIndexBuffer->indexBuffer.get() ); |
1837 | 1837 | __unsafe_unretained id<MTLBuffer> indexBuffer = metalBuffer->getBufferName( offsetStart ); |
1838 | 1838 | |
1839 | -#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE_IOS | |
1839 | +#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE_IOS && !defined(PLATFORM_XROS) | |
1840 | 1840 | #if OGRE_DEBUG_MODE |
1841 | 1841 | assert( ((mCurrentIndexBuffer->indexStart * bytesPerIndexElement) & 0x03) == 0 |
1842 | 1842 | && "Index Buffer must be aligned to 4 bytes. If you're messing with " |
@@ -1876,7 +1876,7 @@ | ||
1876 | 1876 | clamp:0.0f]; |
1877 | 1877 | } |
1878 | 1878 | |
1879 | -#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE_IOS | |
1879 | +#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE_IOS && !defined(PLATFORM_XROS) | |
1880 | 1880 | const uint32 vertexStart = 0; |
1881 | 1881 | #else |
1882 | 1882 | const uint32 vertexStart = static_cast<uint32>( mCurrentVertexBuffer->vertexStart ); |