early-access version 2853

This commit is contained in:
pineappleEA
2022-07-23 03:01:36 +02:00
parent 1f2b5081b5
commit 1f111bb69c
8955 changed files with 418777 additions and 999 deletions

52
externals/vcpkg/ports/mesa/clang.patch vendored Executable file
View File

@@ -0,0 +1,52 @@
diff --git a/meson.build b/meson.build
index 53ec2c2ef95e65447dd0f0eb65c0f92a5906590d..c124b5fb0d2b28424f33aac54cd4f87c4249dc40 100644
--- a/meson.build
+++ b/meson.build
@@ -1087,7 +1087,18 @@ elif host_machine.system() == 'windows'
'-DNOMINMAX',
]
else
- pre_args += ['-D__MSVCRT_VERSION__=0x0700']
+ # When the target is not mingw/ucrt
+ # NOTE: clang's stddef.h are conflict with mingw/ucrt's stddef.h
+ # So do not include headers that defined in clang for detecting
+ # _UCRT
+ if cc.compiles('''
+ #include <string.h>
+ #if defined(__MINGW32__) && defined(_UCRT)
+ #error
+ #endif
+ int main(void) { return 0; }''')
+ pre_args += ['-D__MSVCRT_VERSION__=0x0700']
+ endif
endif
elif host_machine.system() == 'openbsd'
pre_args += '-D_ISOC11_SOURCE'
diff --git a/src/compiler/nir/nir_lower_atomics_to_ssbo.c b/src/compiler/nir/nir_lower_atomics_to_ssbo.c
index c1799d0b9d0af70148928a4b224172c188c64194..448f63bdc7cc3b9cae123e3c0abe79b4b5af380b 100644
--- a/src/compiler/nir/nir_lower_atomics_to_ssbo.c
+++ b/src/compiler/nir/nir_lower_atomics_to_ssbo.c
@@ -27,10 +27,6 @@
#include "nir.h"
#include "nir_builder.h"
-#if defined(_WIN32) && !defined(snprintf)
-#define snprintf _snprintf
-#endif
-
/*
* Remap atomic counters to SSBOs, starting from the shader's next SSBO slot
* (info.num_ssbos).
diff --git a/src/compiler/spirv/vtn_private.h b/src/compiler/spirv/vtn_private.h
index b1b40c8ee992eaeea985c58f4e8923724c1d385b..6053c2544a2628300cc8dc3311c8e4f0f69d36d5 100644
--- a/src/compiler/spirv/vtn_private.h
+++ b/src/compiler/spirv/vtn_private.h
@@ -41,7 +41,7 @@ struct vtn_builder;
struct vtn_decoration;
/* setjmp/longjmp is broken on MinGW: https://sourceforge.net/p/mingw-w64/bugs/406/ */
-#ifdef __MINGW32__
+#if defined(__MINGW32__) && !defined(_UCRT)
#define vtn_setjmp __builtin_setjmp
#define vtn_longjmp __builtin_longjmp
#else

63
externals/vcpkg/ports/mesa/clover.patch vendored Executable file
View File

@@ -0,0 +1,63 @@
From b7c465dc43693cb1ad7e073cc7d8f89f5cfbd0ac Mon Sep 17 00:00:00 2001
From: pal1000 <liviuprodea@yahoo.com>
Date: Sat, 13 Nov 2021 11:39:58 +0200
Subject: [PATCH] clover: Use static pipe loader on Windows
Currently this only supports linking in swrast, but more Windows-supporting
drivers can be added pretty easily.
---
src/gallium/targets/opencl/meson.build | 18 +++++++++++++++---
src/gallium/targets/opencl/target.c | 2 ++
2 files changed, 17 insertions(+), 3 deletions(-)
create mode 100644 src/gallium/targets/opencl/target.c
diff --git a/src/gallium/targets/opencl/meson.build b/src/gallium/targets/opencl/meson.build
index ec65fcbe18e..f6ca4a28f20 100644
--- a/src/gallium/targets/opencl/meson.build
+++ b/src/gallium/targets/opencl/meson.build
@@ -85,19 +85,31 @@ if not (dep_clang.found() and dep_clang_usable)
endif
endif
+if host_machine.system() == 'windows'
+ libpipe_loader = libpipe_loader_static
+ target_files = ['target.c']
+else
+ libpipe_loader = libpipe_loader_dynamic
+ target_files = []
+endif
+
ocldef = files(opencl_libname + '.def')[0]
libopencl = shared_library(
opencl_libname,
- [],
+ target_files,
+ include_directories : [
+ inc_include, inc_util, inc_src, inc_gallium, inc_gallium_winsys, inc_gallium_drivers, inc_gallium_aux
+ ],
vs_module_defs : ocldef,
link_args : [ld_args_gc_sections, opencl_link_args],
link_depends : opencl_link_deps,
link_whole : libclover,
- link_with : [libpipe_loader_dynamic, libgallium],
+ link_with : [libpipe_loader, libgallium, libws_null, libwsw],
dependencies : [
idep_mesautil,
- dep_clock, dep_dl, dep_unwind, dep_elf, dep_clang, dep_version
+ dep_clock, dep_dl, dep_unwind, dep_elf, dep_clang, dep_version,
+ driver_swrast
],
version : '@0@.0.0'.format(opencl_version),
install : true,
diff --git a/src/gallium/targets/opencl/target.c b/src/gallium/targets/opencl/target.c
new file mode 100644
index 00000000000..308e23bb4a0
--- /dev/null
+++ b/src/gallium/targets/opencl/target.c
@@ -0,0 +1,2 @@
+#include "target-helpers/drm_helper.h"
+#include "target-helpers/sw_helper.h"
--
2.33.1.windows.1

3571
externals/vcpkg/ports/mesa/def-fixes.patch vendored Executable file

File diff suppressed because it is too large Load Diff

137
externals/vcpkg/ports/mesa/portfile.cmake vendored Executable file
View File

@@ -0,0 +1,137 @@
# Build-Depends: From X Window PR: zstd, drm (!windows), elfutils (!windows), wayland (!windows), wayland-protocols (!windows), xdamage, xshmfence (!windows), x11, xcb, xfixes, xext, xxf86vm, xrandr, xv, xvmc (!windows), egl-registry, opengl-registry, tool-meson
# Required LLVM modules: LLVM (modules: bitwriter, core, coroutines, engine, executionengine, instcombine, mcdisassembler, mcjit, scalaropts, transformutils) found: YES
# Patches are from https://github.com/pal1000/mesa-dist-win/tree/master/patches
set(PATCHES
# Fix symbols exporting for MinGW GCC x86
def-fixes.patch
# Fix MinGW clang build
clang.patch
# Clover build on Windows
clover.patch
)
vcpkg_check_linkage(ONLY_DYNAMIC_CRT)
if(VCPKG_TARGET_IS_WINDOWS)
set(VCPKG_POLICY_DLLS_IN_STATIC_LIBRARY enabled) # some parts of this port can only build as a shared library.
endif()
vcpkg_from_gitlab(
GITLAB_URL https://gitlab.freedesktop.org
OUT_SOURCE_PATH SOURCE_PATH
REPO mesa/mesa
REF mesa-22.0.2
SHA512 1139bae1fa9f9b49727c5aaddad9b2908c7643d7c6c435544e8322c84d17c012f04aa73876bef8cab9b517e36957eb2a678b3001da2d69a32497ef4569f6172e
FILE_DISAMBIGUATOR 1
HEAD_REF master
PATCHES ${PATCHES}
)
x_vcpkg_get_python_packages(PYTHON_VERSION "3" OUT_PYTHON_VAR "PYTHON3" PACKAGES setuptools mako )
vcpkg_find_acquire_program(FLEX)
get_filename_component(FLEX_DIR "${FLEX}" DIRECTORY )
vcpkg_add_to_path(PREPEND "${FLEX_DIR}")
vcpkg_find_acquire_program(BISON)
get_filename_component(BISON_DIR "${BISON}" DIRECTORY )
vcpkg_add_to_path(PREPEND "${BISON_DIR}")
if(WIN32) # WIN32 HOST probably has win_flex and win_bison!
if(NOT EXISTS "${FLEX_DIR}/flex${VCPKG_HOST_EXECUTABLE_SUFFIX}")
if(FLEX_DIR MATCHES "${DOWNLOADS}")
file(CREATE_LINK "${FLEX}" "${FLEX_DIR}/flex${VCPKG_HOST_EXECUTABLE_SUFFIX}")
else()
message(FATAL_ERROR "${PORT} requires flex being named flex on windows and not win_flex!\n(Can be solved by creating a simple link from win_flex to flex)")
endif()
endif()
if(NOT EXISTS "${BISON_DIR}/BISON${VCPKG_HOST_EXECUTABLE_SUFFIX}")
if(BISON_DIR MATCHES "${DOWNLOADS}")
file(CREATE_LINK "${BISON}" "${BISON_DIR}/bison${VCPKG_HOST_EXECUTABLE_SUFFIX}")
else()
message(FATAL_ERROR "${PORT} requires bison being named bison on windows and not win_bison!\n(Can be solved by creating a simple link from win_bison to bison)")
endif()
endif()
endif()
# For features https://github.com/pal1000/mesa-dist-win should be probably studied a bit more.
list(APPEND MESA_OPTIONS -Dzstd=enabled)
list(APPEND MESA_OPTIONS -Dshared-llvm=auto)
list(APPEND MESA_OPTIONS -Dlibunwind=disabled)
list(APPEND MESA_OPTIONS -Dlmsensors=disabled)
list(APPEND MESA_OPTIONS -Dvalgrind=disabled)
list(APPEND MESA_OPTIONS -Dglvnd=false)
list(APPEND MESA_OPTIONS -Dglx=disabled)
list(APPEND MESA_OPTIONS -Dgbm=disabled)
list(APPEND MESA_OPTIONS -Dosmesa=true)
if("llvm" IN_LIST FEATURES)
list(APPEND MESA_OPTIONS -Dllvm=enabled)
else()
list(APPEND MESA_OPTIONS -Dllvm=disabled)
endif()
if("gles1" IN_LIST FEATURES)
list(APPEND MESA_OPTIONS -Dgles1=enabled)
else()
list(APPEND MESA_OPTIONS -Dgles1=disabled)
endif()
if("gles2" IN_LIST FEATURES)
list(APPEND MESA_OPTIONS -Dgles2=enabled)
else()
list(APPEND MESA_OPTIONS -Dgles2=disabled)
endif()
if("opengl" IN_LIST FEATURES)
list(APPEND MESA_OPTIONS -Dopengl=true)
else()
list(APPEND MESA_OPTIONS -Dopengl=false)
endif()
if("egl" IN_LIST FEATURES) # EGL feature only works on Linux
list(APPEND MESA_OPTIONS -Degl=enabled)
else()
list(APPEND MESA_OPTIONS -Degl=disabled)
endif()
list(APPEND MESA_OPTIONS -Dshared-glapi=enabled) #shared GLAPI required when building two or more of the following APIs - opengl, gles1 gles2
if(VCPKG_TARGET_IS_WINDOWS)
list(APPEND MESA_OPTIONS -Dplatforms=['windows'])
list(APPEND MESA_OPTIONS -Dmicrosoft-clc=disabled)
if(NOT VCPKG_TARGET_IS_MINGW)
set(VCPKG_CXX_FLAGS "/D_CRT_DECLARE_NONSTDC_NAMES ${VCPKG_CXX_FLAGS}")
set(VCPKG_C_FLAGS "/D_CRT_DECLARE_NONSTDC_NAMES ${VCPKG_C_FLAGS}")
endif()
endif()
vcpkg_configure_meson(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-Dgles-lib-suffix=_mesa
#-D egl-lib-suffix=_mesa
-Dbuild-tests=false
${MESA_OPTIONS}
)
vcpkg_install_meson()
vcpkg_fixup_pkgconfig()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
#installed by egl-registry
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/KHR")
file(REMOVE "${CURRENT_PACKAGES_DIR}/include/EGL/egl.h")
file(REMOVE "${CURRENT_PACKAGES_DIR}/include/EGL/eglext.h")
file(REMOVE "${CURRENT_PACKAGES_DIR}/include/EGL/eglplatform.h")
#installed by opengl-registry
set(_double_files include/GL/glcorearb.h include/GL/glext.h include/GL/glxext.h
include/GLES/egl.h include/GLES/gl.h include/GLES/glext.h include/GLES/glplatform.h
include/GLES2/gl2.h include/GLES2/gl2ext.h include/GLES2/gl2platform.h
include/GLES3/gl3.h include/GLES3/gl31.h include/GLES3/gl32.h include/GLES3/gl3platform.h)
list(TRANSFORM _double_files PREPEND "${CURRENT_PACKAGES_DIR}/")
file(REMOVE ${_double_files})
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/GLES")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/GLES2")
# Handle copyright
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share/${PORT}")
file(TOUCH "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright")

107
externals/vcpkg/ports/mesa/vcpkg.json vendored Executable file
View File

@@ -0,0 +1,107 @@
{
"name": "mesa",
"version": "22.0.2",
"description": "Mesa - The 3D Graphics Library",
"homepage": "https://www.mesa3d.org/",
"license": "MIT AND BSL-1.0 AND SGI-B-2.0",
"supports": "!(windows & arm)",
"dependencies": [
{
"name": "vcpkg-get-python-packages",
"host": true
},
{
"name": "vcpkg-tool-meson",
"host": true
},
"zlib",
"zstd"
],
"default-features": [
"default-features"
],
"features": {
"default-features": {
"description": "Platform dependent default features",
"dependencies": [
{
"name": "mesa",
"default-features": false,
"features": [
"gles1"
]
},
{
"name": "mesa",
"default-features": false,
"features": [
"gles2"
]
},
{
"name": "mesa",
"default-features": false,
"features": [
"opengl"
]
},
{
"name": "mesa",
"default-features": false,
"features": [
"llvm"
],
"platform": "x64"
}
]
},
"egl": {
"description": "Build support for EGL platform",
"dependencies": [
{
"name": "mesa",
"default-features": false
}
]
},
"gles1": {
"description": "Build support for OpenGL ES 1.x",
"dependencies": [
{
"name": "mesa",
"default-features": false
}
]
},
"gles2": {
"description": "Build support for OpenGL ES 2.x and 3.x",
"dependencies": [
{
"name": "mesa",
"default-features": false
}
]
},
"llvm": {
"description": "Build with llvmpipe",
"dependencies": [
{
"name": "llvm",
"default-features": false,
"features": [
"libclc"
]
}
]
},
"opengl": {
"description": "Build support for OpenGL (all versions)",
"dependencies": [
{
"name": "mesa",
"default-features": false
}
]
}
}
}