VirtualBox

source: vbox/trunk/src/VBox/Additions/3D/Config.kmk

Last change on this file was 106061, checked in by vboxsync, 7 weeks ago

Copyright year updates by scm.

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