summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineVulkan
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2018-04-10 03:44:54 +0000
committerEgor Yusov <egor.yusov@gmail.com>2018-04-10 03:44:54 +0000
commitf41b874ea00b0d6fd1268c1e4550703d15e28cc4 (patch)
tree9821dd1da3a896d7378b4867ddf8b1a6f67ba89b /Graphics/GraphicsEngineVulkan
parentAdded texture view initialization (diff)
downloadDiligentCore-f41b874ea00b0d6fd1268c1e4550703d15e28cc4.tar.gz
DiligentCore-f41b874ea00b0d6fd1268c1e4550703d15e28cc4.zip
Vulkan: updated swap chain initialization; added depth buffer creation
Diffstat (limited to 'Graphics/GraphicsEngineVulkan')
-rw-r--r--Graphics/GraphicsEngineVulkan/include/SwapChainVkImpl.h2
-rw-r--r--Graphics/GraphicsEngineVulkan/include/TextureVkImpl.h2
-rw-r--r--Graphics/GraphicsEngineVulkan/include/VulkanUtilities/VulkanDebug.h3
-rw-r--r--Graphics/GraphicsEngineVulkan/include/VulkanUtilities/VulkanObjectWrappers.h6
-rw-r--r--Graphics/GraphicsEngineVulkan/src/PipelineStateVkImpl.cpp1
-rw-r--r--Graphics/GraphicsEngineVulkan/src/RenderDeviceFactoryVk.cpp4
-rw-r--r--Graphics/GraphicsEngineVulkan/src/RenderDeviceVkImpl.cpp2
-rw-r--r--Graphics/GraphicsEngineVulkan/src/SwapChainVkImpl.cpp69
-rw-r--r--Graphics/GraphicsEngineVulkan/src/TextureVkImpl.cpp6
-rw-r--r--Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanDebug.cpp5
-rw-r--r--Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanInstance.cpp6
-rw-r--r--Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanLogicalDevice.cpp14
-rw-r--r--Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanPhysicalDevice.cpp8
13 files changed, 37 insertions, 91 deletions
diff --git a/Graphics/GraphicsEngineVulkan/include/SwapChainVkImpl.h b/Graphics/GraphicsEngineVulkan/include/SwapChainVkImpl.h
index bad8c1ed..8b0f1810 100644
--- a/Graphics/GraphicsEngineVulkan/include/SwapChainVkImpl.h
+++ b/Graphics/GraphicsEngineVulkan/include/SwapChainVkImpl.h
@@ -70,7 +70,7 @@ private:
VkFormat m_VkColorFormat = VK_FORMAT_UNDEFINED;
std::vector< RefCntAutoPtr<ITextureViewVk>, STDAllocatorRawMem<RefCntAutoPtr<ITextureViewVk>> > m_pBackBufferRTV;
- //RefCntAutoPtr<ITextureViewVk> m_pDepthBufferDSV;
+ RefCntAutoPtr<ITextureViewVk> m_pDepthBufferDSV;
};
diff --git a/Graphics/GraphicsEngineVulkan/include/TextureVkImpl.h b/Graphics/GraphicsEngineVulkan/include/TextureVkImpl.h
index 95f23e58..ac10e686 100644
--- a/Graphics/GraphicsEngineVulkan/include/TextureVkImpl.h
+++ b/Graphics/GraphicsEngineVulkan/include/TextureVkImpl.h
@@ -56,7 +56,7 @@ public:
FixedBlockMemoryAllocator &TexViewObjAllocator,
class RenderDeviceVkImpl *pDeviceVk,
const TextureDesc& TexDesc,
- VkImage VkImageHandle);
+ VkImage&& VkImageHandle);
~TextureVkImpl();
diff --git a/Graphics/GraphicsEngineVulkan/include/VulkanUtilities/VulkanDebug.h b/Graphics/GraphicsEngineVulkan/include/VulkanUtilities/VulkanDebug.h
index a68a56f2..6d088f00 100644
--- a/Graphics/GraphicsEngineVulkan/include/VulkanUtilities/VulkanDebug.h
+++ b/Graphics/GraphicsEngineVulkan/include/VulkanUtilities/VulkanDebug.h
@@ -29,7 +29,8 @@ namespace VulkanUtilities
void SetupDebugging(
VkInstance instance,
VkDebugReportFlagsEXT flags,
- VkDebugReportCallbackEXT callBack);
+ VkDebugReportCallbackEXT callBack,
+ void *pUserData = nullptr);
// Clear debug callback
void FreeDebugCallback(VkInstance instance);
diff --git a/Graphics/GraphicsEngineVulkan/include/VulkanUtilities/VulkanObjectWrappers.h b/Graphics/GraphicsEngineVulkan/include/VulkanUtilities/VulkanObjectWrappers.h
index 00dd44d9..8e6747a3 100644
--- a/Graphics/GraphicsEngineVulkan/include/VulkanUtilities/VulkanObjectWrappers.h
+++ b/Graphics/GraphicsEngineVulkan/include/VulkanUtilities/VulkanObjectWrappers.h
@@ -38,10 +38,12 @@ namespace VulkanUtilities
m_pLogicalDevice(nullptr),
m_VkObject(VK_NULL_HANDLE)
{}
- VulkanObjectWrapper(std::shared_ptr<const VulkanLogicalDevice> pLogicalDevice, VulkanObjectType vkObject) :
+ VulkanObjectWrapper(std::shared_ptr<const VulkanLogicalDevice> pLogicalDevice, VulkanObjectType&& vkObject) :
m_pLogicalDevice(pLogicalDevice),
m_VkObject(vkObject)
- {}
+ {
+ vkObject = VK_NULL_HANDLE;
+ }
VulkanObjectWrapper(const VulkanObjectWrapper&) = delete;
VulkanObjectWrapper& operator = (const VulkanObjectWrapper&) = delete;
VulkanObjectWrapper(VulkanObjectWrapper&& rhs) :
diff --git a/Graphics/GraphicsEngineVulkan/src/PipelineStateVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/PipelineStateVkImpl.cpp
index 02ed991f..d00bc661 100644
--- a/Graphics/GraphicsEngineVulkan/src/PipelineStateVkImpl.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/PipelineStateVkImpl.cpp
@@ -26,7 +26,6 @@
#include "ShaderVkImpl.h"
#include "VulkanTypeConversions.h"
#include "RenderDeviceVkImpl.h"
-//#include "DXGITypeConversions.h"
#include "ShaderResourceBindingVkImpl.h"
#include "CommandContext.h"
#include "EngineMemory.h"
diff --git a/Graphics/GraphicsEngineVulkan/src/RenderDeviceFactoryVk.cpp b/Graphics/GraphicsEngineVulkan/src/RenderDeviceFactoryVk.cpp
index d61c05b8..223dbafe 100644
--- a/Graphics/GraphicsEngineVulkan/src/RenderDeviceFactoryVk.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/RenderDeviceFactoryVk.cpp
@@ -135,7 +135,7 @@ void EngineFactoryVkImpl::CreateDeviceAndContextsVk( const EngineVkAttribs& Crea
// All commands that are allowed on a queue that supports transfer operations are also allowed on a
// queue that supports either graphics or compute operations.Thus, if the capabilities of a queue family
// include VK_QUEUE_GRAPHICS_BIT or VK_QUEUE_COMPUTE_BIT, then reporting the VK_QUEUE_TRANSFER_BIT
- // capability separately for that queue family is optional.
+ // capability separately for that queue family is optional (4.1).
QueueInfo.queueFamilyIndex = PhysicalDevice->FindQueueFamily(VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT);
QueueInfo.queueCount = 1;
const float defaultQueuePriority = 1.0f; // Ask for highest priority for our queue. (range [0,1])
@@ -164,7 +164,7 @@ void EngineFactoryVkImpl::CreateDeviceAndContextsVk( const EngineVkAttribs& Crea
if (!DebugMarkersSupported && CreationAttribs.EnableValidation)
{
- LOG_INFO_MESSAGE("Debug marker extensions is not found on the system");
+ LOG_INFO_MESSAGE("Debug marker extension \"", VK_EXT_DEBUG_MARKER_EXTENSION_NAME, "\" is not found");
}
auto vkAllocator = Instance->GetVkAllocator();
diff --git a/Graphics/GraphicsEngineVulkan/src/RenderDeviceVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/RenderDeviceVkImpl.cpp
index f708b6aa..6579e643 100644
--- a/Graphics/GraphicsEngineVulkan/src/RenderDeviceVkImpl.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/RenderDeviceVkImpl.cpp
@@ -617,7 +617,7 @@ void RenderDeviceVkImpl::CreateTexture(const TextureDesc& TexDesc, VkImage vkImg
CreateDeviceObject( "texture", TexDesc, ppTexture,
[&]()
{
- TextureVkImpl *pTextureVk = NEW_RC_OBJ(m_TexObjAllocator, "TextureVkImpl instance", TextureVkImpl)(m_TexViewObjAllocator, this, TexDesc, vkImgHandle);
+ TextureVkImpl *pTextureVk = NEW_RC_OBJ(m_TexObjAllocator, "TextureVkImpl instance", TextureVkImpl)(m_TexViewObjAllocator, this, TexDesc, std::move(vkImgHandle));
pTextureVk->QueryInterface( IID_TextureVk, reinterpret_cast<IObject**>(ppTexture) );
}
);
diff --git a/Graphics/GraphicsEngineVulkan/src/SwapChainVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/SwapChainVkImpl.cpp
index 606abc1f..c7d77418 100644
--- a/Graphics/GraphicsEngineVulkan/src/SwapChainVkImpl.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/SwapChainVkImpl.cpp
@@ -172,19 +172,15 @@ SwapChainVkImpl::SwapChainVkImpl(IReferenceCounters *pRefCounters,
m_SwapChainDesc.Width = swapchainExtent.width;
m_SwapChainDesc.Height = swapchainExtent.height;
- // The FIFO present mode is guaranteed by the spec to be supported
- VkPresentModeKHR swapchainPresentMode = VK_PRESENT_MODE_FIFO_KHR;
- bool PresentModeSupported = false;
- for(auto presentMode : presentModes)
+ // Mailbox is the lowest latency non-tearing presentation mode
+ VkPresentModeKHR swapchainPresentMode = VK_PRESENT_MODE_MAILBOX_KHR;
+ bool PresentModeSupported = std::find(presentModes.begin(), presentModes.end(), swapchainPresentMode) != presentModes.end();
+ if(!PresentModeSupported)
{
- if(presentMode == swapchainPresentMode)
- {
- PresentModeSupported = true;
- break;
- }
+ swapchainPresentMode = VK_PRESENT_MODE_FIFO_KHR;
+ // The FIFO present mode is guaranteed by the spec to be supported
+ VERIFY(std::find(presentModes.begin(), presentModes.end(), swapchainPresentMode) != presentModes.end(), "FIFO present mode must be supported" );
}
- if(!PresentModeSupported)
- LOG_ERROR_AND_THROW("Present mode is not supported by this surface");
// Determine the number of VkImage's to use in the swap chain.
// We need to acquire only 1 presentable image at at time.
@@ -196,7 +192,7 @@ SwapChainVkImpl::SwapChainVkImpl(IReferenceCounters *pRefCounters,
LOG_INFO_MESSAGE("Requested back buffer count (", m_SwapChainDesc.BufferCount, ") is smaller than the minimal image count supported for this surface (", surfCapabilities.minImageCount, "). Resetting to ", surfCapabilities.minImageCount);
m_SwapChainDesc.BufferCount = surfCapabilities.minImageCount;
}
- if (m_SwapChainDesc.BufferCount > surfCapabilities.maxImageCount)
+ if (surfCapabilities.maxImageCount != 0 && m_SwapChainDesc.BufferCount > surfCapabilities.maxImageCount)
{
LOG_INFO_MESSAGE("Requested back buffer count (", m_SwapChainDesc.BufferCount, ") is greater than the maximal image count supported for this surface (", surfCapabilities.maxImageCount, "). Resetting to ", surfCapabilities.maxImageCount);
m_SwapChainDesc.BufferCount = surfCapabilities.maxImageCount;
@@ -237,7 +233,7 @@ SwapChainVkImpl::SwapChainVkImpl(IReferenceCounters *pRefCounters,
swapchain_ci.imageArrayLayers = 1;
swapchain_ci.presentMode = swapchainPresentMode;
swapchain_ci.oldSwapchain = VK_NULL_HANDLE;
- swapchain_ci.clipped = true;
+ swapchain_ci.clipped = VK_TRUE;
swapchain_ci.imageColorSpace = VK_COLORSPACE_SRGB_NONLINEAR_KHR;
swapchain_ci.imageUsage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
swapchain_ci.imageSharingMode = VK_SHARING_MODE_EXCLUSIVE;
@@ -320,29 +316,6 @@ void SwapChainVkImpl::InitBuffersAndViews()
RefCntAutoPtr<TextureVkImpl> pBackBufferTex;
ValidatedCast<RenderDeviceVkImpl>(m_pRenderDevice.RawPtr())->CreateTexture(BackBufferDesc, swapchainImages[i], &pBackBufferTex);
- //UNSUPPORTED("TODO: move all this code to Texture creation");
-
- VkImageViewCreateInfo color_image_view = {};
- color_image_view.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO;
- color_image_view.pNext = NULL;
- color_image_view.flags = 0;
- color_image_view.image = swapchainImages[i];
- color_image_view.viewType = VK_IMAGE_VIEW_TYPE_2D;
- color_image_view.format = m_VkColorFormat;
- color_image_view.components.r = VK_COMPONENT_SWIZZLE_R;
- color_image_view.components.g = VK_COMPONENT_SWIZZLE_G;
- color_image_view.components.b = VK_COMPONENT_SWIZZLE_B;
- color_image_view.components.a = VK_COMPONENT_SWIZZLE_A;
- color_image_view.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
- color_image_view.subresourceRange.baseMipLevel = 0;
- color_image_view.subresourceRange.levelCount = 1;
- color_image_view.subresourceRange.baseArrayLayer = 0;
- color_image_view.subresourceRange.layerCount = 1;
-
- VkImageView vkImgView = VK_NULL_HANDLE;
- err = vkCreateImageView(LogicalVkDevice, &color_image_view, NULL, &vkImgView);
- CHECK_VK_ERROR_AND_THROW(err, "Failed to create view for a swap chain image");
-
TextureViewDesc RTVDesc;
RTVDesc.ViewType = TEXTURE_VIEW_RENDER_TARGET;
RefCntAutoPtr<ITextureView> pRTV;
@@ -350,29 +323,6 @@ void SwapChainVkImpl::InitBuffersAndViews()
m_pBackBufferRTV[i] = RefCntAutoPtr<ITextureViewVk>(pRTV, IID_TextureViewVk);
}
-#if 0
- /* VULKAN_KEY_END */
-
- /* Clean Up */
- for (uint32_t i = 0; i < info.swapchainImageCount; i++) {
- vkDestroyImageView(LogicalVkDevice, info.buffers[i].view, NULL);
- }
-#endif
-
-#if 0
-
- for(Uint32 backbuff = 0; backbuff < m_SwapChainDesc.BufferCount; ++backbuff)
- {
- CComPtr<IVkResource> pBackBuffer;
- auto hr = m_pSwapChain->GetBuffer(backbuff, __uuidof(pBackBuffer), reinterpret_cast<void**>( static_cast<IVkResource**>(&pBackBuffer) ));
- if(FAILED(hr))
- LOG_ERROR_AND_THROW("Failed to get back buffer ", backbuff," from the swap chain");
-
- hr = pBackBuffer->SetName(L"Main back buffer");
- VERIFY_EXPR(SUCCEEDED(hr));
-
- }
-
TextureDesc DepthBufferDesc;
DepthBufferDesc.Type = RESOURCE_DIM_TEX_2D;
DepthBufferDesc.Width = m_SwapChainDesc.Width;
@@ -390,7 +340,6 @@ void SwapChainVkImpl::InitBuffersAndViews()
m_pRenderDevice->CreateTexture(DepthBufferDesc, TextureData(), static_cast<ITexture**>(&pDepthBufferTex) );
auto pDSV = pDepthBufferTex->GetDefaultView(TEXTURE_VIEW_DEPTH_STENCIL);
m_pDepthBufferDSV = RefCntAutoPtr<ITextureViewVk>(pDSV, IID_TextureViewVk);
-#endif
}
IMPLEMENT_QUERY_INTERFACE( SwapChainVkImpl, IID_SwapChainVk, TSwapChainBase )
diff --git a/Graphics/GraphicsEngineVulkan/src/TextureVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/TextureVkImpl.cpp
index 978b205a..c737ef8e 100644
--- a/Graphics/GraphicsEngineVulkan/src/TextureVkImpl.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/TextureVkImpl.cpp
@@ -126,7 +126,7 @@ TextureVkImpl :: TextureVkImpl(IReferenceCounters *pRefCounters,
ImageCI.usage |= VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT;
if ((m_Desc.BindFlags & BIND_UNORDERED_ACCESS) || (m_Desc.MiscFlags & MISC_TEXTURE_FLAG_GENERATE_MIPS))
ImageCI.usage |= VK_IMAGE_USAGE_STORAGE_BIT;
- if ((m_Desc.BindFlags & BIND_SHADER_RESOURCE) == 0)
+ if (m_Desc.BindFlags & BIND_SHADER_RESOURCE)
ImageCI.usage |= VK_IMAGE_USAGE_SAMPLED_BIT;
ImageCI.sharingMode = VK_SHARING_MODE_EXCLUSIVE;
@@ -363,9 +363,9 @@ TextureVkImpl::TextureVkImpl(IReferenceCounters *pRefCounters,
FixedBlockMemoryAllocator &TexViewObjAllocator,
RenderDeviceVkImpl *pDeviceVk,
const TextureDesc& TexDesc,
- VkImage VkImageHandle) :
+ VkImage&& VkImageHandle) :
TTextureBase(pRefCounters, TexViewObjAllocator, pDeviceVk, InitTexDescFromVkImage(VkImageHandle, TexDesc)),
- m_VulkanImage(nullptr, VkImageHandle)
+ m_VulkanImage(nullptr, std::move(VkImageHandle))
{
}
IMPLEMENT_QUERY_INTERFACE( TextureVkImpl, IID_TextureVk, TTextureBase )
diff --git a/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanDebug.cpp b/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanDebug.cpp
index a66f267a..f9b8ec58 100644
--- a/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanDebug.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanDebug.cpp
@@ -72,12 +72,10 @@ namespace VulkanUtilities
// the validation message will be aborted or not
// We return VK_FALSE as we DON'T want Vulkan calls that cause a validation message
// (and return a VkResult) to abort
- // If you instead want to have calls abort, pass in VK_TRUE and the function will
- // return VK_ERROR_VALIDATION_FAILED_EXT
return VK_FALSE;
}
- void SetupDebugging(VkInstance instance, VkDebugReportFlagsEXT flags, VkDebugReportCallbackEXT callBack)
+ void SetupDebugging(VkInstance instance, VkDebugReportFlagsEXT flags, VkDebugReportCallbackEXT callBack, void *pUserData)
{
auto CreateDebugReportCallback = reinterpret_cast<PFN_vkCreateDebugReportCallbackEXT>(vkGetInstanceProcAddr(instance, "vkCreateDebugReportCallbackEXT"));
VERIFY_EXPR(CreateDebugReportCallback != VK_NULL_HANDLE);
@@ -90,6 +88,7 @@ namespace VulkanUtilities
dbgCreateInfo.sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT;
dbgCreateInfo.pfnCallback = (PFN_vkDebugReportCallbackEXT)MessageCallback;
dbgCreateInfo.flags = flags;
+ dbgCreateInfo.pUserData = pUserData;
VkResult err = CreateDebugReportCallback(
instance,
diff --git a/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanInstance.cpp b/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanInstance.cpp
index 43c6d6cc..08a568c7 100644
--- a/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanInstance.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanInstance.cpp
@@ -61,10 +61,6 @@ namespace VulkanUtilities
VkAllocationCallbacks* pVkAllocator) :
m_pVkAllocator(pVkAllocator)
{
-#ifdef _DEBUG
- EnableValidation = true;
-#endif
-
{
// Enumerate available layers
uint32_t LayerCount = 0;
@@ -243,7 +239,7 @@ namespace VulkanUtilities
{
VkPhysicalDeviceProperties SelectedDeviceProps;
vkGetPhysicalDeviceProperties(SelectedPhysicalDevice, &SelectedDeviceProps);
- LOG_INFO_MESSAGE("Using physical device ", SelectedDeviceProps.deviceName);
+ LOG_INFO_MESSAGE("Using physical device '", SelectedDeviceProps.deviceName, '\'');
}
else
{
diff --git a/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanLogicalDevice.cpp b/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanLogicalDevice.cpp
index cc1370d0..f5a89277 100644
--- a/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanLogicalDevice.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanLogicalDevice.cpp
@@ -87,7 +87,7 @@ namespace VulkanUtilities
if(DebugName != nullptr && *DebugName != 0)
VulkanUtilities::SetCommandPoolName(m_VkDevice, CmdPool, DebugName);
- return CommandPoolWrapper{ GetSharedPtr(), CmdPool};
+ return CommandPoolWrapper{ GetSharedPtr(), std::move(CmdPool)};
}
BufferWrapper VulkanLogicalDevice::CreateBuffer(const VkBufferCreateInfo &BufferCI,
@@ -103,7 +103,7 @@ namespace VulkanUtilities
if (DebugName != nullptr && *DebugName != 0)
VulkanUtilities::SetBufferName(m_VkDevice, vkBuffer, DebugName);
- return BufferWrapper{ GetSharedPtr(), vkBuffer };
+ return BufferWrapper{ GetSharedPtr(), std::move(vkBuffer) };
}
BufferViewWrapper VulkanLogicalDevice::CreateBufferView(const VkBufferViewCreateInfo &BuffViewCI,
@@ -119,7 +119,7 @@ namespace VulkanUtilities
if (DebugName != nullptr && *DebugName != 0)
VulkanUtilities::SetBufferViewName(m_VkDevice, vkBufferView, DebugName);
- return BufferViewWrapper{ GetSharedPtr(), vkBufferView };
+ return BufferViewWrapper{ GetSharedPtr(), std::move(vkBufferView) };
}
ImageWrapper VulkanLogicalDevice::CreateImage(const VkImageCreateInfo &ImageCI,
@@ -135,7 +135,7 @@ namespace VulkanUtilities
if (DebugName != nullptr && *DebugName != 0)
VulkanUtilities::SetImageName(m_VkDevice, vkImage, DebugName);
- return ImageWrapper{ GetSharedPtr(), vkImage };
+ return ImageWrapper{ GetSharedPtr(), std::move(vkImage) };
}
ImageViewWrapper VulkanLogicalDevice::CreateImageView(const VkImageViewCreateInfo &ImageViewCI,
@@ -151,7 +151,7 @@ namespace VulkanUtilities
if (DebugName != nullptr && *DebugName != 0)
VulkanUtilities::SetImageViewName(m_VkDevice, vkImageView, DebugName);
- return ImageViewWrapper{ GetSharedPtr(), vkImageView };
+ return ImageViewWrapper{ GetSharedPtr(), std::move(vkImageView) };
}
FenceWrapper VulkanLogicalDevice::CreateFence(const VkFenceCreateInfo &FenceCI, const char *DebugName)const
@@ -166,7 +166,7 @@ namespace VulkanUtilities
if (DebugName != nullptr && *DebugName != 0)
VulkanUtilities::SetFenceName(m_VkDevice, vkFence, DebugName);
- return FenceWrapper{ GetSharedPtr(), vkFence };
+ return FenceWrapper{ GetSharedPtr(), std::move(vkFence) };
}
DeviceMemoryWrapper VulkanLogicalDevice::AllocateDeviceMemory(const VkMemoryAllocateInfo &AllocInfo,
@@ -183,7 +183,7 @@ namespace VulkanUtilities
if (DebugName != nullptr && *DebugName != 0)
VulkanUtilities::SetDeviceMemoryName(m_VkDevice, vkDeviceMem, DebugName);
- return DeviceMemoryWrapper{ GetSharedPtr(), vkDeviceMem };
+ return DeviceMemoryWrapper{ GetSharedPtr(), std::move(vkDeviceMem) };
}
diff --git a/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanPhysicalDevice.cpp b/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanPhysicalDevice.cpp
index 26f5e18a..35b53c86 100644
--- a/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanPhysicalDevice.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanPhysicalDevice.cpp
@@ -65,7 +65,7 @@ namespace VulkanUtilities
// All commands that are allowed on a queue that supports transfer operations are also allowed on
// a queue that supports either graphics or compute operations. Thus, if the capabilities of a queue
// family include VK_QUEUE_GRAPHICS_BIT or VK_QUEUE_COMPUTE_BIT, then reporting the VK_QUEUE_TRANSFER_BIT
- // capability separately for that queue family is optional.
+ // capability separately for that queue family is optional (4.1).
VkQueueFlags QueueFlagsOpt = QueueFlags;
if (QueueFlags & (VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT))
{
@@ -112,10 +112,10 @@ namespace VulkanUtilities
const auto &Props = m_QueueFamilyProperties[FamilyInd];
// Queues supporting graphics and/or compute operations must report (1,1,1)
// in minImageTransferGranularity, meaning that there are no additional restrictions
- // on the granularity of image transfer operations for these queues.
- VERIFY_EXPR(Props.minImageTransferGranularity.width == 1 &&
+ // on the granularity of image transfer operations for these queues (4.1).
+ VERIFY_EXPR(Props.minImageTransferGranularity.width == 1 &&
Props.minImageTransferGranularity.height == 1 &&
- Props.minImageTransferGranularity.depth == 1);
+ Props.minImageTransferGranularity.depth == 1);
}
}
else