From 6174312403451b624647c0b87006f6ceac8647a3 Mon Sep 17 00:00:00 2001 From: Eugene Golushkov Date: Thu, 28 Nov 2024 16:01:12 +0100 Subject: [PATCH] [D3D11] broadcast notifyDeviceLost at proper time, remove vboIdx poisoning that prevented it before. --- RenderSystems/Direct3D11/src/OgreD3D11RenderSystem.cpp | 4 ++-- .../Direct3D11/src/Vao/OgreD3D11BufferInterfaceBase.cpp | 1 - RenderSystems/Direct3D11/src/Vao/OgreD3D11VaoManager.cpp | 3 --- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/RenderSystems/Direct3D11/src/OgreD3D11RenderSystem.cpp b/RenderSystems/Direct3D11/src/OgreD3D11RenderSystem.cpp index c1c1c95a54f..57bc40c9534 100644 --- a/RenderSystems/Direct3D11/src/OgreD3D11RenderSystem.cpp +++ b/RenderSystems/Direct3D11/src/OgreD3D11RenderSystem.cpp @@ -1728,11 +1728,11 @@ namespace Ogre MeshManager::getSingleton().unloadAll( Resource::LF_MARKED_FOR_RELOAD ); + notifyDeviceLost( &mDevice ); + static_cast( mTextureGpuManager )->_destroyD3DResources(); static_cast( mVaoManager )->_destroyD3DResources(); - notifyDeviceLost( &mDevice ); - // Release all automatic temporary buffers and free unused // temporary buffers, so we doesn't need to recreate them, // and they will reallocate on demand. diff --git a/RenderSystems/Direct3D11/src/Vao/OgreD3D11BufferInterfaceBase.cpp b/RenderSystems/Direct3D11/src/Vao/OgreD3D11BufferInterfaceBase.cpp index 8adc1135398..6fa8fc62fbb 100644 --- a/RenderSystems/Direct3D11/src/Vao/OgreD3D11BufferInterfaceBase.cpp +++ b/RenderSystems/Direct3D11/src/Vao/OgreD3D11BufferInterfaceBase.cpp @@ -45,7 +45,6 @@ namespace Ogre //----------------------------------------------------------------------------------- void D3D11BufferInterfaceBase::notifyDeviceLost( D3D11Device *device ) { - mVboPoolIdx = 0xFFFFFFFF; mVboName.Reset(); } //----------------------------------------------------------------------------------- diff --git a/RenderSystems/Direct3D11/src/Vao/OgreD3D11VaoManager.cpp b/RenderSystems/Direct3D11/src/Vao/OgreD3D11VaoManager.cpp index 39683faa533..4e9514f9007 100644 --- a/RenderSystems/Direct3D11/src/Vao/OgreD3D11VaoManager.cpp +++ b/RenderSystems/Direct3D11/src/Vao/OgreD3D11VaoManager.cpp @@ -587,9 +587,6 @@ namespace Ogre void D3D11VaoManager::deallocateVbo( size_t vboIdx, size_t bufferOffset, size_t sizeBytes, BufferType bufferType, InternalBufferType internalType ) { - if( vboIdx == 0xFFFFFFFF ) - return; - if( bufferType >= BT_DYNAMIC_DEFAULT ) { bufferType = BT_DYNAMIC_DEFAULT; // Persitent mapping not supported in D3D11.