Mesa (staging/20.1): spirv,radv,anv: implement no-op VK_GOOGLE_user_type
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Sun May 31 23:07:48 UTC 2020
Module: Mesa
Branch: staging/20.1
Commit: 71958ffaa0173c38d485dc9a4e6f00a957610413
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=71958ffaa0173c38d485dc9a4e6f00a957610413
Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date: Thu May 28 10:21:27 2020 +0200
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 at lists.freedesktop.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Tested-by: Edmondo Tommasina <edmondo.tommasina at gmail.com>
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5237>
(cherry picked from commit 10c4a7cf59733ae2058a76b880ea0767a59dad4f)
---
.pick_status.json | 2 +-
src/amd/vulkan/radv_extensions.py | 1 +
src/compiler/spirv/spirv_to_nir.c | 5 +++++
src/compiler/spirv/vtn_variables.c | 1 +
src/intel/vulkan/anv_extensions.py | 1 +
5 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/.pick_status.json b/.pick_status.json
index 36e881526b4..34913dd1ba4 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -814,7 +814,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/src/amd/vulkan/radv_extensions.py b/src/amd/vulkan/radv_extensions.py
index 032fd8e567f..587994a28b9 100644
--- a/src/amd/vulkan/radv_extensions.py
+++ b/src/amd/vulkan/radv_extensions.py
@@ -195,6 +195,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, True),
]
diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c
index 2ea51707734..e6f49ed87a8 100644
--- a/src/compiler/spirv/spirv_to_nir.c
+++ b/src/compiler/spirv/spirv_to_nir.c
@@ -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);
}
diff --git a/src/compiler/spirv/vtn_variables.c b/src/compiler/spirv/vtn_variables.c
index 9a6ddc2db1e..00743d6552c 100644
--- a/src/compiler/spirv/vtn_variables.c
+++ b/src/compiler/spirv/vtn_variables.c
@@ -1652,6 +1652,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 4760b984d35..b88f01088b8 100644
--- a/src/intel/vulkan/anv_extensions.py
+++ b/src/intel/vulkan/anv_extensions.py
@@ -173,6 +173,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),
More information about the mesa-commit
mailing list