MCPcopy Create free account
hub / github.com/OGRECave/ogre-next / notifyTextureDestroyed

Method notifyTextureDestroyed

RenderSystems/Vulkan/src/OgreVulkanQueue.cpp:1064–1104  ·  view source on GitHub ↗

-------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

1062 }
1063 //-------------------------------------------------------------------------
1064 void VulkanQueue::notifyTextureDestroyed( VulkanTextureGpu *texture )
1065 {
1066 if( mEncoderState == EncoderCopyOpen )
1067 {
1068 bool needsToFlush = false;
1069 bool mustRemoveFromBarrier = false;
1070 TextureGpuDownloadMap::const_iterator itor = mCopyDownloadTextures.find( texture );
1071
1072 if( itor != mCopyDownloadTextures.end() )
1073 {
1074 needsToFlush = true;
1075 mustRemoveFromBarrier = true;
1076 }
1077 else
1078 {
1079 FastArray<TextureGpu *>::const_iterator it2 =
1080 std::find( mImageMemBarrierPtrs.begin(), mImageMemBarrierPtrs.end(), texture );
1081 if( it2 != mImageMemBarrierPtrs.end() )
1082 needsToFlush = true;
1083 }
1084
1085 if( needsToFlush )
1086 {
1087 // If this asserts triggers, then the texture is probably being referenced
1088 // by something else doing anything on the texture and was interrupted
1089 // midway (since Ogre must ensure the texture ends in TRANSFER_SRC/DST_OPTIMAL
1090 // if the copy encoder is holding a reference.
1091 OGRE_ASSERT_LOW( texture->mCurrLayout == VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL ||
1092 texture->mCurrLayout == VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL );
1093 endCopyEncoder();
1094
1095 if( mustRemoveFromBarrier )
1096 {
1097 // endCopyEncoder() just called solver.assumeTransition() on this texture
1098 // but we're destroying the texture. Remove the dangling pointer.
1099 BarrierSolver &solver = mRenderSystem->getBarrierSolver();
1100 solver.textureDeleted( texture );
1101 }
1102 }
1103 }
1104 }
1105 //-------------------------------------------------------------------------
1106 VkFence VulkanQueue::acquireCurrentFence()
1107 {

Callers 1

Calls 6

findFunction · 0.85
endCopyEncoderFunction · 0.85
textureDeletedMethod · 0.80
findMethod · 0.45
endMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected