1 |
commit: 7db7d4664334929e601561afe237980895811877 |
2 |
Author: Matthew Smith <matthew <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Feb 21 07:26:52 2022 +0000 |
4 |
Commit: Matthew Smith <matthew <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Feb 21 07:26:52 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7db7d466 |
7 |
|
8 |
media-gfx/renderdoc: backport feature test patch |
9 |
|
10 |
Signed-off-by: Matthew Smith <matthew <AT> gentoo.org> |
11 |
|
12 |
.../files/renderdoc-1.18-check-api-ver.patch | 50 ++++++++++++++++++++++ |
13 |
...derdoc-1.18.ebuild => renderdoc-1.18-r1.ebuild} | 4 ++ |
14 |
2 files changed, 54 insertions(+) |
15 |
|
16 |
diff --git a/media-gfx/renderdoc/files/renderdoc-1.18-check-api-ver.patch b/media-gfx/renderdoc/files/renderdoc-1.18-check-api-ver.patch |
17 |
new file mode 100644 |
18 |
index 000000000000..a6af5645d14b |
19 |
--- /dev/null |
20 |
+++ b/media-gfx/renderdoc/files/renderdoc-1.18-check-api-ver.patch |
21 |
@@ -0,0 +1,50 @@ |
22 |
+From 3d49524da4a28ecc1ee1a9b3f9ec455fc0263c81 Mon Sep 17 00:00:00 2001 |
23 |
+From: baldurk <baldurk@×××××××.org> |
24 |
+Date: Mon, 31 Jan 2022 19:28:08 +0000 |
25 |
+Subject: [PATCH] Don't enable functionality not supported by the current |
26 |
+ physical device |
27 |
+ |
28 |
+--- |
29 |
+ .../driver/vulkan/wrappers/vk_device_funcs.cpp | 14 ++++++++------ |
30 |
+ 1 file changed, 8 insertions(+), 6 deletions(-) |
31 |
+ |
32 |
+diff --git a/renderdoc/driver/vulkan/wrappers/vk_device_funcs.cpp b/renderdoc/driver/vulkan/wrappers/vk_device_funcs.cpp |
33 |
+index 4d342e0123..a40c52d6ef 100644 |
34 |
+--- a/renderdoc/driver/vulkan/wrappers/vk_device_funcs.cpp |
35 |
++++ b/renderdoc/driver/vulkan/wrappers/vk_device_funcs.cpp |
36 |
+@@ -3171,7 +3171,7 @@ bool WrappedVulkan::Serialise_vkCreateDevice(SerialiserType &ser, VkPhysicalDevi |
37 |
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_KHR, |
38 |
+ }; |
39 |
+ |
40 |
+- if(physProps.apiVersion >= VK_MAKE_VERSION(1, 2, 0)) |
41 |
++ if(RDCMIN(m_EnabledExtensions.vulkanVersion, physProps.apiVersion) >= VK_MAKE_VERSION(1, 2, 0)) |
42 |
+ { |
43 |
+ VkPhysicalDeviceVulkan12Features avail12Features = { |
44 |
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES, |
45 |
+@@ -3376,11 +3376,13 @@ bool WrappedVulkan::Serialise_vkCreateDevice(SerialiserType &ser, VkPhysicalDevi |
46 |
+ |
47 |
+ CheckDeviceExts(); |
48 |
+ |
49 |
++ uint32_t effectiveApiVersion = RDCMIN(m_EnabledExtensions.vulkanVersion, physProps.apiVersion); |
50 |
++ |
51 |
+ #undef CheckExt |
52 |
+-#define CheckExt(name, ver) \ |
53 |
+- if(!strcmp(createInfo.ppEnabledExtensionNames[i], "VK_" #name) || physProps.apiVersion >= ver) \ |
54 |
+- { \ |
55 |
+- m_EnabledExtensions.ext_##name = true; \ |
56 |
++#define CheckExt(name, ver) \ |
57 |
++ if(!strcmp(createInfo.ppEnabledExtensionNames[i], "VK_" #name) || effectiveApiVersion >= ver) \ |
58 |
++ { \ |
59 |
++ m_EnabledExtensions.ext_##name = true; \ |
60 |
+ } |
61 |
+ |
62 |
+ for(uint32_t i = 0; i < createInfo.enabledExtensionCount; i++) |
63 |
+@@ -3391,7 +3393,7 @@ bool WrappedVulkan::Serialise_vkCreateDevice(SerialiserType &ser, VkPhysicalDevi |
64 |
+ // for cases where a promoted extension isn't supported as the extension itself, manually |
65 |
+ // disable them when the feature bit is false. |
66 |
+ |
67 |
+- if(physProps.apiVersion >= VK_MAKE_VERSION(1, 2, 0)) |
68 |
++ if(effectiveApiVersion >= VK_MAKE_VERSION(1, 2, 0)) |
69 |
+ { |
70 |
+ if(supportedExtensions.find(VK_KHR_BUFFER_DEVICE_ADDRESS_EXTENSION_NAME) == |
71 |
+ supportedExtensions.end() && |
72 |
|
73 |
diff --git a/media-gfx/renderdoc/renderdoc-1.18.ebuild b/media-gfx/renderdoc/renderdoc-1.18-r1.ebuild |
74 |
similarity index 96% |
75 |
rename from media-gfx/renderdoc/renderdoc-1.18.ebuild |
76 |
rename to media-gfx/renderdoc/renderdoc-1.18-r1.ebuild |
77 |
index 38a71320c453..aca43a4ec9e9 100644 |
78 |
--- a/media-gfx/renderdoc/renderdoc-1.18.ebuild |
79 |
+++ b/media-gfx/renderdoc/renderdoc-1.18-r1.ebuild |
80 |
@@ -99,6 +99,10 @@ PATCHES=( |
81 |
|
82 |
"${FILESDIR}"/${PN}-1.18-system-glslang.patch |
83 |
"${FILESDIR}"/${PN}-1.18-system-compress.patch |
84 |
+ |
85 |
+ # Check physical device API version and supported extensions. Fixes |
86 |
+ # segfault on some GPU/driver combinations. Will be in release 1.19 |
87 |
+ "${FILESDIR}"/${PN}-1.18-check-api-ver.patch |
88 |
) |
89 |
|
90 |
DOCS=( util/LINUX_DIST_README ) |