Skip to content

Commit

Permalink
[D3D11] broadcast notifyDeviceLost at proper time, remove vboIdx pois…
Browse files Browse the repository at this point in the history
…oning that prevented it before.
  • Loading branch information
eugenegff committed Nov 28, 2024
1 parent 1f382b4 commit ad971a6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
4 changes: 2 additions & 2 deletions RenderSystems/Direct3D11/src/OgreD3D11RenderSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1728,11 +1728,11 @@ namespace Ogre

MeshManager::getSingleton().unloadAll( Resource::LF_MARKED_FOR_RELOAD );

notifyDeviceLost( &mDevice );

static_cast<D3D11TextureGpuManager *>( mTextureGpuManager )->_destroyD3DResources();
static_cast<D3D11VaoManager *>( 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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,7 @@ namespace Ogre
//-----------------------------------------------------------------------------------
D3D11BufferInterfaceBase::~D3D11BufferInterfaceBase() {}
//-----------------------------------------------------------------------------------
void D3D11BufferInterfaceBase::notifyDeviceLost( D3D11Device *device )
{
mVboPoolIdx = 0xFFFFFFFF;
mVboName.Reset();
}
void D3D11BufferInterfaceBase::notifyDeviceLost( D3D11Device *device ) { mVboName.Reset(); }
//-----------------------------------------------------------------------------------
void D3D11BufferInterfaceBase::notifyDeviceRestored( D3D11Device *device, unsigned pass ) {}
//-----------------------------------------------------------------------------------
Expand Down
3 changes: 0 additions & 3 deletions RenderSystems/Direct3D11/src/Vao/OgreD3D11VaoManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit ad971a6

Please sign in to comment.