VirtualBox

source: vbox/trunk/src/libs/dxvk-2.3.1/Makefile.kmk@ 107044

Last change on this file since 107044 was 106061, checked in by vboxsync, 2 months ago

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 13.7 KB
Line 
1# $Id: Makefile.kmk 106061 2024-09-16 14:03:52Z vboxsync $
2## @file
3# Sub-Makefile for the dxvk-native library.
4#
5
6#
7# Copyright (C) 2022-2024 Oracle and/or its affiliates.
8#
9# This file is part of VirtualBox base platform packages, as
10# available from https://www.virtualbox.org.
11#
12# This program is free software; you can redistribute it and/or
13# modify it under the terms of the GNU General Public License
14# as published by the Free Software Foundation, in version 3 of the
15# License.
16#
17# This program is distributed in the hope that it will be useful, but
18# WITHOUT ANY WARRANTY; without even the implied warranty of
19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20# General Public License for more details.
21#
22# You should have received a copy of the GNU General Public License
23# along with this program; if not, see <https://www.gnu.org/licenses>.
24#
25# SPDX-License-Identifier: GPL-3.0-only
26#
27
28SUB_DEPTH = ../../..
29include $(KBUILD_PATH)/subheader.kmk
30
31#
32# Targets.
33#
34LIBRARIES += VBox-DxVkNativeUtil VBox-DxVkNativeDxVk VBox-DxVkNativeD3D11
35DLLS += VBoxDxVk
36
37#
38# Globals.
39#
40VBOX_PATH_DXVK := $(PATH_SUB_CURRENT)
41
42# The HLSL to Spir-V shader compiler
43VBOX_GLSLANGVALIDATOR_PATH ?= $(lastword $(sort $(wildcard $(KBUILD_DEVTOOLS_TRG)/glslang/v11*)))
44ifeq ($(VBOX_GLSLANGVALIDATOR_PATH),)
45 VBOX_GLSLANGVALIDATOR ?= glslangValidator$(HOSTSUFF_EXE)
46else
47 VBOX_GLSLANGVALIDATOR ?= $(VBOX_GLSLANGVALIDATOR_PATH)/glslangValidator$(HOSTSUFF_EXE)
48endif
49
50#
51# Some stuff for compiling shares into header files and making the target depend on these.
52#
53
54## Internal.
55## @param 1 full path to shader source.
56define def_VBoxDxVkCompileShader
57 $(1)/shaders/$(basename $(notdir $(2))).h: $(2) | $$$$(dir $$$$@)
58 $(VBOX_GLSLANGVALIDATOR) -V --vn "$(basename $(notdir $(2)))" "$$<" -o "$$@"
59endef
60
61## Process the VBOX_SHADERS for a target.
62## @param 1 target name
63define def_VBoxDxVkCompilerShaders
64 $$(call KB_FN_DO_PASS0_ON_TARGET,$(1))
65 $(1)_INCS += $$($(1)_0_OUTDIR)/shaders
66 $(1)_BLDDIRS += $$($(1)_0_OUTDIR)/shaders
67 $(1)_INTERMEDIATES := $$(foreach shader,$$($(1)_VBOX_SHADERS) \
68 ,$$($(1)_0_OUTDIR)/shaders/$$(basename $$(notdir $$(shader))).h)
69 $$(foreach shader,$$($(1)_VBOX_SHADERS),$$(evalcall2 def_VBoxDxVkCompileShader,$$($(1)_0_OUTDIR),$$(shader)))
70endef
71
72
73#
74# DXK utilities static library
75#
76VBox-DxVkNativeUtil_TEMPLATE = VBoxR3DllNonPedantic
77VBox-DxVkNativeUtil_DEFS = \
78 DXVK_NATIVE \
79 NOMINMAX \
80 _WIN32_WINNT=0xa00
81VBox-DxVkNativeUtil_DEFS += \
82 DXVK_PLATFORM_LINUX \
83 DXVK_WSI_HEADLESS
84VBox-DxVkNativeUtil_CXXFLAGS.linux += \
85 -std=c++17 -Wno-deprecated-declarations # The latter is for std::iterator in util_bit.h.
86VBox-DxVkNativeUtil_CXXFLAGS.darwin += \
87 -std=c++17
88VBox-DxVkNativeUtil_INCS = \
89 $(VBOX_PATH_DXVK) \
90 $(VBOX_PATH_DXVK)/include/ \
91 $(VBOX_PATH_DXVK)/src/util/ \
92 $(VBOX_PATH_DXVK)/include/vulkan/include \
93 $(VBOX_PATH_DXVK)/include/spirv/include \
94 $(VBOX_PATH_DXVK)/include/native/ \
95 $(VBOX_PATH_DXVK)/include/native/windows \
96 $(VBOX_PATH_DXVK)/include/native/directx
97VBox-DxVkNativeUtil_SOURCES = \
98 src/util/util_env.cpp \
99 src/util/util_string.cpp \
100 src/util/util_fps_limiter.cpp \
101 src/util/util_flush.cpp \
102 src/util/util_gdi.cpp \
103 src/util/util_luid.cpp \
104 src/util/util_matrix.cpp \
105 src/util/util_shared_res.cpp \
106 src/util/util_sleep.cpp \
107 src/util/thread.cpp \
108 src/util/com/com_guid.cpp \
109 src/util/com/com_private_data.cpp \
110 src/util/config/config.cpp \
111 src/util/log/log.cpp \
112 src/util/log/log_debug.cpp \
113 src/util/sha1/sha1.c \
114 src/util/sha1/sha1_util.cpp \
115 src/util/sync/sync_recursive.cpp \
116 src/spirv/spirv_code_buffer.cpp \
117 src/spirv/spirv_compression.cpp \
118 src/spirv/spirv_module.cpp \
119 src/vulkan/vulkan_loader.cpp \
120 src/vulkan/vulkan_names.cpp \
121 src/dxgi/dxgi_adapter.cpp \
122 src/dxgi/dxgi_enums.cpp \
123 src/dxgi/dxgi_factory.cpp \
124 src/dxgi/dxgi_format.cpp \
125 src/dxgi/dxgi_main.cpp \
126 src/dxgi/dxgi_monitor.cpp \
127 src/dxgi/dxgi_options.cpp \
128 src/dxgi/dxgi_output.cpp \
129 src/dxgi/dxgi_surface.cpp \
130 src/dxgi/dxgi_swapchain.cpp \
131 src/dxbc/dxbc_analysis.cpp \
132 src/dxbc/dxbc_chunk_isgn.cpp \
133 src/dxbc/dxbc_chunk_shex.cpp \
134 src/dxbc/dxbc_common.cpp \
135 src/dxbc/dxbc_compiler.cpp \
136 src/dxbc/dxbc_decoder.cpp \
137 src/dxbc/dxbc_defs.cpp \
138 src/dxbc/dxbc_header.cpp \
139 src/dxbc/dxbc_module.cpp \
140 src/dxbc/dxbc_names.cpp \
141 src/dxbc/dxbc_options.cpp \
142 src/dxbc/dxbc_reader.cpp \
143 src/dxbc/dxbc_util.cpp \
144 src/dxso/dxso_analysis.cpp \
145 src/dxso/dxso_code.cpp \
146 src/dxso/dxso_common.cpp \
147 src/dxso/dxso_compiler.cpp \
148 src/dxso/dxso_ctab.cpp \
149 src/dxso/dxso_decoder.cpp \
150 src/dxso/dxso_enums.cpp \
151 src/dxso/dxso_header.cpp \
152 src/dxso/dxso_module.cpp \
153 src/dxso/dxso_options.cpp \
154 src/dxso/dxso_reader.cpp \
155 src/dxso/dxso_tables.cpp \
156 src/dxso/dxso_util.cpp \
157 src/wsi/wsi_edid.cpp \
158 src/wsi/headless/wsi_monitor_headless.cpp \
159 src/wsi/headless/wsi_window_headless.cpp
160
161#
162# Core DXVK library.
163#
164VBox-DxVkNativeDxVk_TEMPLATE = VBoxR3DllNonPedantic
165VBox-DxVkNativeDxVk_DEFS = \
166 DXVK_NATIVE \
167 NOMINMAX \
168 _WIN32_WINNT=0xa00
169VBox-DxVkNativeDxVk_DEFS += \
170 DXVK_PLATFORM_LINUX \
171 DXVK_WSI_HEADLESS
172VBox-DxVkNativeDxVk_CXXFLAGS.linux += \
173 -std=c++17 -Wno-deprecated-declarations # The latter is for std::iterator in util_bit.h.
174VBox-DxVkNativeDxVk_CXXFLAGS.darwin += \
175 -std=c++17
176VBox-DxVkNativeDxVk_INCS = \
177 $(VBOX_PATH_DXVK) \
178 $(VBOX_PATH_DXVK)/include/ \
179 $(VBOX_PATH_DXVK)/src/util/ \
180 $(VBOX_PATH_DXVK)/include/vulkan/include \
181 $(VBOX_PATH_DXVK)/include/spirv/include \
182 $(VBOX_PATH_DXVK)/include/native/ \
183 $(VBOX_PATH_DXVK)/include/native/windows \
184 $(VBOX_PATH_DXVK)/include/native/directx
185VBox-DxVkNativeDxVk_SOURCES = \
186 src/dxvk/dxvk_adapter.cpp \
187 src/dxvk/dxvk_barrier.cpp \
188 src/dxvk/dxvk_buffer.cpp \
189 src/dxvk/dxvk_cmdlist.cpp \
190 src/dxvk/dxvk_compute.cpp \
191 src/dxvk/dxvk_context.cpp \
192 src/dxvk/dxvk_cs.cpp \
193 src/dxvk/dxvk_data.cpp \
194 src/dxvk/dxvk_descriptor.cpp \
195 src/dxvk/dxvk_device.cpp \
196 src/dxvk/dxvk_device_filter.cpp \
197 src/dxvk/dxvk_extensions.cpp \
198 src/dxvk/dxvk_fence.cpp \
199 src/dxvk/dxvk_format.cpp \
200 src/dxvk/dxvk_framebuffer.cpp \
201 src/dxvk/dxvk_gpu_event.cpp \
202 src/dxvk/dxvk_gpu_query.cpp \
203 src/dxvk/dxvk_graphics.cpp \
204 src/dxvk/dxvk_image.cpp \
205 src/dxvk/dxvk_instance.cpp \
206 src/dxvk/dxvk_lifetime.cpp \
207 src/dxvk/dxvk_memory.cpp \
208 src/dxvk/dxvk_meta_blit.cpp \
209 src/dxvk/dxvk_meta_clear.cpp \
210 src/dxvk/dxvk_meta_copy.cpp \
211 src/dxvk/dxvk_meta_mipgen.cpp \
212 src/dxvk/dxvk_meta_pack.cpp \
213 src/dxvk/dxvk_meta_resolve.cpp \
214 src/dxvk/dxvk_options.cpp \
215 src/dxvk/dxvk_pipelayout.cpp \
216 src/dxvk/dxvk_pipemanager.cpp \
217 src/dxvk/dxvk_presenter.cpp \
218 src/dxvk/dxvk_queue.cpp \
219 src/dxvk/dxvk_resource.cpp \
220 src/dxvk/dxvk_sampler.cpp \
221 src/dxvk/dxvk_shader.cpp \
222 src/dxvk/dxvk_shader_key.cpp \
223 src/dxvk/dxvk_signal.cpp \
224 src/dxvk/dxvk_sparse.cpp \
225 src/dxvk/dxvk_staging.cpp \
226 src/dxvk/dxvk_state_cache.cpp \
227 src/dxvk/dxvk_stats.cpp \
228 src/dxvk/dxvk_swapchain_blitter.cpp \
229 src/dxvk/dxvk_unbound.cpp \
230 src/dxvk/dxvk_util.cpp \
231 src/dxvk/hud/dxvk_hud.cpp \
232 src/dxvk/hud/dxvk_hud_font.cpp \
233 src/dxvk/hud/dxvk_hud_item.cpp \
234 src/dxvk/hud/dxvk_hud_renderer.cpp \
235 src/dxvk/platform/dxvk_headless_exts.cpp
236VBox-DxVkNativeDxVk_VBOX_SHADERS := \
237 $(PATH_SUB_CURRENT)/src/dxvk/shaders/dxvk_clear_buffer_u.comp \
238 $(PATH_SUB_CURRENT)/src/dxvk/shaders/dxvk_clear_image2d_u.comp \
239 $(PATH_SUB_CURRENT)/src/dxvk/shaders/dxvk_unpack_d32s8.comp \
240 $(PATH_SUB_CURRENT)/src/dxvk/shaders/dxvk_copy_buffer_image.comp \
241 $(PATH_SUB_CURRENT)/src/dxvk/shaders/dxvk_clear_image3d_u.comp \
242 $(PATH_SUB_CURRENT)/src/dxvk/shaders/dxvk_clear_image2d_f.comp \
243 $(PATH_SUB_CURRENT)/src/dxvk/shaders/dxvk_clear_image2darr_f.comp \
244 $(PATH_SUB_CURRENT)/src/dxvk/shaders/dxvk_clear_image2darr_u.comp \
245 $(PATH_SUB_CURRENT)/src/dxvk/shaders/dxvk_clear_image1darr_u.comp \
246 $(PATH_SUB_CURRENT)/src/dxvk/shaders/dxvk_clear_image1darr_f.comp \
247 $(PATH_SUB_CURRENT)/src/dxvk/shaders/dxvk_unpack_d24s8.comp \
248 $(PATH_SUB_CURRENT)/src/dxvk/shaders/dxvk_clear_buffer_f.comp \
249 $(PATH_SUB_CURRENT)/src/dxvk/shaders/dxvk_unpack_d24s8_as_d32s8.comp \
250 $(PATH_SUB_CURRENT)/src/dxvk/shaders/dxvk_clear_image1d_f.comp \
251 $(PATH_SUB_CURRENT)/src/dxvk/shaders/dxvk_clear_image1d_u.comp \
252 $(PATH_SUB_CURRENT)/src/dxvk/shaders/dxvk_pack_d32s8.comp \
253 $(PATH_SUB_CURRENT)/src/dxvk/shaders/dxvk_clear_image3d_f.comp \
254 $(PATH_SUB_CURRENT)/src/dxvk/shaders/dxvk_pack_d24s8.comp \
255 \
256 $(PATH_SUB_CURRENT)/src/dxvk/shaders/dxvk_fullscreen_geom.geom \
257 \
258 $(PATH_SUB_CURRENT)/src/dxvk/shaders/dxvk_present_vert.vert \
259 $(PATH_SUB_CURRENT)/src/dxvk/shaders/dxvk_fullscreen_vert.vert \
260 $(PATH_SUB_CURRENT)/src/dxvk/shaders/dxvk_fullscreen_layer_vert.vert \
261 \
262 $(PATH_SUB_CURRENT)/src/dxvk/shaders/dxvk_present_frag_blit.frag \
263 $(PATH_SUB_CURRENT)/src/dxvk/shaders/dxvk_copy_depth_stencil_ms.frag \
264 $(PATH_SUB_CURRENT)/src/dxvk/shaders/dxvk_resolve_frag_f_amd.frag \
265 $(PATH_SUB_CURRENT)/src/dxvk/shaders/dxvk_copy_color_2d.frag \
266 $(PATH_SUB_CURRENT)/src/dxvk/shaders/dxvk_blit_frag_1d.frag \
267 $(PATH_SUB_CURRENT)/src/dxvk/shaders/dxvk_dummy_frag.frag \
268 $(PATH_SUB_CURRENT)/src/dxvk/shaders/dxvk_present_frag_ms.frag \
269 $(PATH_SUB_CURRENT)/src/dxvk/shaders/dxvk_copy_color_1d.frag \
270 $(PATH_SUB_CURRENT)/src/dxvk/shaders/dxvk_resolve_frag_i.frag \
271 $(PATH_SUB_CURRENT)/src/dxvk/shaders/dxvk_resolve_frag_d.frag \
272 $(PATH_SUB_CURRENT)/src/dxvk/shaders/dxvk_present_frag_ms_amd.frag \
273 $(PATH_SUB_CURRENT)/src/dxvk/shaders/dxvk_copy_depth_stencil_2d.frag \
274 $(PATH_SUB_CURRENT)/src/dxvk/shaders/dxvk_resolve_frag_f.frag \
275 $(PATH_SUB_CURRENT)/src/dxvk/shaders/dxvk_blit_frag_2d.frag \
276 $(PATH_SUB_CURRENT)/src/dxvk/shaders/dxvk_copy_color_ms.frag \
277 $(PATH_SUB_CURRENT)/src/dxvk/shaders/dxvk_blit_frag_3d.frag \
278 $(PATH_SUB_CURRENT)/src/dxvk/shaders/dxvk_resolve_frag_u.frag \
279 $(PATH_SUB_CURRENT)/src/dxvk/shaders/dxvk_present_frag.frag \
280 $(PATH_SUB_CURRENT)/src/dxvk/shaders/dxvk_copy_depth_stencil_1d.frag \
281 $(PATH_SUB_CURRENT)/src/dxvk/shaders/dxvk_resolve_frag_ds.frag \
282 \
283 $(PATH_SUB_CURRENT)/src/d3d11/shaders/d3d11_video_blit_vert.vert \
284 $(PATH_SUB_CURRENT)/src/d3d11/shaders/d3d11_video_blit_frag.frag \
285 \
286 $(PATH_SUB_CURRENT)/src/dxvk/hud/shaders/hud_graph_frag.frag \
287 $(PATH_SUB_CURRENT)/src/dxvk/hud/shaders/hud_graph_vert.vert \
288 $(PATH_SUB_CURRENT)/src/dxvk/hud/shaders/hud_text_frag.frag \
289 $(PATH_SUB_CURRENT)/src/dxvk/hud/shaders/hud_text_vert.vert
290$(evalcall2 def_VBoxDxVkCompilerShaders,VBox-DxVkNativeDxVk)
291
292
293#
294# DXVK D3D11 interface library
295#
296VBox-DxVkNativeD3D11_TEMPLATE = VBoxR3DllNonPedantic
297VBox-DxVkNativeD3D11_DEFS = \
298 DXVK_NATIVE \
299 NOMINMAX \
300 _WIN32_WINNT=0xa00
301VBox-DxVkNativeD3D11_DEFS += \
302 DXVK_PLATFORM_LINUX \
303 DXVK_WSI_HEADLESS
304VBox-DxVkNativeD3D11_CXXFLAGS.linux += \
305 -std=c++17 -Wno-deprecated-declarations # The latter is for std::iterator in util_bit.h.
306VBox-DxVkNativeD3D11_CXXFLAGS.darwin += \
307 -std=c++17
308VBox-DxVkNativeD3D11_INCS = \
309 $(VBOX_PATH_DXVK) \
310 $(VBOX_PATH_DXVK)/include/ \
311 $(VBOX_PATH_DXVK)/src/util/ \
312 $(VBOX_PATH_DXVK)/include/vulkan/include \
313 $(VBOX_PATH_DXVK)/include/spirv/include \
314 $(VBOX_PATH_DXVK)/include/native/ \
315 $(VBOX_PATH_DXVK)/include/native/windows \
316 $(VBOX_PATH_DXVK)/include/native/directx
317VBox-DxVkNativeD3D11_SOURCES = \
318 src/dxgi/dxgi_format.cpp \
319 src/dxgi/dxgi_monitor.cpp \
320 src/dxgi/dxgi_swapchain.cpp \
321 src/d3d11/d3d11_annotation.cpp \
322 src/d3d11/d3d11_blend.cpp \
323 src/d3d11/d3d11_buffer.cpp \
324 src/d3d11/d3d11_class_linkage.cpp \
325 src/d3d11/d3d11_cmdlist.cpp \
326 src/d3d11/d3d11_context.cpp \
327 src/d3d11/d3d11_context_def.cpp \
328 src/d3d11/d3d11_context_ext.cpp \
329 src/d3d11/d3d11_context_imm.cpp \
330 src/d3d11/d3d11_cuda.cpp \
331 src/d3d11/d3d11_depth_stencil.cpp \
332 src/d3d11/d3d11_device.cpp \
333 src/d3d11/d3d11_enums.cpp \
334 src/d3d11/d3d11_features.cpp \
335 src/d3d11/d3d11_fence.cpp \
336 src/d3d11/d3d11_gdi.cpp \
337 src/d3d11/d3d11_initializer.cpp \
338 src/d3d11/d3d11_input_layout.cpp \
339 src/d3d11/d3d11_interop.cpp \
340 src/d3d11/d3d11_main.cpp \
341 src/d3d11/d3d11_on_12.cpp \
342 src/d3d11/d3d11_options.cpp \
343 src/d3d11/d3d11_query.cpp \
344 src/d3d11/d3d11_rasterizer.cpp \
345 src/d3d11/d3d11_resource.cpp \
346 src/d3d11/d3d11_sampler.cpp \
347 src/d3d11/d3d11_shader.cpp \
348 src/d3d11/d3d11_state.cpp \
349 src/d3d11/d3d11_state_object.cpp \
350 src/d3d11/d3d11_swapchain.cpp \
351 src/d3d11/d3d11_texture.cpp \
352 src/d3d11/d3d11_util.cpp \
353 src/d3d11/d3d11_video.cpp \
354 src/d3d11/d3d11_view_dsv.cpp \
355 src/d3d11/d3d11_view_rtv.cpp \
356 src/d3d11/d3d11_view_srv.cpp \
357 src/d3d11/d3d11_view_uav.cpp \
358 src/d3d10/d3d10_blend.cpp \
359 src/d3d10/d3d10_buffer.cpp \
360 src/d3d10/d3d10_core.cpp \
361 src/d3d10/d3d10_depth_stencil.cpp \
362 src/d3d10/d3d10_device.cpp \
363 src/d3d10/d3d10_input_layout.cpp \
364 src/d3d10/d3d10_multithread.cpp \
365 src/d3d10/d3d10_query.cpp \
366 src/d3d10/d3d10_rasterizer.cpp \
367 src/d3d10/d3d10_sampler.cpp \
368 src/d3d10/d3d10_texture.cpp \
369 src/d3d10/d3d10_util.cpp \
370 src/d3d10/d3d10_view_dsv.cpp \
371 src/d3d10/d3d10_view_rtv.cpp \
372 src/d3d10/d3d10_view_srv.cpp
373VBox-DxVkNativeD3D11_VBOX_SHADERS := \
374 $(PATH_SUB_CURRENT)/src/d3d11/shaders/d3d11_video_blit_frag.frag \
375 $(PATH_SUB_CURRENT)/src/d3d11/shaders/d3d11_video_blit_vert.vert
376$(evalcall2 def_VBoxDxVkCompilerShaders,VBox-DxVkNativeD3D11)
377
378#
379# VBoxDxVk - Shared Object / DLL version.
380#
381VBoxDxVk_TEMPLATE = VBoxR3DllNonPedantic
382VBoxDxVk_DEFS = \
383 DXVK_NATIVE \
384 NOMINMAX \
385 _WIN32_WINNT=0xa00
386VBoxDxVk_INCS = \
387 $(VBOX_PATH_DXVK) \
388 $(VBOX_PATH_DXVK)/include/ \
389 $(VBOX_PATH_DXVK)/src/util/ \
390 $(VBOX_PATH_DXVK)/include/native/ \
391 $(VBOX_PATH_DXVK)/include/native/windows \
392 $(VBOX_PATH_DXVK)/include/native/directx
393VBoxDxVk_CXXFLAGS.linux += \
394 -std=c++17
395VBoxDxVk_SOURCES = \
396 VBoxDxVkDeps.cpp
397VBoxDxVk_LIBS = \
398 $(PATH_STAGE_LIB)/VBox-DxVkNativeD3D11$(VBOX_SUFF_LIB) \
399 $(PATH_STAGE_LIB)/VBox-DxVkNativeDxVk$(VBOX_SUFF_LIB) \
400 $(PATH_STAGE_LIB)/VBox-DxVkNativeUtil$(VBOX_SUFF_LIB) \
401 $(LIB_RUNTIME)
402
403include $(FILE_KBUILD_SUB_FOOTER)
404
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette