summaryrefslogtreecommitdiffstats
path: root/Graphics
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2018-07-04 02:06:39 +0000
committerEgor Yusov <egor.yusov@gmail.com>2018-07-04 02:06:39 +0000
commitd70e32b7b1e0197859f79d8d949106896c05ea83 (patch)
tree85ce59dbeb141a27ca7112e1b38fa29c4cb5dfc3 /Graphics
parentEnabled vertexPipelineStoresAndAtomics and fragmentStoresAndAtomics device fe... (diff)
downloadDiligentCore-d70e32b7b1e0197859f79d8d949106896c05ea83.tar.gz
DiligentCore-d70e32b7b1e0197859f79d8d949106896c05ea83.zip
Moved list of vulkan device features to enable to initialization struct
Diffstat (limited to 'Graphics')
-rw-r--r--Graphics/GraphicsEngine/interface/GraphicsTypes.h19
-rw-r--r--Graphics/GraphicsEngineVulkan/src/RenderDeviceFactoryVk.cpp26
2 files changed, 32 insertions, 13 deletions
diff --git a/Graphics/GraphicsEngine/interface/GraphicsTypes.h b/Graphics/GraphicsEngine/interface/GraphicsTypes.h
index f7e994ae..1df91fa0 100644
--- a/Graphics/GraphicsEngine/interface/GraphicsTypes.h
+++ b/Graphics/GraphicsEngine/interface/GraphicsTypes.h
@@ -1291,6 +1291,25 @@ namespace Diligent
/// or when backbuffer is presented.
Uint32 NumCommandsToFlushCmdBuffer = 256;
+ /// List of device features to be enabled
+ /// see https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkPhysicalDeviceFeatures
+ struct DeviceFeatures
+ {
+ bool depthBiasClamp = false;
+ bool fillModeNonSolid = false;
+ bool depthClamp = false;
+ bool independentBlend = false;
+ bool samplerAnisotropy = true;
+ bool geometryShader = false;
+ bool tessellationShader = false;
+ bool dualSrcBlend = false;
+ bool multiViewport = false;
+ bool imageCubeArray = false;
+ bool textureCompressionBC = false;
+ bool vertexPipelineStoresAndAtomics = false;
+ bool fragmentStoresAndAtomics = false;
+ }EnabledFeatures;
+
/// Descriptor pool size
struct DescriptorPoolSize
{
diff --git a/Graphics/GraphicsEngineVulkan/src/RenderDeviceFactoryVk.cpp b/Graphics/GraphicsEngineVulkan/src/RenderDeviceFactoryVk.cpp
index 0edb78ac..b02c4d23 100644
--- a/Graphics/GraphicsEngineVulkan/src/RenderDeviceFactoryVk.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/RenderDeviceFactoryVk.cpp
@@ -150,19 +150,19 @@ void EngineFactoryVkImpl::CreateDeviceAndContextsVk( const EngineVkAttribs& Crea
DeviceCreateInfo.queueCreateInfoCount = 1;
DeviceCreateInfo.pQueueCreateInfos = &QueueInfo;
VkPhysicalDeviceFeatures DeviceFeatures = {};
- DeviceFeatures.depthBiasClamp = VK_TRUE;
- DeviceFeatures.fillModeNonSolid = VK_TRUE;
- DeviceFeatures.depthClamp = VK_TRUE;
- DeviceFeatures.independentBlend = VK_TRUE;
- DeviceFeatures.samplerAnisotropy = VK_TRUE;
- DeviceFeatures.geometryShader = VK_TRUE;
- DeviceFeatures.tessellationShader = VK_TRUE;
- DeviceFeatures.dualSrcBlend = VK_TRUE;
- DeviceFeatures.multiViewport = VK_TRUE;
- DeviceFeatures.imageCubeArray = VK_TRUE;
- DeviceFeatures.textureCompressionBC = VK_TRUE;
- DeviceFeatures.vertexPipelineStoresAndAtomics = VK_TRUE;
- DeviceFeatures.fragmentStoresAndAtomics = VK_TRUE;
+ DeviceFeatures.depthBiasClamp = CreationAttribs.EnabledFeatures.depthBiasClamp ? VK_TRUE : VK_FALSE;
+ DeviceFeatures.fillModeNonSolid = CreationAttribs.EnabledFeatures.fillModeNonSolid ? VK_TRUE : VK_FALSE;
+ DeviceFeatures.depthClamp = CreationAttribs.EnabledFeatures.depthClamp ? VK_TRUE : VK_FALSE;
+ DeviceFeatures.independentBlend = CreationAttribs.EnabledFeatures.independentBlend ? VK_TRUE : VK_FALSE;
+ DeviceFeatures.samplerAnisotropy = CreationAttribs.EnabledFeatures.samplerAnisotropy ? VK_TRUE : VK_FALSE;
+ DeviceFeatures.geometryShader = CreationAttribs.EnabledFeatures.geometryShader ? VK_TRUE : VK_FALSE;
+ DeviceFeatures.tessellationShader = CreationAttribs.EnabledFeatures.tessellationShader ? VK_TRUE : VK_FALSE;
+ DeviceFeatures.dualSrcBlend = CreationAttribs.EnabledFeatures.dualSrcBlend ? VK_TRUE : VK_FALSE;
+ DeviceFeatures.multiViewport = CreationAttribs.EnabledFeatures.multiViewport ? VK_TRUE : VK_FALSE;
+ DeviceFeatures.imageCubeArray = CreationAttribs.EnabledFeatures.imageCubeArray ? VK_TRUE : VK_FALSE;
+ DeviceFeatures.textureCompressionBC = CreationAttribs.EnabledFeatures.textureCompressionBC ? VK_TRUE : VK_FALSE;
+ DeviceFeatures.vertexPipelineStoresAndAtomics = CreationAttribs.EnabledFeatures.vertexPipelineStoresAndAtomics ? VK_TRUE : VK_FALSE;
+ DeviceFeatures.fragmentStoresAndAtomics = CreationAttribs.EnabledFeatures.fragmentStoresAndAtomics ? VK_TRUE : VK_FALSE;
DeviceCreateInfo.pEnabledFeatures = &DeviceFeatures; // NULL or a pointer to a VkPhysicalDeviceFeatures structure that contains
// boolean indicators of all the features to be enabled.