-------------------------------------------------------------------------
| 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 | { |
no test coverage detected