1 |
commit: a4ca7cc2d9bc8cb0a253e81632b1a034920cf87e |
2 |
Author: Mike Lothian <mike <AT> fireburn <DOT> co <DOT> uk> |
3 |
AuthorDate: Fri Aug 5 12:49:36 2022 +0000 |
4 |
Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Sep 6 16:03:24 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a4ca7cc2 |
7 |
|
8 |
media-libs/mesa: Add support for d3d12 and dozen drivers |
9 |
|
10 |
This adds support for the d3d12 gallium driver and the dozen vulkan |
11 |
driver. It uses the video_cards_microsoft flag |
12 |
|
13 |
It optionally adds in video acceleration if vaapi or vdpau is enabled |
14 |
|
15 |
It's been compiled tested with GCC 12.1 & Clang 14 |
16 |
|
17 |
If building mesa with Clang, directx-headers must be build with clang |
18 |
too, otherwise you'll experience linking errors |
19 |
|
20 |
Closes: https://github.com/gentoo/gentoo/pull/26746 |
21 |
Signed-off-by: Mike Lothain <mike <AT> fireburn.co.uk> |
22 |
Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org> |
23 |
|
24 |
media-libs/mesa/mesa-9999.ebuild | 30 +++++++++++++++++++++--------- |
25 |
profiles/arch/amd64/use.mask | 1 + |
26 |
profiles/arch/base/use.mask | 1 + |
27 |
profiles/arch/x86/use.mask | 1 + |
28 |
profiles/desc/video_cards.desc | 1 + |
29 |
5 files changed, 25 insertions(+), 9 deletions(-) |
30 |
|
31 |
diff --git a/media-libs/mesa/mesa-9999.ebuild b/media-libs/mesa/mesa-9999.ebuild |
32 |
index 379fc0756847..830e5bfd10f3 100644 |
33 |
--- a/media-libs/mesa/mesa-9999.ebuild |
34 |
+++ b/media-libs/mesa/mesa-9999.ebuild |
35 |
@@ -25,7 +25,7 @@ SLOT="0" |
36 |
RESTRICT="!test? ( test )" |
37 |
|
38 |
RADEON_CARDS="r300 r600 radeon radeonsi" |
39 |
-VIDEO_CARDS="${RADEON_CARDS} freedreno intel lima nouveau panfrost v3d vc4 virgl vivante vmware" |
40 |
+VIDEO_CARDS="${RADEON_CARDS} d3d12 freedreno intel lima nouveau panfrost v3d vc4 virgl vivante vmware" |
41 |
for card in ${VIDEO_CARDS}; do |
42 |
IUSE_VIDEO_CARDS+=" video_cards_${card}" |
43 |
done |
44 |
@@ -176,6 +176,7 @@ RDEPEND="${RDEPEND} |
45 |
unset {LLVM,CLANG}_DEPSTR{,_AMDGPU} |
46 |
|
47 |
DEPEND="${RDEPEND} |
48 |
+ video_cards_d3d12? ( dev-util/directx-headers[${MULTILIB_USEDEP}] ) |
49 |
valgrind? ( dev-util/valgrind ) |
50 |
wayland? ( >=dev-libs/wayland-protocols-1.24 ) |
51 |
X? ( |
52 |
@@ -223,11 +224,12 @@ llvm_check_deps() { |
53 |
|
54 |
pkg_pretend() { |
55 |
if use vulkan; then |
56 |
- if ! use video_cards_freedreno && |
57 |
+ if ! use video_cards_d3d12 && |
58 |
+ ! use video_cards_freedreno && |
59 |
! use video_cards_intel && |
60 |
! use video_cards_radeonsi && |
61 |
! use video_cards_v3d; then |
62 |
- ewarn "Ignoring USE=vulkan since VIDEO_CARDS does not contain freedreno, intel, radeonsi, or v3d" |
63 |
+ ewarn "Ignoring USE=vulkan since VIDEO_CARDS does not contain d3d12, freedreno, intel, radeonsi, or v3d" |
64 |
fi |
65 |
fi |
66 |
|
67 |
@@ -239,19 +241,21 @@ pkg_pretend() { |
68 |
fi |
69 |
|
70 |
if use vaapi; then |
71 |
- if ! use video_cards_r600 && |
72 |
+ if ! use video_cards_d3d12 && |
73 |
+ ! use video_cards_r600 && |
74 |
! use video_cards_radeonsi && |
75 |
! use video_cards_nouveau; then |
76 |
- ewarn "Ignoring USE=vaapi since VIDEO_CARDS does not contain r600, radeonsi, or nouveau" |
77 |
+ ewarn "Ignoring USE=vaapi since VIDEO_CARDS does not contain d3d12, r600, radeonsi, or nouveau" |
78 |
fi |
79 |
fi |
80 |
|
81 |
if use vdpau; then |
82 |
- if ! use video_cards_r300 && |
83 |
+ if ! use video_cards_d3d12 && |
84 |
+ ! use video_cards_r300 && |
85 |
! use video_cards_r600 && |
86 |
! use video_cards_radeonsi && |
87 |
! use video_cards_nouveau; then |
88 |
- ewarn "Ignoring USE=vdpau since VIDEO_CARDS does not contain r300, r600, radeonsi, or nouveau" |
89 |
+ ewarn "Ignoring USE=vdpau since VIDEO_CARDS does not contain d3d12, r300, r600, radeonsi, or nouveau" |
90 |
fi |
91 |
fi |
92 |
|
93 |
@@ -329,7 +333,8 @@ multilib_src_configure() { |
94 |
emesonargs+=(-Dgallium-nine=false) |
95 |
fi |
96 |
|
97 |
- if use video_cards_r600 || |
98 |
+ if use video_cards_d3d12 || |
99 |
+ use video_cards_r600 || |
100 |
use video_cards_radeonsi || |
101 |
use video_cards_nouveau; then |
102 |
emesonargs+=($(meson_feature vaapi gallium-va)) |
103 |
@@ -338,7 +343,12 @@ multilib_src_configure() { |
104 |
emesonargs+=(-Dgallium-va=disabled) |
105 |
fi |
106 |
|
107 |
- if use video_cards_r300 || |
108 |
+ if use video_cards_d3d12; then |
109 |
+ emesonargs+=($(meson_feature vaapi gallium-d3d12-video)) |
110 |
+ fi |
111 |
+ |
112 |
+ if use video_cards_d3d12 || |
113 |
+ use video_cards_r300 || |
114 |
use video_cards_r600 || |
115 |
use video_cards_radeonsi || |
116 |
use video_cards_nouveau; then |
117 |
@@ -375,6 +385,7 @@ multilib_src_configure() { |
118 |
gallium_enable video_cards_freedreno freedreno |
119 |
gallium_enable video_cards_intel crocus i915 iris |
120 |
gallium_enable video_cards_lima lima |
121 |
+ gallium_enable video_cards_d3d12 d3d12 |
122 |
gallium_enable video_cards_nouveau nouveau |
123 |
gallium_enable video_cards_panfrost panfrost |
124 |
gallium_enable video_cards_v3d v3d |
125 |
@@ -400,6 +411,7 @@ multilib_src_configure() { |
126 |
if use vulkan; then |
127 |
vulkan_enable video_cards_freedreno freedreno |
128 |
vulkan_enable video_cards_intel intel |
129 |
+ vulkan_enable video_cards_d3d12 microsoft-experimental |
130 |
vulkan_enable video_cards_radeonsi amd |
131 |
vulkan_enable video_cards_v3d broadcom |
132 |
fi |
133 |
|
134 |
diff --git a/profiles/arch/amd64/use.mask b/profiles/arch/amd64/use.mask |
135 |
index 19ac88e44f05..173918986b72 100644 |
136 |
--- a/profiles/arch/amd64/use.mask |
137 |
+++ b/profiles/arch/amd64/use.mask |
138 |
@@ -108,6 +108,7 @@ |
139 |
-input_devices_wacom |
140 |
-video_cards_ast |
141 |
-video_cards_crocus |
142 |
+-video_cards_d3d12 |
143 |
-video_cards_i915 |
144 |
-video_cards_i965 |
145 |
-video_cards_intel |
146 |
|
147 |
diff --git a/profiles/arch/base/use.mask b/profiles/arch/base/use.mask |
148 |
index 499c69aadc54..649d66b60a69 100644 |
149 |
--- a/profiles/arch/base/use.mask |
150 |
+++ b/profiles/arch/base/use.mask |
151 |
@@ -123,6 +123,7 @@ video_cards_geode |
152 |
input_devices_vmmouse |
153 |
video_cards_ast |
154 |
video_cards_crocus |
155 |
+video_cards_d3d12 |
156 |
video_cards_i915 |
157 |
video_cards_i965 |
158 |
video_cards_intel |
159 |
|
160 |
diff --git a/profiles/arch/x86/use.mask b/profiles/arch/x86/use.mask |
161 |
index fefef575af00..f5ed2fdbec2f 100644 |
162 |
--- a/profiles/arch/x86/use.mask |
163 |
+++ b/profiles/arch/x86/use.mask |
164 |
@@ -125,6 +125,7 @@ |
165 |
-input_devices_wacom |
166 |
-video_cards_ast |
167 |
-video_cards_crocus |
168 |
+-video_cards_d3d12 |
169 |
-video_cards_i915 |
170 |
-video_cards_i965 |
171 |
-video_cards_intel |
172 |
|
173 |
diff --git a/profiles/desc/video_cards.desc b/profiles/desc/video_cards.desc |
174 |
index 2b3d795e5b75..34d72812a660 100644 |
175 |
--- a/profiles/desc/video_cards.desc |
176 |
+++ b/profiles/desc/video_cards.desc |
177 |
@@ -7,6 +7,7 @@ |
178 |
|
179 |
amdgpu - VIDEO_CARDS setting to build driver for AMDGPU video cards |
180 |
ast - VIDEO_CARDS setting to build driver for ASpeedTech video cards |
181 |
+d3d12 - VIDEO_CARDS seeting to build driver for Microsoft WSL video cards |
182 |
dummy - VIDEO_CARDS setting to build driver for dummy video cards |
183 |
exynos - VIDEO_CARDS setting to build driver for Samsung Exynos video cards |
184 |
freedreno - VIDEO_CARDS setting to build reverse-engineered driver for Qualcomm Adreno cards |