diff --git a/RenderSystems/Vulkan/src/OgreVulkanRenderSystem.cpp b/RenderSystems/Vulkan/src/OgreVulkanRenderSystem.cpp index aebd12ea953..0d9aa88f8a7 100644 --- a/RenderSystems/Vulkan/src/OgreVulkanRenderSystem.cpp +++ b/RenderSystems/Vulkan/src/OgreVulkanRenderSystem.cpp @@ -674,6 +674,17 @@ namespace Ogre rsc->setCapability( RSC_EXPLICIT_API ); rsc->setMaxPointSize( 256 ); + const VkPhysicalDeviceMemoryProperties &memoryProperties = mDevice->mDeviceMemoryProperties; + for( uint32_t typeIndex = 0; typeIndex < memoryProperties.memoryTypeCount; ++typeIndex ) + { + const VkMemoryType &memoryType = memoryProperties.memoryTypes[typeIndex]; + if( ( memoryType.propertyFlags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT ) != 0 && + ( memoryType.propertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT ) != 0 && + ( memoryType.propertyFlags & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT ) != 0 ) + { + rsc->setCapability( RSC_UMA ); + } + } rsc->setVertexProgramConstantFloatCount( 256u ); rsc->setVertexProgramConstantIntCount( 256u ); diff --git a/RenderSystems/Vulkan/src/Vao/OgreVulkanBufferInterface.cpp b/RenderSystems/Vulkan/src/Vao/OgreVulkanBufferInterface.cpp index ae37005bad4..21f0a82198c 100644 --- a/RenderSystems/Vulkan/src/Vao/OgreVulkanBufferInterface.cpp +++ b/RenderSystems/Vulkan/src/Vao/OgreVulkanBufferInterface.cpp @@ -142,6 +142,15 @@ namespace Ogre //----------------------------------------------------------------------------------- size_t VulkanBufferInterface::advanceFrame( bool bAdvanceFrame ) { + if( mBuffer->mBufferType == BT_DEFAULT_SHARED ) + { + if( bAdvanceFrame ) + { + mBuffer->mFinalBufferStart = mBuffer->mInternalBufferStart; + } + return 0; + } + VulkanVaoManager *vaoManager = static_cast( mBuffer->mVaoManager ); size_t dynamicCurrentFrame = mBuffer->mFinalBufferStart - mBuffer->mInternalBufferStart; dynamicCurrentFrame /= mBuffer->_getInternalNumElements(); @@ -159,6 +168,12 @@ namespace Ogre //----------------------------------------------------------------------------------- void VulkanBufferInterface::regressFrame() { + if( mBuffer->mBufferType == BT_DEFAULT_SHARED ) + { + mBuffer->mFinalBufferStart = mBuffer->mInternalBufferStart; + return; + } + VulkanVaoManager *vaoManager = static_cast( mBuffer->mVaoManager ); size_t dynamicCurrentFrame = mBuffer->mFinalBufferStart - mBuffer->mInternalBufferStart; dynamicCurrentFrame /= mBuffer->_getInternalNumElements();