diff --git a/.github/workflows/run_clang_format.py b/.github/workflows/run_clang_format.py index bf6d53bde2..0f6e1afc46 100755 --- a/.github/workflows/run_clang_format.py +++ b/.github/workflows/run_clang_format.py @@ -39,6 +39,7 @@ 'RenderSystems/GL3Plus', 'RenderSystems/Metal', 'RenderSystems/NULL', + 'RenderSystems/Vulkan', 'PlugIns/ParticleFX', 'PlugIns/ParticleFX2', 'Samples/2.0', @@ -53,6 +54,7 @@ 'OgreMetalPixelFormatToShaderType.inl', 'OgreD3D11PixelFormatToShaderType.cpp', 'OgreD3D11PixelFormatToShaderType.inl', + 'spirv.h', 'spirv_reflect.h', 'LocalCubemapScene.h', 'LocalCubemapsManualProbesScene.h', 'OgreScriptTranslator.cpp'} diff --git a/RenderSystems/Vulkan/src/OgreVulkanDescriptorSets.cpp b/RenderSystems/Vulkan/src/OgreVulkanDescriptorSets.cpp index 130efa69e2..88b694810c 100644 --- a/RenderSystems/Vulkan/src/OgreVulkanDescriptorSets.cpp +++ b/RenderSystems/Vulkan/src/OgreVulkanDescriptorSets.cpp @@ -58,8 +58,8 @@ namespace Ogre { #if OGRE_ARCH_TYPE == OGRE_ARCHITECTURE_64 sampler = static_cast( samplerblock->mRsData ); -#else // VK handles are always 64bit, even on 32bit systems - sampler = *static_cast( samplerblock->mRsData ); +#else // VK handles are always 64bit, even on 32bit systems + sampler = *static_cast( samplerblock->mRsData ); #endif } VkDescriptorImageInfo imageInfo; diff --git a/RenderSystems/Vulkan/src/OgreVulkanRenderSystem.cpp b/RenderSystems/Vulkan/src/OgreVulkanRenderSystem.cpp index 781fe418e7..93a9d8d1c1 100644 --- a/RenderSystems/Vulkan/src/OgreVulkanRenderSystem.cpp +++ b/RenderSystems/Vulkan/src/OgreVulkanRenderSystem.cpp @@ -511,8 +511,8 @@ namespace Ogre pipelineCacheCreateInfo.pInitialData = buf.data() + sizeof( PipelineCachePrefixHeader ); VkPipelineCache pipelineCache{}; - result = vkCreatePipelineCache( mDevice->mDevice, &pipelineCacheCreateInfo, - nullptr, &pipelineCache ); + result = vkCreatePipelineCache( mDevice->mDevice, &pipelineCacheCreateInfo, nullptr, + &pipelineCache ); if( VK_SUCCESS == result && pipelineCache != 0 ) { std::swap( mDevice->mPipelineCache, pipelineCache ); @@ -538,8 +538,8 @@ namespace Ogre if( mDevice->mPipelineCache ) { size_t size{}; - VkResult result = vkGetPipelineCacheData( mDevice->mDevice, mDevice->mPipelineCache, &size, - nullptr ); + VkResult result = + vkGetPipelineCacheData( mDevice->mDevice, mDevice->mPipelineCache, &size, nullptr ); if( result == VK_SUCCESS && size > 0 && size <= 0x7FFFFFFF ) { std::vector buf; // PipelineCachePrefixHeader + payload @@ -807,7 +807,7 @@ namespace Ogre rsc->setCapability( RSC_VBO ); // VK_INDEX_TYPE_UINT32 is always supported with range at least 2^24-1 // and even 2^32-1 if mDevice->mDeviceFeatures.fullDrawIndexUint32 - rsc->setCapability( RSC_32BIT_INDEX ); + rsc->setCapability( RSC_32BIT_INDEX ); rsc->setCapability( RSC_TWO_SIDED_STENCIL ); rsc->setCapability( RSC_STENCIL_WRAP ); if( mDevice->mDeviceFeatures.shaderClipDistance ) @@ -1325,7 +1325,6 @@ namespace Ogre //------------------------------------------------------------------------- const VulkanPhysicalDeviceList &VulkanRenderSystem::getVulkanPhysicalDevices( bool refreshList ) { - if( refreshList || mVulkanPhysicalDeviceList.empty() ) { LogManager::getSingleton().logMessage( "Vulkan: Device detection starts" ); @@ -3016,8 +3015,7 @@ namespace Ogre #endif } - vkCmdSetViewport( mDevice->mGraphicsQueue.getCurrentCmdBuffer(), 0u, numViewports, - vkVp ); + vkCmdSetViewport( mDevice->mGraphicsQueue.getCurrentCmdBuffer(), 0u, numViewports, vkVp ); } if( mVpChanged || numViewports > 1u ) @@ -3366,16 +3364,14 @@ namespace Ogre // // This cannot catch all use cases, but if you fall into something this // doesn't catch, then you should probably be using explicit resolves - bool useNewLayoutForMsaa = - itor->newLayout == ResourceLayout::RenderTarget || - itor->newLayout == ResourceLayout::ResolveDest || - itor->newLayout == ResourceLayout::CopySrc || - itor->newLayout == ResourceLayout::CopyDst; - bool useOldLayoutForMsaa = - itor->oldLayout == ResourceLayout::RenderTarget || - itor->oldLayout == ResourceLayout::ResolveDest || - itor->oldLayout == ResourceLayout::CopySrc || - itor->oldLayout == ResourceLayout::CopyDst; + bool useNewLayoutForMsaa = itor->newLayout == ResourceLayout::RenderTarget || + itor->newLayout == ResourceLayout::ResolveDest || + itor->newLayout == ResourceLayout::CopySrc || + itor->newLayout == ResourceLayout::CopyDst; + bool useOldLayoutForMsaa = itor->oldLayout == ResourceLayout::RenderTarget || + itor->oldLayout == ResourceLayout::ResolveDest || + itor->oldLayout == ResourceLayout::CopySrc || + itor->oldLayout == ResourceLayout::CopyDst; if( !useNewLayoutForMsaa ) imageBarrier.newLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL; if( !useOldLayoutForMsaa ) @@ -3415,10 +3411,9 @@ namespace Ogre dstStage = VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT; vkCmdPipelineBarrier( mDevice->mGraphicsQueue.getCurrentCmdBuffer(), - srcStage & mDevice->mSupportedStages, - dstStage & mDevice->mSupportedStages, 0, numMemBarriers, &memBarrier, - 0u, 0, static_cast( mImageBarriers.size() ), - mImageBarriers.begin() ); + srcStage & mDevice->mSupportedStages, dstStage & mDevice->mSupportedStages, + 0, numMemBarriers, &memBarrier, 0u, 0, + static_cast( mImageBarriers.size() ), mImageBarriers.begin() ); mImageBarriers.clear(); } //------------------------------------------------------------------------- diff --git a/RenderSystems/Vulkan/src/OgreVulkanTextureGpu.cpp b/RenderSystems/Vulkan/src/OgreVulkanTextureGpu.cpp index 8cfcab8dc1..62ad8bf602 100644 --- a/RenderSystems/Vulkan/src/OgreVulkanTextureGpu.cpp +++ b/RenderSystems/Vulkan/src/OgreVulkanTextureGpu.cpp @@ -62,10 +62,7 @@ namespace Ogre _setToDisplayDummyTexture(); } //----------------------------------------------------------------------------------- - VulkanTextureGpu::~VulkanTextureGpu() - { - destroyInternalResourcesImpl(); - } + VulkanTextureGpu::~VulkanTextureGpu() { destroyInternalResourcesImpl(); } //----------------------------------------------------------------------------------- PixelFormatGpu VulkanTextureGpu::getWorkaroundedPixelFormat( const PixelFormatGpu pixelFormat ) const { diff --git a/RenderSystems/Vulkan/src/Vao/OgreVulkanStagingBuffer.cpp b/RenderSystems/Vulkan/src/Vao/OgreVulkanStagingBuffer.cpp index 84c058ec14..b1ae6b38d5 100644 --- a/RenderSystems/Vulkan/src/Vao/OgreVulkanStagingBuffer.cpp +++ b/RenderSystems/Vulkan/src/Vao/OgreVulkanStagingBuffer.cpp @@ -354,7 +354,8 @@ namespace Ogre OGRE_ASSERT_HIGH( !Workarounds::mPowerVRAlignment || ( region.dstOffset % Workarounds::mPowerVRAlignment ) == 0u ); #endif - vkCmdCopyBuffer( device->mGraphicsQueue.getCurrentCmdBuffer(), mVboName, dstBuffer, 1u, ®ion ); + vkCmdCopyBuffer( device->mGraphicsQueue.getCurrentCmdBuffer(), mVboName, dstBuffer, 1u, + ®ion ); if( mUploadOnly ) { @@ -417,7 +418,8 @@ namespace Ogre OGRE_ASSERT_HIGH( !Workarounds::mPowerVRAlignment || ( region.dstOffset % Workarounds::mPowerVRAlignment ) == 0u ); #endif - vkCmdCopyBuffer( device->mGraphicsQueue.getCurrentCmdBuffer(), srcBuffer, mVboName, 1u, ®ion ); + vkCmdCopyBuffer( device->mGraphicsQueue.getCurrentCmdBuffer(), srcBuffer, mVboName, 1u, + ®ion ); return freeRegionOffset + extraOffset; } diff --git a/RenderSystems/Vulkan/src/Vao/OgreVulkanVaoManager.cpp b/RenderSystems/Vulkan/src/Vao/OgreVulkanVaoManager.cpp index 8a1e81e03f..77a47b65a7 100644 --- a/RenderSystems/Vulkan/src/Vao/OgreVulkanVaoManager.cpp +++ b/RenderSystems/Vulkan/src/Vao/OgreVulkanVaoManager.cpp @@ -2146,7 +2146,7 @@ namespace Ogre } //----------------------------------------------------------------------------------- void VulkanVaoManager::getAvailableSemaphores( VkSemaphoreArray &semaphoreArray, - size_t numSemaphores ) + size_t numSemaphores ) { semaphoreArray.reserve( semaphoreArray.size() + numSemaphores ); diff --git a/RenderSystems/Vulkan/src/Windowing/Android/OgreVulkanAndroidSupport.cpp b/RenderSystems/Vulkan/src/Windowing/Android/OgreVulkanAndroidSupport.cpp index d6b73c6706..dc44135d9b 100644 --- a/RenderSystems/Vulkan/src/Windowing/Android/OgreVulkanAndroidSupport.cpp +++ b/RenderSystems/Vulkan/src/Windowing/Android/OgreVulkanAndroidSupport.cpp @@ -197,7 +197,7 @@ namespace Ogre } } //------------------------------------------------------------------------- - IdString VulkanAndroidSupport::getInterfaceName() const { return "android"; } + IdString VulkanAndroidSupport::getInterfaceName() const { return "android"; } //------------------------------------------------------------------------- - String VulkanAndroidSupport::getInterfaceNameStr() const { return "android"; } + String VulkanAndroidSupport::getInterfaceNameStr() const { return "android"; } } // namespace Ogre diff --git a/RenderSystems/Vulkan/src/Windowing/X11/OgreVulkanXcbWindow.cpp b/RenderSystems/Vulkan/src/Windowing/X11/OgreVulkanXcbWindow.cpp index 9610d90052..228f552f55 100644 --- a/RenderSystems/Vulkan/src/Windowing/X11/OgreVulkanXcbWindow.cpp +++ b/RenderSystems/Vulkan/src/Windowing/X11/OgreVulkanXcbWindow.cpp @@ -223,7 +223,6 @@ namespace Ogre VulkanTextureGpuManager *textureManager = static_cast( textureGpuManager ); - mTexture = textureManager->createTextureGpuWindow( this ); if( DepthBuffer::DefaultDepthBufferFormat != PFG_NULL ) { @@ -250,11 +249,10 @@ namespace Ogre if( mDepthBuffer ) { - mTexture->_setDepthBufferDefaults( - mDepthBuffer->isTilerMemoryless() - ? DepthBuffer::POOL_MEMORYLESS - : DepthBuffer::NO_POOL_EXPLICIT_RTV, false, - mDepthBuffer->getPixelFormat() ); + mTexture->_setDepthBufferDefaults( mDepthBuffer->isTilerMemoryless() + ? DepthBuffer::POOL_MEMORYLESS + : DepthBuffer::NO_POOL_EXPLICIT_RTV, + false, mDepthBuffer->getPixelFormat() ); } else { diff --git a/RenderSystems/Vulkan/src/Windowing/win32/OgreVulkanWin32Window.cpp b/RenderSystems/Vulkan/src/Windowing/win32/OgreVulkanWin32Window.cpp index 9df8c3629f..bfab5fadae 100644 --- a/RenderSystems/Vulkan/src/Windowing/win32/OgreVulkanWin32Window.cpp +++ b/RenderSystems/Vulkan/src/Windowing/win32/OgreVulkanWin32Window.cpp @@ -535,7 +535,6 @@ namespace Ogre VulkanTextureGpuManager *textureManager = static_cast( textureGpuManager ); - mTexture = textureManager->createTextureGpuWindow( this ); if( DepthBuffer::DefaultDepthBufferFormat != PFG_NULL ) { @@ -565,11 +564,10 @@ namespace Ogre if( mDepthBuffer ) { - mTexture->_setDepthBufferDefaults( - mDepthBuffer->isTilerMemoryless() - ? DepthBuffer::POOL_MEMORYLESS - : DepthBuffer::NO_POOL_EXPLICIT_RTV, false, - mDepthBuffer->getPixelFormat() ); + mTexture->_setDepthBufferDefaults( mDepthBuffer->isTilerMemoryless() + ? DepthBuffer::POOL_MEMORYLESS + : DepthBuffer::NO_POOL_EXPLICIT_RTV, + false, mDepthBuffer->getPixelFormat() ); } else {