From c2a9e830175d658bf6862b3456228b9b1ce3804a Mon Sep 17 00:00:00 2001 From: assiduous Date: Tue, 7 Jan 2020 19:19:04 -0800 Subject: Finished reworking device feature reporting; removed EngineVkCreateInfo::DeviceFeatures structure. --- .../GraphicsEngineVulkan/src/EngineFactoryVk.cpp | 22 +++---------- .../src/RenderDeviceVkImpl.cpp | 38 ++++++++++++---------- 2 files changed, 25 insertions(+), 35 deletions(-) (limited to 'Graphics/GraphicsEngineVulkan') 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; -- cgit v1.2.3