GPUOpen-Effects / FidelityFX-FSR2

FidelityFX Super Resolution 2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Potential Vulkan spec violation

TheJackiMonster opened this issue · comments

Currently I get the following output from the Vulkan validation layer:

VUID-VkPipelineShaderStageCreateInfo-pNext-02755(ERROR / SPEC): msgNum: -2142406189 - Validation Error: [ VUID-VkPipelineShaderStageCreateInfo-pNext-02755 ] Object 0: handle = 0xee4c36000000268e, type = VK_OBJECT_TYPE_SHADER_MODULE; | MessageID = 0x804d79d3 | Stage VK_SHADER_STAGE_COMPUTE_BIT is not in VkPhysicalDeviceSubgroupSizeControlPropertiesEXT::requiredSubgroupSizeStages (Unhandled VkShaderStageFlagBits). The Vulkan spec states: If a VkPipelineShaderStageRequiredSubgroupSizeCreateInfo structure is included in the pNext chain, the subgroupSizeControl feature must be enabled, and stage must be a valid bit specified in requiredSubgroupSizeStages (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-VkPipelineShaderStageCreateInfo-pNext-02755)
    Objects: 1
        [0] 0xee4c36000000268e, type: 15, name: NULL

It seems to be related to the drivers on Linux. RADV and AMDGPU-PRO do not include the VK_SHADER_STAGE_COMPUTE_BIT in the requiredSubgroupSizeStages from VkPhysicalDeviceSubgroupSizeControlPropertiesEXT. That causes a violation regarding the specification when VkPipelineShaderStageRequiredSubgroupSizeCreateInfo gets used creating the compute shader stages for the FSR2 compute pipelines. AMDVLK works fine because requiredSubgroupSizeStages contains the valid bit.

I recommend adding a check for that bits before using that feature or the Vulkan specification needs to address a special case when requiredSubgroupSizeStages is zero (that is currently the case causing the issue).

I've created a commit to apply a fix for the meantime: TheJackiMonster@ec9fcf9

This appears to have been fixed in 2.2.0:

// NOTE: It's important to check requiredSubgroupSizeStages flags (and it's required by the spec).
// As of August 2022, AMD's Vulkan drivers do not support subgroup size selection through Vulkan API
// and this information is reported through requiredSubgroupSizeStages flags.
if (subgroupSizeControlProperties.requiredSubgroupSizeStages & VK_SHADER_STAGE_COMPUTE_BIT)
{
deviceCapabilities->waveLaneCountMin = subgroupSizeControlProperties.minSubgroupSize;
deviceCapabilities->waveLaneCountMax = subgroupSizeControlProperties.maxSubgroupSize;
}