1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-19 05:52:11 +01:00

[dxvk] Enable VK_EXT_shader_demote_to_helper_invocation if available

This commit is contained in:
Philip Rebohle 2019-07-02 20:25:06 +02:00
parent e076b75579
commit b2a53a2413
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
3 changed files with 43 additions and 29 deletions

View File

@ -245,7 +245,7 @@ namespace dxvk {
Rc<DxvkDevice> DxvkAdapter::createDevice(std::string clientApi, DxvkDeviceFeatures enabledFeatures) { Rc<DxvkDevice> DxvkAdapter::createDevice(std::string clientApi, DxvkDeviceFeatures enabledFeatures) {
DxvkDeviceExtensions devExtensions; DxvkDeviceExtensions devExtensions;
std::array<DxvkExt*, 21> devExtensionList = {{ std::array<DxvkExt*, 22> devExtensionList = {{
&devExtensions.amdMemoryOverallocationBehaviour, &devExtensions.amdMemoryOverallocationBehaviour,
&devExtensions.amdShaderFragmentMask, &devExtensions.amdShaderFragmentMask,
&devExtensions.extConditionalRendering, &devExtensions.extConditionalRendering,
@ -253,6 +253,7 @@ namespace dxvk {
&devExtensions.extHostQueryReset, &devExtensions.extHostQueryReset,
&devExtensions.extMemoryBudget, &devExtensions.extMemoryBudget,
&devExtensions.extMemoryPriority, &devExtensions.extMemoryPriority,
&devExtensions.extShaderDemoteToHelperInvocation,
&devExtensions.extShaderViewportIndexLayer, &devExtensions.extShaderViewportIndexLayer,
&devExtensions.extTransformFeedback, &devExtensions.extTransformFeedback,
&devExtensions.extVertexAttributeDivisor, &devExtensions.extVertexAttributeDivisor,
@ -312,6 +313,12 @@ namespace dxvk {
enabledFeatures.core.pNext = &enabledFeatures.extMemoryPriority; enabledFeatures.core.pNext = &enabledFeatures.extMemoryPriority;
} }
if (devExtensions.extShaderDemoteToHelperInvocation) {
enabledFeatures.extShaderDemoteToHelperInvocation.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES_EXT;
enabledFeatures.extShaderDemoteToHelperInvocation.pNext = enabledFeatures.core.pNext;
enabledFeatures.core.pNext = &enabledFeatures.extShaderDemoteToHelperInvocation;
}
if (devExtensions.extTransformFeedback) { if (devExtensions.extTransformFeedback) {
enabledFeatures.extTransformFeedback.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT; enabledFeatures.extTransformFeedback.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT;
enabledFeatures.extTransformFeedback.pNext = enabledFeatures.core.pNext; enabledFeatures.extTransformFeedback.pNext = enabledFeatures.core.pNext;
@ -523,6 +530,11 @@ namespace dxvk {
m_deviceFeatures.extMemoryPriority.pNext = std::exchange(m_deviceFeatures.core.pNext, &m_deviceFeatures.extMemoryPriority); m_deviceFeatures.extMemoryPriority.pNext = std::exchange(m_deviceFeatures.core.pNext, &m_deviceFeatures.extMemoryPriority);
} }
if (m_deviceExtensions.supports(VK_EXT_SHADER_DEMOTE_TO_HELPER_INVOCATION_EXTENSION_NAME)) {
m_deviceFeatures.extShaderDemoteToHelperInvocation.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES_EXT;
m_deviceFeatures.extShaderDemoteToHelperInvocation.pNext = std::exchange(m_deviceFeatures.core.pNext, &m_deviceFeatures.extShaderDemoteToHelperInvocation);
}
if (m_deviceExtensions.supports(VK_EXT_TRANSFORM_FEEDBACK_EXTENSION_NAME)) { if (m_deviceExtensions.supports(VK_EXT_TRANSFORM_FEEDBACK_EXTENSION_NAME)) {
m_deviceFeatures.extTransformFeedback.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT; m_deviceFeatures.extTransformFeedback.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT;
m_deviceFeatures.extTransformFeedback.pNext = std::exchange(m_deviceFeatures.core.pNext, &m_deviceFeatures.extTransformFeedback); m_deviceFeatures.extTransformFeedback.pNext = std::exchange(m_deviceFeatures.core.pNext, &m_deviceFeatures.extTransformFeedback);

View File

@ -35,6 +35,7 @@ namespace dxvk {
VkPhysicalDeviceDepthClipEnableFeaturesEXT extDepthClipEnable; VkPhysicalDeviceDepthClipEnableFeaturesEXT extDepthClipEnable;
VkPhysicalDeviceHostQueryResetFeaturesEXT extHostQueryReset; VkPhysicalDeviceHostQueryResetFeaturesEXT extHostQueryReset;
VkPhysicalDeviceMemoryPriorityFeaturesEXT extMemoryPriority; VkPhysicalDeviceMemoryPriorityFeaturesEXT extMemoryPriority;
VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT extShaderDemoteToHelperInvocation;
VkPhysicalDeviceTransformFeedbackFeaturesEXT extTransformFeedback; VkPhysicalDeviceTransformFeedbackFeaturesEXT extTransformFeedback;
VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT extVertexAttributeDivisor; VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT extVertexAttributeDivisor;
}; };

View File

@ -258,13 +258,14 @@ namespace dxvk {
* used by DXVK if supported by the implementation. * used by DXVK if supported by the implementation.
*/ */
struct DxvkDeviceExtensions { struct DxvkDeviceExtensions {
DxvkExt amdMemoryOverallocationBehaviour= { VK_AMD_MEMORY_OVERALLOCATION_BEHAVIOR_EXTENSION_NAME, DxvkExtMode::Optional }; DxvkExt amdMemoryOverallocationBehaviour = { VK_AMD_MEMORY_OVERALLOCATION_BEHAVIOR_EXTENSION_NAME, DxvkExtMode::Optional };
DxvkExt amdShaderFragmentMask = { VK_AMD_SHADER_FRAGMENT_MASK_EXTENSION_NAME, DxvkExtMode::Optional }; DxvkExt amdShaderFragmentMask = { VK_AMD_SHADER_FRAGMENT_MASK_EXTENSION_NAME, DxvkExtMode::Optional };
DxvkExt extConditionalRendering = { VK_EXT_CONDITIONAL_RENDERING_EXTENSION_NAME, DxvkExtMode::Optional }; DxvkExt extConditionalRendering = { VK_EXT_CONDITIONAL_RENDERING_EXTENSION_NAME, DxvkExtMode::Optional };
DxvkExt extDepthClipEnable = { VK_EXT_DEPTH_CLIP_ENABLE_EXTENSION_NAME, DxvkExtMode::Optional }; DxvkExt extDepthClipEnable = { VK_EXT_DEPTH_CLIP_ENABLE_EXTENSION_NAME, DxvkExtMode::Optional };
DxvkExt extHostQueryReset = { VK_EXT_HOST_QUERY_RESET_EXTENSION_NAME, DxvkExtMode::Optional }; DxvkExt extHostQueryReset = { VK_EXT_HOST_QUERY_RESET_EXTENSION_NAME, DxvkExtMode::Optional };
DxvkExt extMemoryBudget = { VK_EXT_MEMORY_BUDGET_EXTENSION_NAME, DxvkExtMode::Passive }; DxvkExt extMemoryBudget = { VK_EXT_MEMORY_BUDGET_EXTENSION_NAME, DxvkExtMode::Passive };
DxvkExt extMemoryPriority = { VK_EXT_MEMORY_PRIORITY_EXTENSION_NAME, DxvkExtMode::Optional }; DxvkExt extMemoryPriority = { VK_EXT_MEMORY_PRIORITY_EXTENSION_NAME, DxvkExtMode::Optional };
DxvkExt extShaderDemoteToHelperInvocation = { VK_EXT_SHADER_DEMOTE_TO_HELPER_INVOCATION_EXTENSION_NAME, DxvkExtMode::Optional };
DxvkExt extShaderViewportIndexLayer = { VK_EXT_SHADER_VIEWPORT_INDEX_LAYER_EXTENSION_NAME, DxvkExtMode::Optional }; DxvkExt extShaderViewportIndexLayer = { VK_EXT_SHADER_VIEWPORT_INDEX_LAYER_EXTENSION_NAME, DxvkExtMode::Optional };
DxvkExt extTransformFeedback = { VK_EXT_TRANSFORM_FEEDBACK_EXTENSION_NAME, DxvkExtMode::Optional }; DxvkExt extTransformFeedback = { VK_EXT_TRANSFORM_FEEDBACK_EXTENSION_NAME, DxvkExtMode::Optional };
DxvkExt extVertexAttributeDivisor = { VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME, DxvkExtMode::Optional }; DxvkExt extVertexAttributeDivisor = { VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME, DxvkExtMode::Optional };