From 2eb8af69722be7b37b07ef2f8a66e7f89cccc4a7 Mon Sep 17 00:00:00 2001 From: "Dmytro Yunchyk(aka DimA)" Date: Thu, 14 Sep 2023 14:02:44 +0200 Subject: [PATCH] Relax assert to allow changing orientaionMode for resident square RTT - usefull for reflections rendering on rotated Android devices --- RenderSystems/GL3Plus/src/OgreGL3PlusTextureGpu.cpp | 3 ++- RenderSystems/Vulkan/src/OgreVulkanTextureGpu.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/RenderSystems/GL3Plus/src/OgreGL3PlusTextureGpu.cpp b/RenderSystems/GL3Plus/src/OgreGL3PlusTextureGpu.cpp index 1824125f6c9..f1712e5c843 100644 --- a/RenderSystems/GL3Plus/src/OgreGL3PlusTextureGpu.cpp +++ b/RenderSystems/GL3Plus/src/OgreGL3PlusTextureGpu.cpp @@ -859,7 +859,8 @@ namespace Ogre //----------------------------------------------------------------------------------- void GL3PlusTextureGpuRenderTarget::setOrientationMode( OrientationMode orientationMode ) { - OGRE_ASSERT_LOW( mResidencyStatus == GpuResidency::OnStorage || isRenderWindowSpecific() ); + OGRE_ASSERT_LOW( mResidencyStatus == GpuResidency::OnStorage || isRenderWindowSpecific() || + isRenderToTexture() && mWidth == mHeight ); #if OGRE_NO_VIEWPORT_ORIENTATIONMODE == 0 mOrientationMode = orientationMode; #endif diff --git a/RenderSystems/Vulkan/src/OgreVulkanTextureGpu.cpp b/RenderSystems/Vulkan/src/OgreVulkanTextureGpu.cpp index 8d3bb1d2699..6a30fba7284 100644 --- a/RenderSystems/Vulkan/src/OgreVulkanTextureGpu.cpp +++ b/RenderSystems/Vulkan/src/OgreVulkanTextureGpu.cpp @@ -1014,7 +1014,8 @@ namespace Ogre //----------------------------------------------------------------------------------- void VulkanTextureGpuRenderTarget::setOrientationMode( OrientationMode orientationMode ) { - OGRE_ASSERT_LOW( mResidencyStatus == GpuResidency::OnStorage || isRenderWindowSpecific() ); + OGRE_ASSERT_LOW( mResidencyStatus == GpuResidency::OnStorage || isRenderWindowSpecific() || + isRenderToTexture() && mWidth == mHeight ); #if OGRE_NO_VIEWPORT_ORIENTATIONMODE == 0 mOrientationMode = orientationMode; #endif