1 | # $Id: Config.kmk 98416 2023-02-01 16:25:17Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # kBuild Configuration file for the Mesa3D.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2016-2023 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 |
|
---|
28 | VBOX_MESA3D_CONFIG_KMK_INCLUDED := 1
|
---|
29 |
|
---|
30 | # Include the top-level configure file.
|
---|
31 | ifndef VBOX_ROOT_CONFIG_KMK_INCLUDED
|
---|
32 | include $(PATH_ROOT)/Config.kmk
|
---|
33 | endif
|
---|
34 |
|
---|
35 | VBOX_MESA := mesa-21.3.8
|
---|
36 | VBOX_PATH_3D := $(PATH_ROOT)/src/VBox/Additions/3D
|
---|
37 | VBOX_PATH_MESA := $(PATH_ROOT)/src/VBox/Additions/3D/mesa/$(VBOX_MESA)
|
---|
38 | VBOX_PATH_WDDM := $(PATH_ROOT)/src/VBox/Additions/WINNT/Graphics/Video
|
---|
39 | VBOX_PATH_VMSVGA_INC := $(VBOX_PATH_MESA)/src/gallium/drivers/svga/include
|
---|
40 |
|
---|
41 | #
|
---|
42 | # Base template for Mesa3D code and code which uses Mesa3D libraries.
|
---|
43 | #
|
---|
44 | TEMPLATE_VBoxMesa3DGuestR3Dll = VBox Mesa 3D Guest User Mode DLL
|
---|
45 | TEMPLATE_VBoxMesa3DGuestR3Dll_EXTENDS = NewerVccVBoxGuestR3Dll
|
---|
46 | TEMPLATE_VBoxMesa3DGuestR3Dll_INST = $(INST_ADDITIONS)
|
---|
47 | TEMPLATE_VBoxMesa3DGuestR3Dll_DEFS = $(TEMPLATE_NewerVccVBoxGuestR3Dll_DEFS) \
|
---|
48 | VBOX_WITH_MESA3D
|
---|
49 | ifdef VBOX_WITH_VMSVGA
|
---|
50 | TEMPLATE_VBoxMesa3DGuestR3Dll_DEFS += \
|
---|
51 | VBOX_WITH_VMSVGA
|
---|
52 | # treat as error: warning C4013: 'close' undefined; assuming extern returning int
|
---|
53 | TEMPLATE_VBoxMesa3DGuestR3Dll_CFLAGS = $(TEMPLATE_NewerVccVBoxGuestR3Dll_CFLAGS) -we4013
|
---|
54 | endif
|
---|
55 | TEMPLATE_VBoxMesa3DGuestR3Dll_SDKS.win = $(TEMPLATE_NewerVccVBoxGuestR3Dll_SDKS) \
|
---|
56 | $(VBOX_WINDDK_GST_W8)
|
---|
57 | # VirtualBox specific modifications of the Mesa3D code.
|
---|
58 | # All modified places can be found by searching for VBOX
|
---|
59 | #
|
---|
60 | # Each define represents a group of related modifications.
|
---|
61 | # The purpose of the separation is to document why each modification was necessary.
|
---|
62 | #
|
---|
63 | # Modifications which would be nice to have in upstream Mesa code are marked with '*' here.
|
---|
64 | #
|
---|
65 | # VBOX Modifications in headers shared with VBox WDDM driver code (see comments).
|
---|
66 | # VBOX_WITH_MESA3D_COMPILE Tweaks to compile Mesa as part of VBox WDDM.
|
---|
67 | # VBOX_WITH_MESA3D_D3D_FROM_SYSTEMMEM Create D3DPOOL_SYSTEMMEM textures from provided system memory pointer.
|
---|
68 | # VBOX_WITH_MESA3D_D3D_THREADPOOL (No) threadpool for VBox build.
|
---|
69 | # VBOX_WITH_MESA3D_DBG Tweaks for easier debugging and better logging.
|
---|
70 | # VBOX_WITH_MESA3D_HACKS Hacks to make it work (need a proper solutions).
|
---|
71 | # *VBOX_WITH_MESA3D_MSC Tweaks for Microsoft VCC.
|
---|
72 | # VBOX_WITH_MESA3D_NINE_SVGA Make the D3D state tracker to work together with VMSVGA.
|
---|
73 | # VBOX_WITH_MESA3D_SVGA_GPU_FINISHED PIPE_QUERY_GPU_FINISHED in VMSVGA driver.
|
---|
74 | # VBOX_WITH_MESA3D_SVGA_HALFZ D3D Z coord [0.0;1.0] in the Gallium SVGA driver (VGPU9 only).
|
---|
75 | # VBOX_WITH_MESA3D_SVGA_INSTANCING Instancing for DrawPrimitives in the Gallium SVGA driver
|
---|
76 | # (VGPU9 only, VGPU10 has it).
|
---|
77 | TEMPLATE_VBoxMesa3DGuestR3Dll_DEFS += \
|
---|
78 | VBOX_WITH_MESA3D_COMPILE \
|
---|
79 | VBOX_WITH_MESA3D_D3D_FROM_SYSTEMMEM \
|
---|
80 | VBOX_WITH_MESA3D_D3D_THREADPOOL \
|
---|
81 | VBOX_WITH_MESA3D_DBG \
|
---|
82 | VBOX_WITH_MESA3D_HACKS \
|
---|
83 | VBOX_WITH_MESA3D_MSC \
|
---|
84 | VBOX_WITH_MESA3D_NINE_SVGA \
|
---|
85 | VBOX_WITH_MESA3D_SVGA_GPU_FINISHED \
|
---|
86 | VBOX_WITH_MESA3D_SVGA_HALFZ \
|
---|
87 | VBOX_WITH_MESA3D_SVGA_INSTANCING
|
---|
88 | ifdef VBOX_WITH_NOCRT_STATIC
|
---|
89 | TEMPLATE_VBoxMesa3DGuestR3Dll_DEFS += \
|
---|
90 | IPRT_NO_CRT_FOR_3RD_PARTY \
|
---|
91 | RT_WITHOUT_NOCRT_WRAPPERS \
|
---|
92 | RT_WITHOUT_NOCRT_WRAPPER_ALIASES
|
---|
93 | endif
|
---|
94 | TEMPLATE_VBoxMesa3DGuestR3Dll_DEFS.win = $(TEMPLATE_NewerVccVBoxGuestR3Dll_DEFS.win) \
|
---|
95 | _USE_MATH_DEFINES \
|
---|
96 | WINAPI=__stdcall \
|
---|
97 | _WIN32
|
---|
98 | TEMPLATE_VBoxMesa3DGuestR3Dll_INCS = $(TEMPLATE_NewerVccVBoxGuestR3Dll_INCS) \
|
---|
99 | $(VBOX_PATH_MESA)/include \
|
---|
100 | $(VBOX_PATH_MESA)/include/c99 \
|
---|
101 | $(VBOX_PATH_MESA)/src \
|
---|
102 | $(VBOX_PATH_MESA)/src/mesa \
|
---|
103 | $(VBOX_PATH_MESA)/src/gallium/auxiliary \
|
---|
104 | $(VBOX_PATH_MESA)/src/gallium/include \
|
---|
105 | $(VBOX_PATH_3D)/win/VBoxWddmUmHlp
|
---|
106 | ifdef VBOX_WITH_NOCRT_STATIC # Only the softfloat libs are added here as mesa includes a softfloat.h and we wish for no conflicts.
|
---|
107 | TEMPLATE_VBoxMesa3DGuestR3Dll_LIBS.x86 += $(TEMPLATE_NewerVccVBoxGuestR3Dll_LIBS.x86) \
|
---|
108 | $(VBOX_LIB_IPRT_GUEST_R3_SHARED_X86) \
|
---|
109 | $(SDK_VBoxSoftFloatGuestR3Shared_LIBS.x86)
|
---|
110 | TEMPLATE_VBoxMesa3DGuestR3Dll_LIBS.$(KBUILD_TARGET_ARCH) += $(TEMPLATE_NewerVccVBoxGuestR3Dll_LIBS.$(KBUILD_TARGET)) \
|
---|
111 | $(VBOX_LIB_IPRT_GUEST_R3_SHARED) \
|
---|
112 | $(SDK_VBoxSoftFloatGuestR3Shared_LIBS.$(KBUILD_TARGET_ARCH))
|
---|
113 | TEMPLATE_VBoxMesa3DGuestR3Dll_LDFLAGS.win += $(TEMPLATE_NewerVccVBoxGuestR3Dll_LDFLAGS.win)
|
---|
114 | # The -Oi- disable optimizations of math functions like sqrt(), that takes all
|
---|
115 | # parameters on the stack, into calls to __CIsqrt that takes parameters in FPU
|
---|
116 | # registers. While we could implement the __CIxxxx functions too, they would
|
---|
117 | # be difficult to test properly given that they're not directly callable from
|
---|
118 | # C. Also, there could be other aspects to these functions that we don't know
|
---|
119 | # about, given that they aren't documented all that well. See:
|
---|
120 | # https://docs.microsoft.com/en-us/cpp/preprocessor/intrinsic?view=msvc-160#intrinsic-floating-point-functions
|
---|
121 | # https://docs.microsoft.com/en-us/cpp/build/reference/oi-generate-intrinsic-functions?view=msvc-160
|
---|
122 | # Unforutnately, this does mean that we will miss out on a little bit of
|
---|
123 | # performance in 32-bit binaries.
|
---|
124 | TEMPLATE_VBoxMesa3DGuestR3Dll_CFLAGS.win.x86 += $(TEMPLATE_NewerVccVBoxGuestR3Dll_CFLAGS.win.x86) -Oi-
|
---|
125 | TEMPLATE_VBoxMesa3DGuestR3Dll_CXXFLAGS.win.x86 += $(TEMPLATE_NewerVccVBoxGuestR3Dll_CXXFLAGS.win.x86) -Oi-
|
---|
126 | endif
|
---|
127 |
|
---|
128 | #
|
---|
129 | # Variant of VBoxMesa3DGuestR3Dll that requires Windows Vista or later.
|
---|
130 | #
|
---|
131 | TEMPLATE_VBoxMesa3DGuestR3DllMinVista = VBox Mesa 3D Guest User Mode DLL (Windows Vista or newer)
|
---|
132 | TEMPLATE_VBoxMesa3DGuestR3DllMinVista_EXTENDS = VBoxMesa3DGuestR3Dll
|
---|
133 | TEMPLATE_VBoxMesa3DGuestR3DllMinVista_VBOX_IMPORT_CHECKER.win.x86 := vista
|
---|
134 | TEMPLATE_VBoxMesa3DGuestR3DllMinVista_VBOX_IMPORT_CHECKER.win.amd64 := vista
|
---|
135 | ifeq ($(KBUILD_TARGET),win)
|
---|
136 | TEMPLATE_VBoxMesa3DGuestR3DllMinVista_LDFLAGS.win.x86 = $(filter-out -Section:.bss$(COMMA)RW!K,$(TEMPLATE_VBoxMesa3DGuestR3Dll_LDFLAGS.win.x86))
|
---|
137 | TEMPLATE_VBoxMesa3DGuestR3DllMinVista_POST_CMDS.win.x86 = $(subst $(VBOX_PE_SET_VERSION), $(VBOX_PE_SET_VERSION) --vista,$(TEMPLATE_VBoxMesa3DGuestR3Dll_POST_CMDS.win.x86))
|
---|
138 | TEMPLATE_VBoxMesa3DGuestR3DllMinVista_POST_CMDS.win.amd64 = $(if $(eq $(tool_do),LINK_LIBRARY),,$(VBOX_PE_SET_VERSION) --vista $(out)$$(NLTAB)$(TEMPLATE_VBoxMesa3DGuestR3Dll_POST_CMDS.win.amd64))
|
---|
139 | TEMPLATE_VBoxMesa3DGuestR3DllMinVista_LNK_DEPS.win.amd64 = $(if $(eq $(tool_do),LINK_LIBRARY),,$(VBOX_PE_SET_VERSION)) $(TEMPLATE_VBoxMesa3DGuestR3Dll_LNK_DEPS.win.amd64)
|
---|
140 | endif
|
---|
141 |
|
---|