Skip to content

Commit

Permalink
Merge branch 'OGRECave:master' into removeFiles
Browse files Browse the repository at this point in the history
  • Loading branch information
mosfet80 authored May 13, 2023
2 parents 11d5494 + b9b4de3 commit 4bcd2e0
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 26 deletions.
8 changes: 1 addition & 7 deletions CMake/Templates/SDK_CMakeLists.txt.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,10 @@
# OGRE SAMPLES BUILD SYSTEM
######################################################################

cmake_minimum_required(VERSION 2.6.2)
cmake_minimum_required(VERSION 3.5.1)
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS TRUE)
cmake_policy(SET CMP0003 NEW)

# CMake 2.8.2 has a bug that creates unusable Xcode projects when using ARCHS_STANDARD_32_BIT
# to specify both armv6 and armv7.
if(OGRE_BUILD_PLATFORM_APPLE_IOS AND (CMAKE_VERSION VERSION_EQUAL 2.8.2) AND (CMAKE_GENERATOR STREQUAL "Xcode"))
message(FATAL_ERROR "CMake 2.8.2 cannot create compatible Xcode projects for iOS, please download the latest version or an older release from http://www.cmake.org/files/")
endif()

# Just debug / release since that's all that's included in SDK. Only release for iOS/OS X
if(APPLE)
set (CMAKE_CONFIGURATION_TYPES "Release" CACHE STRING "" FORCE)
Expand Down
2 changes: 1 addition & 1 deletion Docs/src/SettingUpOgre/SettingUpOgreAndroid.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ Open these projects in Android Studio and deploy the APK.
> (but ocassionally does manifest even in portrait).
>
> If you suspect this is the cause of your bugs, edit the CMakeLists.txt file so that
> OGRE_CONFIG_ENABLE_VIEWPORT_ORIENTATIONMODE is no longer force-enabled.
> OGRE_CONFIG_ENABLE_VIEWPORT_ORIENTATIONMODE is no longer force-enabled, or pass miscParams["preTransform"] = "false" to the window.
>
> You can debug viewport orientation bugs on Desktop by enabling OGRE_CONFIG_ENABLE_VIEWPORT_ORIENTATIONMODE
> in your Desktop build, and manually editing OgreVulkanWindow.cpp and set:
Expand Down
4 changes: 4 additions & 0 deletions RenderSystems/Direct3D11/src/OgreD3D11Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,10 @@ namespace Ogre

_destroySizeDependedD3DResources();

// Call flush to ensure destruction of resources.
// not doing so may result in 'Out of memory' exception.
mDevice.GetImmediateContext()->Flush();

if( mUseFlipMode )
{
// swapchain is not multisampled in flip sequential mode, so we reuse it
Expand Down
1 change: 1 addition & 0 deletions RenderSystems/Vulkan/include/OgreVulkanWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ namespace Ogre
};

bool mLowestLatencyVSync;
bool mEnablePreTransform;
bool mClosed;

VkSurfaceKHR mSurfaceKHR;
Expand Down
6 changes: 5 additions & 1 deletion RenderSystems/Vulkan/src/OgreVulkanWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ namespace Ogre
uint32 height, bool fullscreenMode ) :
VulkanWindow( title, width, height, fullscreenMode ),
mLowestLatencyVSync( false ),
mEnablePreTransform( true ),
mClosed( false ),
mSurfaceKHR( 0 ),
mSwapchain( 0 ),
Expand Down Expand Up @@ -216,6 +217,9 @@ namespace Ogre
opt = miscParams->find( "vsync_method" );
if( opt != end )
mLowestLatencyVSync = opt->second == "Lowest Latency";
opt = miscParams->find( "preTransform" );
if( opt != end )
mEnablePreTransform = StringConverter::parseBool( opt->second );
}
//-------------------------------------------------------------------------
PixelFormatGpu VulkanWindowSwapChainBased::chooseSurfaceFormat( bool hwGamma )
Expand Down Expand Up @@ -410,7 +414,7 @@ namespace Ogre
}
}
#if OGRE_NO_VIEWPORT_ORIENTATIONMODE == 0
if( surfaceCaps.currentTransform <= VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR )
if( mEnablePreTransform && surfaceCaps.currentTransform <= VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR )
{
// We will manually rotate by adapting our projection matrices (fastest)
// See https://arm-software.github.io/vulkan_best_practice_for_mobile_developers/samples/
Expand Down
23 changes: 10 additions & 13 deletions RenderSystems/Vulkan/src/Vao/OgreVulkanVaoManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1951,10 +1951,6 @@ namespace Ogre
}
}

VaoManager::_update();
// Undo the increment from VaoManager::_update. This is done by _notifyNewCommandBuffer
--mFrameCount;

mUsedDescriptorPools.clear();

uint64 currentTimeMs = mTimer->getMilliseconds();
Expand Down Expand Up @@ -1999,6 +1995,14 @@ namespace Ogre
}
}

if( !mFenceFlushed )
{
// We could only reach here if _update() was called
// twice in a row without completing a full frame.
// Without this, waitForTailFrameToFinish becomes unsafe.
mDevice->commitAndNextCommandBuffer( SubmissionType::NewFrameIdx );
}

if( !mUsedSemaphores.empty() )
{
waitForTailFrameToFinish();
Expand Down Expand Up @@ -2049,22 +2053,15 @@ namespace Ogre

deallocateEmptyVbos( false );

if( !mFenceFlushed )
{
// We could only reach here if _update() was called
// twice in a row without completing a full frame.
// Without this, waitForTailFrameToFinish becomes unsafe.
mDevice->commitAndNextCommandBuffer( SubmissionType::NewFrameIdx );
}
VaoManager::_update();

mFenceFlushed = false;
mDynamicBufferCurrentFrame = ( mDynamicBufferCurrentFrame + 1 ) % mDynamicBufferMultiplier;
}
//-----------------------------------------------------------------------------------
void VulkanVaoManager::_notifyNewCommandBuffer()
{
mFenceFlushed = true;
mDynamicBufferCurrentFrame = ( mDynamicBufferCurrentFrame + 1 ) % mDynamicBufferMultiplier;
++mFrameCount;
}
//-----------------------------------------------------------------------------------
void VulkanVaoManager::getAvailableSempaphores( VkSemaphoreArray &semaphoreArray,
Expand Down
2 changes: 1 addition & 1 deletion Samples/2.0/AndroidAppTemplate/Template/app/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.4.1)
cmake_minimum_required(VERSION 3.5.1)

# build native_app_glue as a static lib
set( APP_GLUE_DIR ${ANDROID_NDK}/sources/android/native_app_glue )
Expand Down
2 changes: 1 addition & 1 deletion Samples/2.0/Tutorials/EmptyProject/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#set( CMAKE_TOOLCHAIN_FILE CMake/iOS.cmake )

cmake_minimum_required( VERSION 3.0 )
cmake_minimum_required( VERSION 3.5.1 )
project( EmptyProject )

set( EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/bin/${CMAKE_BUILD_TYPE}" )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,10 @@ namespace Ogre
if( hlms->_getProperty( HlmsBaseProp::ShadowCaster ) == 0 &&
hlms->_getProperty( PbsTerraProperty::TerraEnabled ) != 0 )
{
int32 texUnit = hlms->_getProperty( PbsProperty::Set0TextureSlotEnd );
hlms->_setTextureReg( VertexShader, "terrainShadows", texUnit - 1 );
int32 texUnit = hlms->_getProperty( PbsProperty::Set0TextureSlotEnd ) - 1;
if( hlms->_getProperty( PbsProperty::HasPlanarReflections ) )
--texUnit;
hlms->_setTextureReg( VertexShader, "terrainShadows", texUnit );
}
}
//-----------------------------------------------------------------------------------
Expand Down

0 comments on commit 4bcd2e0

Please sign in to comment.