diff options
| author | Assiduous <61806567+TheMostDiligent@users.noreply.github.com> | 2020-05-08 23:53:03 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-08 23:53:03 +0000 |
| commit | 396749ffb6687896b7e070197ad1d557a5ad6a29 (patch) | |
| tree | da509287fbcba6644d74abf1859a674820b37185 /Graphics/GraphicsEngineVulkan | |
| parent | VK backend: improved debug string for render pass objects (diff) | |
| parent | Update FBOCache.cpp (diff) | |
| download | DiligentCore-396749ffb6687896b7e070197ad1d557a5ad6a29.tar.gz DiligentCore-396749ffb6687896b7e070197ad1d557a5ad6a29.zip | |
Merge pull request #137 from markusgod/master
Small fixes.
Diffstat (limited to 'Graphics/GraphicsEngineVulkan')
3 files changed, 11 insertions, 14 deletions
diff --git a/Graphics/GraphicsEngineVulkan/src/SamplerVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/SamplerVkImpl.cpp index 22135811..38943da6 100644 --- a/Graphics/GraphicsEngineVulkan/src/SamplerVkImpl.cpp +++ b/Graphics/GraphicsEngineVulkan/src/SamplerVkImpl.cpp @@ -60,20 +60,18 @@ SamplerVkImpl::SamplerVkImpl(IReferenceCounters* pRefCounters, RenderDeviceVkImp SamplerCI.mipLodBias = m_Desc.MipLODBias; SamplerCI.anisotropyEnable = IsAnisotropicFilter(m_Desc.MinFilter); #ifdef DILIGENT_DEVELOPMENT - if (!((SamplerCI.anisotropyEnable && IsAnisotropicFilter(m_Desc.MagFilter)) || - (!SamplerCI.anisotropyEnable && !IsAnisotropicFilter(m_Desc.MagFilter)))) + if (SamplerCI.anisotropyEnable != IsAnisotropicFilter(m_Desc.MagFilter)) { - LOG_ERROR("Min and mag fiters must both be either anisotropic filters or non-anisotropic ones"); + LOG_ERROR("Min and mag filters must both be either anisotropic filters or non-anisotropic ones"); } #endif SamplerCI.maxAnisotropy = static_cast<float>(m_Desc.MaxAnisotropy); SamplerCI.compareEnable = IsComparisonFilter(m_Desc.MinFilter); #ifdef DILIGENT_DEVELOPMENT - if (!((SamplerCI.compareEnable && IsComparisonFilter(m_Desc.MagFilter)) || - (!SamplerCI.compareEnable && !IsComparisonFilter(m_Desc.MagFilter)))) + if (SamplerCI.compareEnable != IsComparisonFilter(m_Desc.MagFilter)) { - LOG_ERROR("Min and mag fiters must both be either comparison filters or non-comparison ones"); + LOG_ERROR("Min and mag filters must both be either comparison filters or non-comparison ones"); } #endif diff --git a/Graphics/GraphicsEngineVulkan/src/SwapChainVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/SwapChainVkImpl.cpp index 732c47e5..1789596f 100644 --- a/Graphics/GraphicsEngineVulkan/src/SwapChainVkImpl.cpp +++ b/Graphics/GraphicsEngineVulkan/src/SwapChainVkImpl.cpp @@ -512,8 +512,7 @@ void SwapChainVkImpl::InitBuffersAndViews() for (uint32_t i = 0; i < swapchainImageCount; i++) { - TextureDesc BackBufferDesc; - BackBufferDesc.Format = m_SwapChainDesc.ColorBufferFormat; + TextureDesc BackBufferDesc; std::stringstream name_ss; name_ss << "Main back buffer " << i; auto name = name_ss.str(); diff --git a/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanLogicalDevice.cpp b/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanLogicalDevice.cpp index 4f69421d..fbe6439a 100644 --- a/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanLogicalDevice.cpp +++ b/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanLogicalDevice.cpp @@ -97,7 +97,7 @@ VulkanObjectWrapper<VkObjectType, VkTypeId> VulkanLogicalDevice::CreateVulkanObj auto err = VkCreateObject(m_VkDevice, &CreateInfo, m_VkAllocator, &VkObject); CHECK_VK_ERROR_AND_THROW(err, "Failed to create Vulkan ", ObjectType, " '", DebugName, '\''); - if (DebugName != nullptr && *DebugName != 0) + if (*DebugName != 0) SetVulkanObjectName<VkObjectType, VkTypeId>(m_VkDevice, VkObject, DebugName); return VulkanObjectWrapper<VkObjectType, VkTypeId>{GetSharedPtr(), std::move(VkObject)}; @@ -169,7 +169,7 @@ DeviceMemoryWrapper VulkanLogicalDevice::AllocateDeviceMemory(const VkMemoryAllo auto err = vkAllocateMemory(m_VkDevice, &AllocInfo, m_VkAllocator, &vkDeviceMem); CHECK_VK_ERROR_AND_THROW(err, "Failed to allocate device memory '", DebugName, '\''); - if (DebugName != nullptr && *DebugName != 0) + if (*DebugName != 0) SetDeviceMemoryName(m_VkDevice, vkDeviceMem, DebugName); return DeviceMemoryWrapper{GetSharedPtr(), std::move(vkDeviceMem)}; @@ -189,7 +189,7 @@ PipelineWrapper VulkanLogicalDevice::CreateComputePipeline(const VkComputePipeli auto err = vkCreateComputePipelines(m_VkDevice, cache, 1, &PipelineCI, m_VkAllocator, &vkPipeline); CHECK_VK_ERROR_AND_THROW(err, "Failed to create compute pipeline '", DebugName, '\''); - if (DebugName != nullptr && *DebugName != 0) + if (*DebugName != 0) SetPipelineName(m_VkDevice, vkPipeline, DebugName); return PipelineWrapper{GetSharedPtr(), std::move(vkPipeline)}; @@ -209,7 +209,7 @@ PipelineWrapper VulkanLogicalDevice::CreateGraphicsPipeline(const VkGraphicsPipe auto err = vkCreateGraphicsPipelines(m_VkDevice, cache, 1, &PipelineCI, m_VkAllocator, &vkPipeline); CHECK_VK_ERROR_AND_THROW(err, "Failed to create graphics pipeline '", DebugName, '\''); - if (DebugName != nullptr && *DebugName != 0) + if (*DebugName != 0) SetPipelineName(m_VkDevice, vkPipeline, DebugName); return PipelineWrapper{GetSharedPtr(), std::move(vkPipeline)}; @@ -270,7 +270,7 @@ VkCommandBuffer VulkanLogicalDevice::AllocateVkCommandBuffer(const VkCommandBuff DEV_CHECK_ERR(err == VK_SUCCESS, "Failed to allocate command buffer '", DebugName, '\''); (void)err; - if (DebugName != nullptr && *DebugName != 0) + if (*DebugName != 0) SetCommandBufferName(m_VkDevice, CmdBuff, DebugName); return CmdBuff; @@ -290,7 +290,7 @@ VkDescriptorSet VulkanLogicalDevice::AllocateVkDescriptorSet(const VkDescriptorS if (err != VK_SUCCESS) return VK_NULL_HANDLE; - if (DebugName != nullptr && *DebugName != 0) + if (*DebugName != 0) SetDescriptorSetName(m_VkDevice, DescrSet, DebugName); return DescrSet; |
