spirv,radv,anv: implement no-op VK_GOOGLE_user_type
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 28 May 2020 08:21:27 +0000 (10:21 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 28 May 2020 15:30:24 +0000 (17:30 +0200)
This extension only allows HLSL shader compilers to optionally embed
unambiguous type information which can be safely ignored by the driver.

This fixes a crash with the recent Vulkan backend of Path Of Exile
(it uses the extension without checking if it's supported).

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Tested-by: Edmondo Tommasina <edmondo.tommasina@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5237>

docs/relnotes/new_features.txt
src/amd/vulkan/radv_extensions.py
src/compiler/spirv/spirv_to_nir.c
src/compiler/spirv/vtn_variables.c
src/intel/vulkan/anv_extensions.py

index 91b0a8d1b66c2f58d33c182fa35a73b9dcf673b9..41557a4ac1e908c54592f120eef2b9876f83d7cf 100644 (file)
@@ -3,3 +3,4 @@ VK_AMD_texture_gather_bias_lod on RADV.
 VK_EXT_private_data on ANV and RADV.
 VK_EXT_custom_border_color on RADV.
 VK_EXT_pipeline_creation_cache_control on RADV.
+VK_GOOGLE_user_type on ANV and RADV.
index 91c733f02ce2d27b3ce365846504c8cc6b1f4777..79ea1865403bb697dd8838890fee5505cba943ef 100644 (file)
@@ -182,6 +182,7 @@ EXTENSIONS = [
     Extension('VK_AMD_texture_gather_bias_lod',           1, True),
     Extension('VK_GOOGLE_decorate_string',                1, True),
     Extension('VK_GOOGLE_hlsl_functionality1',            1, True),
+    Extension('VK_GOOGLE_user_type',                      1, True),
     Extension('VK_NV_compute_shader_derivatives',         1, True),
 ]
 
index aef1ecdbd003ba17f92d65d372e34f8104e52c70..425fbcbbe72092fcee454c47a3be803d2c58e19e 100644 (file)
@@ -859,6 +859,7 @@ struct_member_decoration_cb(struct vtn_builder *b,
       break;
 
    case SpvDecorationUserSemantic:
+   case SpvDecorationUserTypeGOOGLE:
       /* User semantic decorations can safely be ignored by the driver. */
       break;
 
@@ -1040,6 +1041,10 @@ type_decoration_cb(struct vtn_builder *b,
                spirv_decoration_to_string(dec->decoration));
       break;
 
+   case SpvDecorationUserTypeGOOGLE:
+      /* User semantic decorations can safely be ignored by the driver. */
+      break;
+
    default:
       vtn_fail_with_decoration("Unhandled decoration", dec->decoration);
    }
index 318df77669f6f34f0107aaba4a9282a537d05536..afe2aa89bbf22325802838a2f0135a2b2947176b 100644 (file)
@@ -1677,6 +1677,7 @@ apply_var_decoration(struct vtn_builder *b,
       break;
 
    case SpvDecorationUserSemantic:
+   case SpvDecorationUserTypeGOOGLE:
       /* User semantic decorations can safely be ignored by the driver. */
       break;
 
index 251ca0f3495b089bd72b57626371fd77b7de24fa..82bdee9b90e464718c8d5553919dfe74df034949 100644 (file)
@@ -161,6 +161,7 @@ EXTENSIONS = [
     Extension('VK_ANDROID_native_buffer',                 7, 'ANDROID'),
     Extension('VK_GOOGLE_decorate_string',                1, True),
     Extension('VK_GOOGLE_hlsl_functionality1',            1, True),
+    Extension('VK_GOOGLE_user_type',                      1, True),
     Extension('VK_INTEL_performance_query',               1, 'device->perf && device->perf->i915_perf_version >= 3'),
     Extension('VK_INTEL_shader_integer_functions2',       1, 'device->info.gen >= 8'),
     Extension('VK_NV_compute_shader_derivatives',         1, True),