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

Method getCopyEncoder

RenderSystems/Vulkan/src/OgreVulkanQueue.cpp:861–898  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

859 }
860 //-------------------------------------------------------------------------
861 void VulkanQueue::getCopyEncoder( const BufferPacked *buffer, TextureGpu *texture,
862 const bool bDownload,
863 CopyEncTransitionMode::CopyEncTransitionMode transitionMode )
864 {
865 if( mEncoderState != EncoderCopyOpen )
866 {
867 endRenderEncoder();
868 endComputeEncoder();
869
870 mEncoderState = EncoderCopyOpen;
871
872 // Submission guarantees the host write being complete, as per
873 // khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#synchronization-submission-host-writes
874 // So no need for a barrier before the transfer
875 //
876 // The only exception is when writing from CPU to GPU when a command that uses that region
877 // has already been submitted via vkQueueSubmit (and you're using vkCmdWaitEvents to wait
878 // for the CPU to write the data and give ok to the GPU).
879 // Which Ogre does not do (too complex to get right).
880 }
881
882 if( texture && ( texture->isRenderToTexture() || texture->isUav() ) &&
883 transitionMode != CopyEncTransitionMode::AlreadyInLayoutThenManual )
884 {
885 BarrierSolver &solver = mRenderSystem->getBarrierSolver();
886 solver.assumeTransition( texture, ResourceLayout::CopyEncoderManaged,
887 ResourceAccess::Undefined, 0u );
888 }
889
890 if( bDownload )
891 prepareForDownload( buffer, texture, transitionMode );
892 else
893 prepareForUpload( buffer, texture, transitionMode );
894
895 OGRE_ASSERT_MEDIUM( ( mCopyEndReadDstBufferFlags || !mImageMemBarrierPtrs.empty() ) ||
896 ( mCopyDownloadTextures.empty() && !mCopyEndReadDstBufferFlags &&
897 mImageMemBarrierPtrs.empty() ) );
898 }
899 //-------------------------------------------------------------------------
900 void VulkanQueue::getCopyEncoderAsyncTextureTicketUpload()
901 {

Callers 7

downloadFromGpuMethod · 0.80
uploadMethod · 0.80
copyToMethod · 0.80
_autogenerateMipmapsMethod · 0.80
unmapImplMethod · 0.80
_asyncDownloadMethod · 0.80
copyToMethod · 0.80

Calls 4

isRenderToTextureMethod · 0.80
isUavMethod · 0.80
assumeTransitionMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected