Skip to content

Commit

Permalink
[dxvk] Enable VK_KHR_shader_float_controls if supported
Browse files Browse the repository at this point in the history
  • Loading branch information
doitsujin committed Jan 28, 2021
1 parent 7d7c057 commit 849fb32
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/dxvk/dxvk_adapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ namespace dxvk {
DxvkDeviceFeatures enabledFeatures) {
DxvkDeviceExtensions devExtensions;

std::array<DxvkExt*, 23> devExtensionList = {{
std::array<DxvkExt*, 24> devExtensionList = {{
&devExtensions.amdMemoryOverallocationBehaviour,
&devExtensions.amdShaderFragmentMask,
&devExtensions.ext4444Formats,
Expand All @@ -286,6 +286,7 @@ namespace dxvk {
&devExtensions.khrDriverProperties,
&devExtensions.khrImageFormatList,
&devExtensions.khrSamplerMirrorClampToEdge,
&devExtensions.khrShaderFloatControls,
&devExtensions.khrSwapchain,
}};

Expand Down Expand Up @@ -550,6 +551,11 @@ namespace dxvk {
m_deviceInfo.khrDeviceDriverProperties.pNext = std::exchange(m_deviceInfo.core.pNext, &m_deviceInfo.khrDeviceDriverProperties);
}

if (m_deviceExtensions.supports(VK_KHR_SHADER_FLOAT_CONTROLS_EXTENSION_NAME)) {
m_deviceInfo.khrShaderFloatControls.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES_KHR;
m_deviceInfo.khrShaderFloatControls.pNext = std::exchange(m_deviceInfo.core.pNext, &m_deviceInfo.khrShaderFloatControls);
}

// Query full device properties for all enabled extensions
m_vki->vkGetPhysicalDeviceProperties2(m_handle, &m_deviceInfo.core);

Expand Down
1 change: 1 addition & 0 deletions src/dxvk/dxvk_device_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ namespace dxvk {
VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT extVertexAttributeDivisor;
VkPhysicalDeviceDepthStencilResolvePropertiesKHR khrDepthStencilResolve;
VkPhysicalDeviceDriverPropertiesKHR khrDeviceDriverProperties;
VkPhysicalDeviceFloatControlsPropertiesKHR khrShaderFloatControls;
};


Expand Down
1 change: 1 addition & 0 deletions src/dxvk/dxvk_extensions.h
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ namespace dxvk {
DxvkExt khrDriverProperties = { VK_KHR_DRIVER_PROPERTIES_EXTENSION_NAME, DxvkExtMode::Optional };
DxvkExt khrImageFormatList = { VK_KHR_IMAGE_FORMAT_LIST_EXTENSION_NAME, DxvkExtMode::Required };
DxvkExt khrSamplerMirrorClampToEdge = { VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_EXTENSION_NAME, DxvkExtMode::Optional };
DxvkExt khrShaderFloatControls = { VK_KHR_SHADER_FLOAT_CONTROLS_EXTENSION_NAME, DxvkExtMode::Optional };
DxvkExt khrSwapchain = { VK_KHR_SWAPCHAIN_EXTENSION_NAME, DxvkExtMode::Required };
};

Expand Down

0 comments on commit 849fb32

Please sign in to comment.