ValveSoftware / SteamVR-for-Linux

Issue tracker for the Linux port of SteamVR
929 stars 45 forks source link

[BUG] "SPIR-V module not valid" Vulkan Validation warnings #322

Open ChristophHaag opened 4 years ago

ChristophHaag commented 4 years ago

When running a Vulkan OpenVR application with VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, several of SteamVR's shaders cause validation warnings.

Using vulkan-validation-layers 1.2.133

[...]
shaders/vulkan/distort_geom_multitap_ps.spv
UNASSIGNED-CoreValidation-Shader-InconsistentSpirv(ERROR / SPEC): msgNum: 0 - SPIR-V module not valid: Header block 512[%512] is contained in the loop construct headed by 505[%505], but its merge block 513[%513] is not
  %512 = OpLabel

    Objects: 1
        [0] 0x562ccca86c60, type: 3, name: NULL
shaders/vulkan/distort_geom_reflect_ps.spv
shaders/vulkan/distort_geom_reflect_multitap_ps.spv
UNASSIGNED-CoreValidation-Shader-InconsistentSpirv(ERROR / SPEC): msgNum: 0 - SPIR-V module not valid: Header block 666[%666] is contained in the loop construct headed by 659[%659], but its merge block 667[%667] is not
  %666 = OpLabel

    Objects: 1
        [0] 0x562ccca86c60, type: 3, name: NULL
[...]
shaders/vulkan/downsample_filter_x_ps.spv
UNASSIGNED-CoreValidation-Shader-InconsistentSpirv(ERROR / SPEC): msgNum: 0 - SPIR-V module not valid: Header block 355[%355] is contained in the loop construct headed by 294[%294], but its merge block 356[%356] is not
  %355 = OpLabel

    Objects: 1
        [0] 0x562ccca86c60, type: 3, name: NULL
shaders/vulkan/downsample_filter_x_srgb_ps.spv
UNASSIGNED-CoreValidation-Shader-InconsistentSpirv(ERROR / SPEC): msgNum: 0 - SPIR-V module not valid: Header block 428[%428] is contained in the loop construct headed by 360[%360], but its merge block 429[%429] is not
  %428 = OpLabel

    Objects: 1
        [0] 0x562ccca86c60, type: 3, name: NULL
shaders/vulkan/downsample_filter_y_ps.spv
UNASSIGNED-CoreValidation-Shader-InconsistentSpirv(ERROR / SPEC): msgNum: 0 - SPIR-V module not valid: Header block 355[%355] is contained in the loop construct headed by 294[%294], but its merge block 356[%356] is not
  %355 = OpLabel

    Objects: 1
        [0] 0x562ccca86c60, type: 3, name: NULL
shaders/vulkan/downsample_filter_y_srgb_ps.spv
UNASSIGNED-CoreValidation-Shader-InconsistentSpirv(ERROR / SPEC): msgNum: 0 - SPIR-V module not valid: Header block 428[%428] is contained in the loop construct headed by 360[%360], but its merge block 429[%429] is not
  %428 = OpLabel

    Objects: 1
        [0] 0x562ccca86c60, type: 3, name: NULL
[...]
shaders/vulkan/tracked_camera_edgefilter_ps.spv
UNASSIGNED-CoreValidation-Shader-InconsistentSpirv(ERROR / SPEC): msgNum: 0 - SPIR-V module not valid: Header block 192[%192] is contained in the loop construct headed by 185[%185], but its merge block 193[%193] is not
  %192 = OpLabel

    Objects: 1
        [0] 0x562ccca86c60, type: 3, name: NULL
[...]
shaders/vulkan/motion_filter_attenuation_ps.spv
UNASSIGNED-CoreValidation-Shader-InconsistentSpirv(ERROR / SPEC): msgNum: 0 - SPIR-V module not valid: Header block 365[%365] is contained in the loop construct headed by 354[%354], but its merge block 366[%366] is not
  %365 = OpLabel

    Objects: 1
        [0] 0x562ccca86c60, type: 3, name: NULL
shaders/vulkan/motion_filter_median_ps.spv
UNASSIGNED-CoreValidation-Shader-InconsistentSpirv(ERROR / SPEC): msgNum: 0 - SPIR-V module not valid: Header block 2334[%2334] is contained in the loop construct headed by 2327[%2327], but its merge block 2335[%2335] is not
  %2334 = OpLabel

    Objects: 1
        [0] 0x562ccca86c60, type: 3, name: NULL
shaders/vulkan/motion_filter_cost_ps.spv
UNASSIGNED-CoreValidation-Shader-InconsistentSpirv(ERROR / SPEC): msgNum: 0 - SPIR-V module not valid: Header block 425[%425] is contained in the loop construct headed by 414[%414], but its merge block 426[%426] is not
  %425 = OpLabel

    Objects: 1
        [0] 0x562ccca86c60, type: 3, name: NULL
shaders/vulkan/motion_filter_blur_ps.spv
UNASSIGNED-CoreValidation-Shader-InconsistentSpirv(ERROR / SPEC): msgNum: 0 - SPIR-V module not valid: Header block 244[%244] is contained in the loop construct headed by 233[%233], but its merge block 245[%245] is not
  %244 = OpLabel

    Objects: 1
        [0] 0x562ccca86c60, type: 3, name: NULL
[...]
shaders/vulkan/unlit_motion_attenuation_ps.spv
UNASSIGNED-CoreValidation-Shader-InconsistentSpirv(ERROR / SPEC): msgNum: 0 - SPIR-V module not valid: Header block 197[%197] is contained in the loop construct headed by 186[%186], but its merge block 198[%198] is not
  %197 = OpLabel

    Objects: 1
        [0] 0x562ccca86c60, type: 3, name: NULL
shaders/vulkan/distort_cs.spv
UNASSIGNED-CoreValidation-Shader-InconsistentSpirv(ERROR / SPEC): msgNum: 0 - SPIR-V module not valid: Header block 960[%960] is contained in the loop construct headed by 922[%922], but its merge block 961[%961] is not
  %960 = OpLabel

    Objects: 1
        [0] 0x562ccca86c60, type: 3, name: NULL
shaders/vulkan/distort_cs_mc.spv
UNASSIGNED-CoreValidation-Shader-InconsistentSpirv(ERROR / SPEC): msgNum: 0 - SPIR-V module not valid: Header block 1125[%1125] is contained in the loop construct headed by 1087[%1087], but its merge block 1126[%1126] is not
  %1125 = OpLabel

    Objects: 1
        [0] 0x562ccca86c60, type: 3, name: NULL
[...]
shaders/vulkan/testgrid_cs.spv
UNASSIGNED-CoreValidation-Shader-InconsistentSpirv(ERROR / SPEC): msgNum: 0 - SPIR-V module not valid: Header block 308[%308] is contained in the loop construct headed by 294[%294], but its merge block 309[%309] is not
  %308 = OpLabel

    Objects: 1
        [0] 0x562ccca86c60, type: 3, name: NULL
ChristophHaag commented 4 years ago

To avoid these messages, only shader validation can be disabled in vk_layer_settings.txt

khronos_validation.disables = VK_VALIDATION_FEATURE_DISABLE_SHADERS_EXT

It would still be nice to have this fixed in SteamVR itself though.