Correctly enable dp4a support on Vulkan

This commit is contained in:
FakeMichau committed 2026-11-04 18:51:19 +01:00
1 parent 5eb4bfabf3
commit d217b09383
2 files changed
+24 -7

No files matched your search

+8 -6
View File
@@ -519,7 +519,7 @@ static VkResult hkvkCreateInstance(const VkInstanceCreateInfo* pCreateInfo, cons
VulkanSpoofing::hkvkCreateInstance(&localCreateInfo, pAllocator, pInstance);
// FFX and Streamline use Vulkan 1.2 core functions like vkWaitSemaphores. Wine only provides those to 1.2 apps,
// older ones crash calling them, Streamline's own vkCreateInstance raises the version too.
// older ones crash calling them. Streamline's own vkCreateInstance raises the version to 1.3
VkApplicationInfo appInfo { VK_STRUCTURE_TYPE_APPLICATION_INFO };
const auto fgOutput = State::Instance().activeFgOutput;
@@ -528,12 +528,14 @@ static VkResult hkvkCreateInstance(const VkInstanceCreateInfo* pCreateInfo, cons
if (localCreateInfo.pApplicationInfo != nullptr)
appInfo = *localCreateInfo.pApplicationInfo;
if (appInfo.apiVersion < VK_API_VERSION_1_2)
{
LOG_INFO("Raising the API version from {}.{} to 1.2 for FG", VK_API_VERSION_MAJOR(appInfo.apiVersion),
VK_API_VERSION_MINOR(appInfo.apiVersion));
const uint32_t fgApiVersion = fgOutput == FGOutput::DLSSG ? VK_API_VERSION_1_3 : VK_API_VERSION_1_2;
appInfo.apiVersion = VK_API_VERSION_1_2;
if (appInfo.apiVersion < fgApiVersion)
{
LOG_INFO("Raising the API version from {}.{} to 1.{} for FG", VK_API_VERSION_MAJOR(appInfo.apiVersion),
VK_API_VERSION_MINOR(appInfo.apiVersion), VK_API_VERSION_MINOR(fgApiVersion));
appInfo.apiVersion = fgApiVersion;
localCreateInfo.pApplicationInfo = &appInfo;
}
}
+16 -1
View File
@@ -561,6 +561,9 @@ struct VulkanDeviceFeatureState::Impl
VkPhysicalDeviceComputeShaderDerivativesFeaturesKHR computeShaderDerivatives {
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_KHR
};
VkPhysicalDeviceShaderIntegerDotProductFeatures integerDotProduct {
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES
};
Impl(VkDeviceCreateInfo* pCreateInfo, PFN_vkGetPhysicalDeviceFeatures2 getFeatures2)
: pCreateInfo(pCreateInfo), getFeatures2(getFeatures2)
@@ -580,7 +583,7 @@ struct VulkanDeviceFeatureState::Impl
CopyFeatureChain(pCreateInfo->pNext, features2, vulkan12Features, vulkan13Features, shaderFloat16Int8,
storage8Bit, descriptorIndexing, bufferDeviceAddress, vulkanMemoryModel, synchronization2,
subgroupSizeControl, timelineSemaphore, descriptorBuffer, shaderFloat8, cooperativeMatrix,
cooperativeMatrix2, computeShaderDerivatives);
cooperativeMatrix2, computeShaderDerivatives, integerDotProduct);
}
bool CanUpgradeExtBufferDeviceAddress(VkPhysicalDevice physicalDevice)
@@ -769,10 +772,17 @@ struct VulkanDeviceFeatureState::Impl
EnableExistingFeature(modifiedFeatures, features, vulkan13Features,
&VkPhysicalDeviceVulkan13Features::computeFullSubgroups,
supported.computeFullSubgroups);
EnableExistingFeature(modifiedFeatures, features, vulkan13Features,
&VkPhysicalDeviceVulkan13Features::shaderIntegerDotProduct,
supported.shaderIntegerDotProduct);
return;
}
EnableSupportedFeature(pCreateInfo, modifiedFeatures, integerDotProduct,
&VkPhysicalDeviceShaderIntegerDotProductFeatures::shaderIntegerDotProduct,
supported.shaderIntegerDotProduct);
EnableSupportedFeature(pCreateInfo, modifiedFeatures, synchronization2,
&VkPhysicalDeviceSynchronization2Features::synchronization2,
supported.synchronization2);
@@ -793,6 +803,11 @@ struct VulkanDeviceFeatureState::Impl
EnableFeatureStruct(pCreateInfo, getFeatures2, physicalDevice, modifiedFeatures, subgroupSizeControl,
&VkPhysicalDeviceSubgroupSizeControlFeatures::subgroupSizeControl,
&VkPhysicalDeviceSubgroupSizeControlFeatures::computeFullSubgroups);
// Added for XeSS, its DP4a path and DLSSG replacements running D3D12 on Vulkan use it
if (HasExtension(pCreateInfo, VK_KHR_SHADER_INTEGER_DOT_PRODUCT_EXTENSION_NAME))
EnableFeatureStruct(pCreateInfo, getFeatures2, physicalDevice, modifiedFeatures, integerDotProduct,
&VkPhysicalDeviceShaderIntegerDotProductFeatures::shaderIntegerDotProduct);
}
void EnableVulkan14Features(VkPhysicalDevice physicalDevice)