summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>2020-05-28 10:21:27 +0200
committerDylan Baker <dylan.c.baker@intel.com>2020-06-01 14:52:25 -0700
commit434d2dc427c99d3fba2167f26d7beef5b1fce419 (patch)
tree0e10e8f1bf136269132645856476bb3db4c9c116
parent5618984b679417507fa29d9a95ee16444688500a (diff)
spirv,radv,anv: implement no-op VK_GOOGLE_user_type
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> (cherry picked from commit 10c4a7cf59733ae2058a76b880ea0767a59dad4f)
-rw-r--r--.pick_status.json2
-rw-r--r--docs/relnotes/new_features.txt1
-rw-r--r--src/amd/vulkan/radv_extensions.py1
-rw-r--r--src/compiler/spirv/spirv_to_nir.c5
-rw-r--r--src/compiler/spirv/vtn_variables.c1
-rw-r--r--src/intel/vulkan/anv_extensions.py1
6 files changed, 10 insertions, 1 deletions
diff --git a/.pick_status.json b/.pick_status.json
index 5a3b202e5ee..2cf53e12c26 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -1102,7 +1102,7 @@
"description": "spirv,radv,anv: implement no-op VK_GOOGLE_user_type",
"nominated": true,
"nomination_type": 0,
- "resolution": 0,
+ "resolution": 1,
"master_sha": null,
"because_sha": null
},
diff --git a/docs/relnotes/new_features.txt b/docs/relnotes/new_features.txt
index e69de29bb2d..b4e9a354bf7 100644
--- a/docs/relnotes/new_features.txt
+++ b/docs/relnotes/new_features.txt
@@ -0,0 +1 @@
+VK_GOOGLE_user_type on ANV and RADV.
diff --git a/src/amd/vulkan/radv_extensions.py b/src/amd/vulkan/radv_extensions.py
index d29c0e0009c..b92a8f6831c 100644
--- a/src/amd/vulkan/radv_extensions.py
+++ b/src/amd/vulkan/radv_extensions.py
@@ -166,6 +166,7 @@ EXTENSIONS = [
Extension('VK_AMD_shader_trinary_minmax', 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, 'device->rad_info.chip_class >= GFX8'),
]
diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c
index 0ec5d6e0d17..1da42d08c93 100644
--- a/src/compiler/spirv/spirv_to_nir.c
+++ b/src/compiler/spirv/spirv_to_nir.c
@@ -866,6 +866,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;
@@ -1047,6 +1048,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);
}
diff --git a/src/compiler/spirv/vtn_variables.c b/src/compiler/spirv/vtn_variables.c
index 42f98eb49c5..5b59afea79f 100644
--- a/src/compiler/spirv/vtn_variables.c
+++ b/src/compiler/spirv/vtn_variables.c
@@ -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;
diff --git a/src/intel/vulkan/anv_extensions.py b/src/intel/vulkan/anv_extensions.py
index de643ea1fec..43e3038fe33 100644
--- a/src/intel/vulkan/anv_extensions.py
+++ b/src/intel/vulkan/anv_extensions.py
@@ -171,6 +171,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),