diff options
| author | assiduous <assiduous@diligentgraphics.com> | 2020-01-08 03:19:04 +0000 |
|---|---|---|
| committer | assiduous <assiduous@diligentgraphics.com> | 2020-01-08 03:19:04 +0000 |
| commit | c2a9e830175d658bf6862b3456228b9b1ce3804a (patch) | |
| tree | 59a2af293d8161863bb074b43cfaa8e2bdd2d5d3 /Graphics/GraphicsEngineVulkan | |
| parent | Merge branch 'master' of https://github.com/DiligentGraphics/DiligentCore.git (diff) | |
| download | DiligentCore-c2a9e830175d658bf6862b3456228b9b1ce3804a.tar.gz DiligentCore-c2a9e830175d658bf6862b3456228b9b1ce3804a.zip | |
Finished reworking device feature reporting; removed EngineVkCreateInfo::DeviceFeatures structure.
Diffstat (limited to 'Graphics/GraphicsEngineVulkan')
| -rw-r--r-- | Graphics/GraphicsEngineVulkan/src/EngineFactoryVk.cpp | 22 | ||||
| -rw-r--r-- | Graphics/GraphicsEngineVulkan/src/RenderDeviceVkImpl.cpp | 38 |
2 files changed, 25 insertions, 35 deletions
diff --git a/Graphics/GraphicsEngineVulkan/src/EngineFactoryVk.cpp b/Graphics/GraphicsEngineVulkan/src/EngineFactoryVk.cpp index bc0980e6..b1c91a7d 100644 --- a/Graphics/GraphicsEngineVulkan/src/EngineFactoryVk.cpp +++ b/Graphics/GraphicsEngineVulkan/src/EngineFactoryVk.cpp @@ -168,24 +168,6 @@ void EngineFactoryVkImpl::CreateDeviceAndContextsVk(const EngineVkCreateInfo& _E DeviceCreateInfo.pQueueCreateInfos = &QueueInfo; VkPhysicalDeviceFeatures DeviceFeatures = {}; -#define ENABLE_FEATURE(Feature) \ - if (EngineCI.EnabledFeatures.Feature) \ - { \ - if (PhysicalDeviceFeatures.Feature) \ - DeviceFeatures.Feature = VK_TRUE; \ - else \ - { \ - LOG_WARNING_MESSAGE("Requested device feature " #Feature " is not supported by the physical device and will be disabled"); \ - EngineCI.EnabledFeatures.Feature = false; \ - } \ - } - - ENABLE_FEATURE(textureCompressionBC) - ENABLE_FEATURE(vertexPipelineStoresAndAtomics) - ENABLE_FEATURE(fragmentStoresAndAtomics) - ENABLE_FEATURE(shaderStorageImageExtendedFormats) -#undef ENABLE_FEATURE - #define ENABLE_FEATURE(Feature) DeviceFeatures.Feature = PhysicalDeviceFeatures.Feature ENABLE_FEATURE(geometryShader); ENABLE_FEATURE(tessellationShader); @@ -199,6 +181,10 @@ void EngineFactoryVkImpl::CreateDeviceAndContextsVk(const EngineVkCreateInfo& _E ENABLE_FEATURE(independentBlend); ENABLE_FEATURE(dualSrcBlend); ENABLE_FEATURE(multiViewport); + ENABLE_FEATURE(textureCompressionBC); + ENABLE_FEATURE(vertexPipelineStoresAndAtomics); + ENABLE_FEATURE(fragmentStoresAndAtomics); + ENABLE_FEATURE(shaderStorageImageExtendedFormats); #undef ENABLE_FEATURE DeviceCreateInfo.pEnabledFeatures = &DeviceFeatures; // NULL or a pointer to a VkPhysicalDeviceFeatures structure that contains diff --git a/Graphics/GraphicsEngineVulkan/src/RenderDeviceVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/RenderDeviceVkImpl.cpp index 88e68693..58941eca 100644 --- a/Graphics/GraphicsEngineVulkan/src/RenderDeviceVkImpl.cpp +++ b/Graphics/GraphicsEngineVulkan/src/RenderDeviceVkImpl.cpp @@ -157,23 +157,27 @@ RenderDeviceVkImpl::RenderDeviceVkImpl(IReferenceCounters* auto& Features = m_DeviceCaps.Features; const auto& vkDeviceFeatures = m_PhysicalDevice->GetFeatures(); - Features.SeparablePrograms = True; - Features.IndirectRendering = True; - Features.WireframeFill = vkDeviceFeatures.fillModeNonSolid != VK_FALSE; - Features.MultithreadedResourceCreation = True; - Features.ComputeShaders = True; - Features.GeometryShaders = vkDeviceFeatures.geometryShader != VK_FALSE; - Features.Tessellation = vkDeviceFeatures.tessellationShader != VK_FALSE; - Features.BindlessResources = True; - Features.OcclusionQueries = vkDeviceFeatures.occlusionQueryPrecise != VK_FALSE; - Features.BinaryOcclusionQueries = True; - Features.TimestampQueries = True; - Features.PipelineStatisticsQueries = vkDeviceFeatures.pipelineStatisticsQuery != VK_FALSE; - Features.DepthBiasClamp = vkDeviceFeatures.depthBiasClamp != VK_FALSE; - Features.DepthClamp = vkDeviceFeatures.depthClamp != VK_FALSE; - Features.IndependentBlend = vkDeviceFeatures.independentBlend != VK_FALSE; - Features.DualSourceBlend = vkDeviceFeatures.dualSrcBlend != VK_FALSE; - Features.MultiViewport = vkDeviceFeatures.multiViewport != VK_FALSE; + Features.SeparablePrograms = True; + Features.IndirectRendering = True; + Features.WireframeFill = vkDeviceFeatures.fillModeNonSolid != VK_FALSE; + Features.MultithreadedResourceCreation = True; + Features.ComputeShaders = True; + Features.GeometryShaders = vkDeviceFeatures.geometryShader != VK_FALSE; + Features.Tessellation = vkDeviceFeatures.tessellationShader != VK_FALSE; + Features.BindlessResources = True; + Features.OcclusionQueries = vkDeviceFeatures.occlusionQueryPrecise != VK_FALSE; + Features.BinaryOcclusionQueries = True; + Features.TimestampQueries = True; + Features.PipelineStatisticsQueries = vkDeviceFeatures.pipelineStatisticsQuery != VK_FALSE; + Features.DepthBiasClamp = vkDeviceFeatures.depthBiasClamp != VK_FALSE; + Features.DepthClamp = vkDeviceFeatures.depthClamp != VK_FALSE; + Features.IndependentBlend = vkDeviceFeatures.independentBlend != VK_FALSE; + Features.DualSourceBlend = vkDeviceFeatures.dualSrcBlend != VK_FALSE; + Features.MultiViewport = vkDeviceFeatures.multiViewport != VK_FALSE; + Features.TextureCompressionBC = vkDeviceFeatures.textureCompressionBC != VK_FALSE; + Features.VertexPipelineUAVWritesAndAtomics = vkDeviceFeatures.vertexPipelineStoresAndAtomics != VK_FALSE; + Features.PixelUAVWritesAndAtomics = vkDeviceFeatures.fragmentStoresAndAtomics != VK_FALSE; + Features.TextureUAVExtendedFormats = vkDeviceFeatures.shaderStorageImageExtendedFormats != VK_FALSE; const auto& vkDeviceLimits = m_PhysicalDevice->GetProperties().limits; auto& TexCaps = m_DeviceCaps.TexCaps; |
