Update mesa

This commit is contained in:
Andrey Rodionov 2022-05-17 10:48:04 +03:00
parent ccd1cb6b8a
commit bddbdf0059
12 changed files with 747 additions and 1 deletions

113
mesa210-radeonsi/.SRCINFO Normal file
View file

@ -0,0 +1,113 @@
pkgbase = mesa-stable
pkgdesc = An open-source implementation of the OpenGL specification. (stable release)
pkgver = 21.0.2
pkgrel = 1
url = https://mesa3d.org/
arch = x86_64
license = MIT
makedepends = meson
makedepends = ninja
makedepends = bison
makedepends = flex
makedepends = python
makedepends = python-mako
makedepends = python-appdirs
makedepends = python-evdev
makedepends = lua
makedepends = polly
makedepends = valgrind
makedepends = xorgproto
makedepends = wayland-protocols
makedepends = glslang
makedepends = libclc
makedepends = elfutils
makedepends = libarchive
makedepends = libconfig
makedepends = compiler-rt
makedepends = libxcb
makedepends = wayland
makedepends = libxml2
makedepends = libx11
makedepends = libvdpau
makedepends = libelf
makedepends = libglvnd
makedepends = ncurses
makedepends = libva
makedepends = libxrandr
makedepends = expat
makedepends = libdrm
makedepends = libxvmc
makedepends = libepoxy
makedepends = libxv
makedepends = libxshmfence
makedepends = libxxf86vm
makedepends = libxdamage
makedepends = zstd
makedepends = lm_sensors
makedepends = libunwind
makedepends = vulkan-icd-loader
makedepends = llvm
makedepends = clang
makedepends = llvm-libs
makedepends = glibc
makedepends = gcc
makedepends = gcc-libs
makedepends = libomxil-bellagio
depends = libdrm
depends = libxcb
depends = wayland
depends = python
depends = libclc
depends = clang
depends = libx11
depends = libxshmfence
depends = zstd
depends = libelf
depends = llvm-libs
depends = expat
depends = libxxf86vm
depends = libxdamage
depends = libomxil-bellagio
depends = libunwind
depends = lm_sensors
depends = libglvnd
depends = vulkan-icd-loader
depends = llvm
depends = clang
depends = gcc-libs
depends = gcc
depends = glslang
provides = mesa
provides = opencl-mesa
provides = vulkan-intel
provides = vulkan-radeon
provides = vulkan-swrast
provides = vulkan-driver
provides = vulkan-mesa-layers
provides = libva-mesa-driver
provides = mesa-vdpau
provides = opengl-driver
provides = opencl-driver
provides = mesa-libgl
conflicts = mesa
conflicts = opencl-mesa
conflicts = vulkan-intel
conflicts = vulkan-radeon
conflicts = vulkan-mesa
conflicts = vulkan-swrast
conflicts = vulkan-mesa-layers
conflicts = libva-mesa-driver
conflicts = mesa-vdpau
conflicts = mesa-rc
conflicts = mesa-git
source = https://archive.mesa3d.org/mesa-21.0.2.tar.xz
source = LICENSE
source = 0001-4114.patch
source = 0001-4200.patch
md5sums = SKIP
md5sums = SKIP
md5sums = SKIP
md5sums = SKIP
pkgname = mesa-stable

View file

@ -0,0 +1,28 @@
From 82467de5bb895052993fb892cd4b34ee757fdcab Mon Sep 17 00:00:00 2001
From: kevall474 <kevall474@tuta.io>
Date: Wed, 24 Feb 2021 15:34:45 -0500
Subject: [PATCH] 4114
---
src/gallium/frontends/clover/llvm/invocation.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/gallium/frontends/clover/llvm/invocation.cpp b/src/gallium/frontends/clover/llvm/invocation.cpp
index 536e952b100..3a8d9c8e929 100644
--- a/src/gallium/frontends/clover/llvm/invocation.cpp
+++ b/src/gallium/frontends/clover/llvm/invocation.cpp
@@ -249,7 +249,11 @@ namespace {
c->getInvocation().setLangDefaults(c->getLangOpts(),
compat::ik_opencl, ::llvm::Triple(target.triple),
+#if LLVM_VERSION_MAJOR >= 12
+ c->getPreprocessorOpts().Includes,
+#else
c->getPreprocessorOpts(),
+#endif
get_language_version(opts, device_clc_version));
c->createDiagnostics(new clang::TextDiagnosticPrinter(
--
2.30.1

View file

@ -0,0 +1,28 @@
From 06bd99a56c635c9b9246144dc256f537c6441232 Mon Sep 17 00:00:00 2001
From: kevall474 <kevall474@tuta.io>
Date: Wed, 24 Feb 2021 15:30:04 -0500
Subject: [PATCH] 4200
---
src/gallium/frontends/clover/llvm/metadata.hpp | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/gallium/frontends/clover/llvm/metadata.hpp b/src/gallium/frontends/clover/llvm/metadata.hpp
index e3e58a32ff9..b15783266bd 100644
--- a/src/gallium/frontends/clover/llvm/metadata.hpp
+++ b/src/gallium/frontends/clover/llvm/metadata.hpp
@@ -129,7 +129,11 @@ namespace clover {
break;
}
if (type->isVectorTy())
- data += std::to_string(((::llvm::VectorType*)type)->getNumElements());
+#if LLVM_VERSION_MAJOR >= 13
+ data += std::to_string(((::llvm::FixedVectorType*)type)->getNumElements());
+#else
+ data += std::to_string(((::llvm::VectorType*)type)->getNumElements());
+#endif
} else {
::llvm::raw_string_ostream os { data };
--
2.30.1

View file

@ -0,0 +1,66 @@
From 2e4fcd0c36b85a257f0528bba0b641edfc008235 Mon Sep 17 00:00:00 2001
From: kevall474 <kevall474@tuta.io>
Date: Wed, 24 Feb 2021 13:02:35 -0500
Subject: [PATCH] enable llvm by default
---
src/amd/compiler/aco_ir.cpp | 5 +++++
src/amd/vulkan/radv_debug.h | 1 +
src/amd/vulkan/radv_device.c | 3 +++
3 files changed, 9 insertions(+)
diff --git a/src/amd/compiler/aco_ir.cpp b/src/amd/compiler/aco_ir.cpp
index 4e248a9bd33..00299044828 100644
--- a/src/amd/compiler/aco_ir.cpp
+++ b/src/amd/compiler/aco_ir.cpp
@@ -47,9 +47,14 @@ static void init_once()
{
debug_flags = parse_debug_string(getenv("ACO_DEBUG"), aco_debug_options);
+ debug_flags |= aco::DEBUG_NO_OPT;
+ debug_flags |= aco::DEBUG_NO_SCHED;
+
#ifndef NDEBUG
/* enable some flags by default on debug builds */
debug_flags |= aco::DEBUG_VALIDATE_IR;
+ debug_flags |= aco::DEBUG_NO_OPT;
+ debug_flags |= aco::DEBUG_NO_SCHED;
#endif
}
diff --git a/src/amd/vulkan/radv_debug.h b/src/amd/vulkan/radv_debug.h
index 8d828aaa28a..2e5aaec1109 100644
--- a/src/amd/vulkan/radv_debug.h
+++ b/src/amd/vulkan/radv_debug.h
@@ -72,6 +72,7 @@ enum {
RADV_PERFTEST_GE_WAVE_32 = 1u << 6,
RADV_PERFTEST_DFSM = 1u << 7,
RADV_PERFTEST_NO_SAM = 1u << 8,
+ RADV_PERFTEST_ACO = 1u << 9,
};
bool
diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index 9513fb3b277..b28cbd47c35 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -816,6 +816,7 @@ static const struct debug_control radv_perftest_options[] = {
{"gewave32", RADV_PERFTEST_GE_WAVE_32},
{"dfsm", RADV_PERFTEST_DFSM},
{"nosam", RADV_PERFTEST_NO_SAM},
+ {"aco", RADV_PERFTEST_ACO},
{NULL, 0}
};
@@ -948,6 +949,8 @@ VkResult radv_CreateInstance(
instance->debug_flags = parse_debug_string(getenv("RADV_DEBUG"),
radv_debug_options);
+ instance->debug_flags |= RADV_DEBUG_LLVM;
+
const char *radv_perftest_str = getenv("RADV_PERFTEST");
instance->perftest_flags = parse_debug_string(radv_perftest_str,
radv_perftest_options);
--
2.30.1

90
mesa210-radeonsi/LICENSE Normal file
View file

@ -0,0 +1,90 @@
License and Copyright
=====================
Disclaimer
----------
Mesa is a 3-D graphics library with an API which is very similar to that
of `OpenGL <https://www.opengl.org/>`_ [1]_.
To the extent that Mesa utilizes the OpenGL command syntax or state
machine, it is being used with authorization from `Silicon Graphics,
Inc. <https://www.sgi.com/>`__\ (SGI). However, the author does not
possess an OpenGL license from SGI, and makes no claim that Mesa is in
any way a compatible replacement for OpenGL or associated with SGI.
Those who want a licensed implementation of OpenGL should contact a
licensed vendor.
Please do not refer to the library as *MesaGL* (for legal reasons). It's
just *Mesa* or *The Mesa 3-D graphics library*.
.. [1] OpenGL is a trademark of `Silicon Graphics
Incorporated <https://www.sgi.com/>`__.
License / Copyright Information
-------------------------------
The Mesa distribution consists of several components. Different
copyrights and licenses apply to different components. For example, the
GLX client code uses the SGI Free Software License B, and some of the
Mesa device drivers are copyrighted by their authors. See below for a
list of Mesa's main components and the license for each.
The core Mesa library is licensed according to the terms of the MIT
license. This allows integration with the XFree86, Xorg and DRI
projects.
The default Mesa license is as follows:
::
Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Attention, Contributors
-----------------------
When contributing to the Mesa project you must agree to the licensing
terms of the component to which you're contributing. The following
section lists the primary components of the Mesa distribution and their
respective licenses.
Mesa Component Licenses
-----------------------
+-----------------+------------------------+-----------------------------+
| Component | Location | License |
+=================+========================+=============================+
| Main Mesa code | src/mesa/ | MIT |
+-----------------+------------------------+-----------------------------+
| Device drivers | src/mesa/drivers/* | MIT, generally |
+-----------------+------------------------+-----------------------------+
| Gallium code | src/gallium/ | MIT |
+-----------------+------------------------+-----------------------------+
| Ext headers | include/GL/glext.h, | Khronos |
| | include/GL/glxext.h | |
+-----------------+------------------------+-----------------------------+
| GLX client code | src/glx/ | SGI Free Software License B |
+-----------------+------------------------+-----------------------------+
| C11 thread | include/c11/threads*.h | Boost (permissive) |
| emulation | | |
+-----------------+------------------------+-----------------------------+
In general, consult the source files for license terms.

150
mesa210-radeonsi/PKGBUILD Normal file
View file

@ -0,0 +1,150 @@
if [ -z ${_llvm+x} ]; then
_llvm=
fi
#######################################
#Set '1' to build with GCC
#Set '2' to build with CLANG
#Default is empty. It will build with GCC. To build with different compiler just use : env _compiler=(1 or 2) makepkg -s
if [ -z ${_compiler+x} ]; then
_compiler=
fi
#######################################
pkgname=mesa210
pkgdesc='An open-source implementation of the OpenGL specification. (stable release)'
pkgver=21.0.2
pkgrel=2
arch=('x86_64')
url="https://mesa3d.org/"
license=('MIT')
makedepends=('meson' 'ninja' 'bison' 'flex' 'python' 'python-mako' 'python-appdirs' 'python-evdev' 'lua' 'polly' 'valgrind'
'xorgproto' 'wayland-protocols' 'glslang' 'libclc' 'elfutils' 'libarchive' 'libconfig' 'compiler-rt' 'libxcb'
'wayland' 'libxml2' 'libx11' 'libvdpau' 'libelf' 'libglvnd' 'ncurses' 'libva' 'libxrandr' 'expat' 'libdrm' 'libxvmc'
'libepoxy' 'libxv' 'libxshmfence' 'libxxf86vm' 'libxdamage' 'zstd' 'lm_sensors' 'libunwind' 'vulkan-icd-loader'
'llvm' 'clang' 'llvm-libs' 'glibc' 'gcc' 'gcc-libs' 'libomxil-bellagio')
depends=('libdrm' 'libxcb' 'wayland' 'python' 'libclc' 'clang' 'libx11' 'libxshmfence' 'zstd' 'libelf' 'llvm-libs' 'expat' 'libxxf86vm'
'libxdamage' 'libomxil-bellagio' 'libunwind' 'lm_sensors' 'libglvnd' 'vulkan-icd-loader' 'clang' 'gcc-libs' 'gcc'
'glslang')
source=("https://archive.mesa3d.org/mesa-$pkgver.tar.xz"
"swr-llvm13-patch1.patch"
"swr-llvm13-patch2.patch"
"ac_llvm_helper.patch"
"aco_instruction_selection.patch"
"LICENSE")
md5sums=("SKIP"
"SKIP"
"SKIP"
"SKIP"
"SKIP"
"SKIP")
if [[ $_llvm = "y" ]]; then
source+=("0001-enable-llvm-by-default.patch")
md5sums+=("SKIP") #0001-enable-llvm-by-default.patch
fi
# clover patch for llvm 12.0.0 and 13.0.0. Not commited in master branch for now
source+=("0001-4114.patch"
"0001-4200.patch")
md5sums+=("SKIP"
"SKIP")
prepare(){
cd mesa-$pkgver
# Apply any patch
local src
for src in "${source[@]}"; do
src="${src%%::*}"
src="${src##*/}"
[[ $src = *.patch ]] || continue
msg2 "Applying patch $src..."
patch -Np1 < "../$src"
done
}
build(){
if [[ $_compiler = "1" ]]; then
export CC='gcc'
export CXX='g++'
elif [[ $_compiler = "2" ]]; then
export CC='clang'
export CXX='clang++'
else
export CC='gcc'
export CXX='g++'
fi
cd mesa-$pkgver
# rm -rf -v build_64
# mkdir -p -v build_64
meson setup build_64/ \
-D b_ndebug=true \
-D buildtype=plain \
--wrap-mode=nofallback \
-Dprefix=/opt/mesa210 \
-D sysconfdir=/etc \
-Dplatforms=x11,wayland \
-Ddri3=enabled \
-Ddri-drivers= \
-Dgallium-drivers=radeonsi \
-Dgallium-extra-hud=true \
-Dgallium-vdpau=enabled \
-Dgallium-omx=bellagio \
-Dgallium-va=enabled \
-Dgallium-opencl=icd \
-Dopencl-spirv=false \
-Dopencl-native=true \
-Dvulkan-drivers=amd \
-Dshader-cache=enabled \
-Dvulkan-overlay-layer=true \
-Dvulkan-device-select-layer=true \
-Dshared-glapi=enabled \
-Dgles1=enabled \
-Dgles2=enabled \
-Dopengl=true \
-Dgbm=enabled \
-Dglx=dri \
-Degl=enabled \
-Dglvnd=true \
-Dmicrosoft-clc=disabled \
-Dspirv-to-dxil=false \
-Dllvm=enabled \
-Dshared-llvm=enabled \
-Dvalgrind=enabled \
-Dlibunwind=enabled \
-Dlmsensors=enabled \
-Dselinux=false \
-Dswr-arches=avx,avx2,knl,skx \
-Dshared-swr=true \
-Dxlib-lease=enabled \
-Dglx-direct=true \
-Dzstd=enabled \
-Dzlib=enabled \
-Dsse2=false
meson configure build_64/
meson compile -C build_64/
ninja -C build_64/
}
package(){
# compiling mesa and installing to "$pkgdir"
DESTDIR="${pkgdir}" ninja -C mesa-$pkgver/build_64/ install
# remove script file from /usr/bin
rm "${pkgdir}/opt/mesa210/bin/mesa-overlay-control.py"
rm -rf -v "${pkgdir}/usr/bin"
# indirect rendering
ln -s /opt/mesa210/lib/libGLX_mesa.so.0 "${pkgdir}/opt/mesa210/lib/libGLX_indirect.so.0"
# installing license
install -Dt "$pkgdir"/opt/mesa210/share/licenses/"$pkgname" -m644 LICENSE
}

View file

@ -0,0 +1,24 @@
diff --git a/src/amd/llvm/ac_llvm_helper.cpp b/src/amd/llvm/ac_llvm_helper.cpp
index ebeafaea5539545767377e5f5da5c8b3af16dae0..0ab9517f431900c4724a6c8c0a064b10879b8ba3 100644
--- a/src/amd/llvm/ac_llvm_helper.cpp
+++ b/src/amd/llvm/ac_llvm_helper.cpp
@@ -321,6 +321,9 @@ LLVMValueRef ac_build_atomic_rmw(struct ac_llvm_context *ctx, LLVMAtomicRMWBinOp
unsigned SSID = llvm::unwrap(ctx->context)->getOrInsertSyncScopeID(sync_scope);
return llvm::wrap(llvm::unwrap(ctx->builder)
->CreateAtomicRMW(binop, llvm::unwrap(ptr), llvm::unwrap(val),
+#if LLVM_VERSION_MAJOR >= 13
+ llvm::MaybeAlign(0),
+#endif
llvm::AtomicOrdering::SequentiallyConsistent, SSID));
}
@@ -331,6 +334,9 @@ LLVMValueRef ac_build_atomic_cmp_xchg(struct ac_llvm_context *ctx, LLVMValueRef
return llvm::wrap(llvm::unwrap(ctx->builder)
->CreateAtomicCmpXchg(llvm::unwrap(ptr), llvm::unwrap(cmp),
llvm::unwrap(val),
+#if LLVM_VERSION_MAJOR >= 13
+ llvm::MaybeAlign(0),
+#endif
llvm::AtomicOrdering::SequentiallyConsistent,
llvm::AtomicOrdering::SequentiallyConsistent, SSID));
}

View file

@ -0,0 +1,12 @@
diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp
index e350cf42..c3bec5ab 100644
--- a/src/amd/compiler/aco_instruction_selection.cpp
+++ b/src/amd/compiler/aco_instruction_selection.cpp
@@ -29,6 +29,7 @@
#include <map>
#include <numeric>
#include <stack>
+#include <utility>
#include "ac_shader_util.h"
#include "aco_ir.h"

View file

@ -0,0 +1,92 @@
From a20dc1dd150a6c31153197ceda01827daab4203e Mon Sep 17 00:00:00 2001
From: Vinson Lee <vlee@freedesktop.org>
Date: Wed, 23 Jun 2021 21:58:08 -0700
Subject: [PATCH] swr: Fix build with llvm-13.
Fix build after llvm-13 commit 3302af9d4c39 ("Support: Remove
F_{None,Text,Append} compatibility synonyms, NFC").
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
---
.../swr/rasterizer/jitter/JitManager.cpp | 24 +++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp b/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp
index 44482939c76..2487f754dc1 100644
--- a/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp
+++ b/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp
@@ -437,7 +437,11 @@ void JitManager::DumpAsm(Function* pFunction, const char* fileName)
sprintf(fName, "%s.%s.asm", funcName, fileName);
#endif
+#if LLVM_VERSION_MAJOR >= 13
+ raw_fd_ostream filestream(fName, EC, llvm::sys::fs::OF_None);
+#else
raw_fd_ostream filestream(fName, EC, llvm::sys::fs::F_None);
+#endif
legacy::PassManager* pMPasses = new legacy::PassManager();
auto* pTarget = mpExec->getTargetMachine();
@@ -490,7 +494,11 @@ void JitManager::DumpToFile(Module* M,
#else
sprintf(fName, "%s.%s.ll", funcName, fileName);
#endif
+#if LLVM_VERSION_MAJOR >= 13
+ raw_fd_ostream fd(fName, EC, llvm::sys::fs::OF_None);
+#else
raw_fd_ostream fd(fName, EC, llvm::sys::fs::F_None);
+#endif
M->print(fd, annotater);
fd.flush();
}
@@ -512,7 +520,11 @@ void JitManager::DumpToFile(Function* f, const char* fileName)
#else
sprintf(fName, "%s.%s.ll", funcName, fileName);
#endif
+#if LLVM_VERSION_MAJOR >= 13
+ raw_fd_ostream fd(fName, EC, llvm::sys::fs::OF_None);
+#else
raw_fd_ostream fd(fName, EC, llvm::sys::fs::F_None);
+#endif
f->print(fd, nullptr);
#if defined(_WIN32)
@@ -522,7 +534,11 @@ void JitManager::DumpToFile(Function* f, const char* fileName)
#endif
fd.flush();
+#if LLVM_VERSION_MAJOR >= 13
+ raw_fd_ostream fd_cfg(fName, EC, llvm::sys::fs::OF_Text);
+#else
raw_fd_ostream fd_cfg(fName, EC, llvm::sys::fs::F_Text);
+#endif
WriteGraph(fd_cfg, (const Function*)f);
fd_cfg.flush();
@@ -726,7 +742,11 @@ void JitCache::notifyObjectCompiled(const llvm::Module* M, llvm::MemoryBufferRef
{
std::error_code err;
+#if LLVM_VERSION_MAJOR >= 13
+ llvm::raw_fd_ostream fileObj(objPath.c_str(), err, llvm::sys::fs::OF_None);
+#else
llvm::raw_fd_ostream fileObj(objPath.c_str(), err, llvm::sys::fs::F_None);
+#endif
fileObj << Obj.getBuffer();
fileObj.flush();
}
@@ -734,7 +754,11 @@ void JitCache::notifyObjectCompiled(const llvm::Module* M, llvm::MemoryBufferRef
{
std::error_code err;
+#if LLVM_VERSION_MAJOR >= 13
+ llvm::raw_fd_ostream fileObj(filePath.c_str(), err, llvm::sys::fs::OF_None);
+#else
llvm::raw_fd_ostream fileObj(filePath.c_str(), err, llvm::sys::fs::F_None);
+#endif
uint32_t objcrc = ComputeCRC(0, Obj.getBufferStart(), Obj.getBufferSize());
--
GitLab

View file

@ -0,0 +1,129 @@
From 98859f67c3d54c9c6d8bbf55251717cbe3511f4e Mon Sep 17 00:00:00 2001
From: Grigory Vasilyev <h0tc0d3@gmail.com>
Date: Fri, 8 Oct 2021 15:26:49 +0300
Subject: [PATCH] Fix swr build with LLVM 13
---
.../swr/rasterizer/jitter/builder_mem.cpp | 12 +++++++++++
.../swr/rasterizer/jitter/builder_mem.h | 4 ++++
src/gallium/drivers/swr/swr_shader.cpp | 20 ++++++++++++++-----
3 files changed, 31 insertions(+), 5 deletions(-)
diff --git a/src/gallium/drivers/swr/rasterizer/jitter/builder_mem.cpp b/src/gallium/drivers/swr/rasterizer/jitter/builder_mem.cpp
index b5eb0a782b1..ff0672cfd14 100644
--- a/src/gallium/drivers/swr/rasterizer/jitter/builder_mem.cpp
+++ b/src/gallium/drivers/swr/rasterizer/jitter/builder_mem.cpp
@@ -82,7 +82,11 @@ namespace SwrJit
std::vector<Value*> indices;
for (auto i : indexList)
indices.push_back(i);
+#if LLVM_VERSION_MAJOR >= 13
+ return IN_BOUNDS_GEP(ptr->getType(), ptr, indices);
+#else
return IN_BOUNDS_GEP(ptr, indices);
+#endif
}
Value* Builder::IN_BOUNDS_GEP(Value* ptr, const std::initializer_list<uint32_t>& indexList)
@@ -90,7 +94,11 @@ namespace SwrJit
std::vector<Value*> indices;
for (auto i : indexList)
indices.push_back(C(i));
+#if LLVM_VERSION_MAJOR >= 13
+ return IN_BOUNDS_GEP(ptr->getType(), ptr, indices);
+#else
return IN_BOUNDS_GEP(ptr, indices);
+#endif
}
LoadInst* Builder::LOAD(Value* Ptr, const char* Name, Type* Ty, MEM_CLIENT usage)
@@ -234,7 +242,11 @@ namespace SwrJit
/// @param pVecPassthru - SIMD wide vector of values to load when lane is inactive
Value* Builder::GATHER_PTR(Value* pVecSrcPtr, Value* pVecMask, Value* pVecPassthru)
{
+#if LLVM_VERSION_MAJOR >= 13
+ return MASKED_GATHER(pVecSrcPtr->getType(), pVecSrcPtr, AlignType(4), pVecMask, pVecPassthru);
+#else
return MASKED_GATHER(pVecSrcPtr, AlignType(4), pVecMask, pVecPassthru);
+#endif
}
void Builder::SCATTER_PTR(Value* pVecDstPtr, Value* pVecSrc, Value* pVecMask)
diff --git a/src/gallium/drivers/swr/rasterizer/jitter/builder_mem.h b/src/gallium/drivers/swr/rasterizer/jitter/builder_mem.h
index 429d5779a4d..c6cfb812b81 100644
--- a/src/gallium/drivers/swr/rasterizer/jitter/builder_mem.h
+++ b/src/gallium/drivers/swr/rasterizer/jitter/builder_mem.h
@@ -84,7 +84,11 @@ virtual CallInst* MASKED_LOAD(Value* Ptr,
Type* Ty = nullptr,
MEM_CLIENT usage = MEM_CLIENT::MEM_CLIENT_INTERNAL)
{
+#if LLVM_VERSION_MAJOR >= 13
+ return IRB()->CreateMaskedLoad(Ptr->getType(), Ptr, AlignType(Align), Mask, PassThru, Name);
+#else
return IRB()->CreateMaskedLoad(Ptr, AlignType(Align), Mask, PassThru, Name);
+#endif
}
virtual StoreInst* STORE(Value *Val, Value *Ptr, bool isVolatile = false, Type* Ty = nullptr, MEM_CLIENT usage = MEM_CLIENT::MEM_CLIENT_INTERNAL)
diff --git a/src/gallium/drivers/swr/swr_shader.cpp b/src/gallium/drivers/swr/swr_shader.cpp
index 315036920fb..26e967759cd 100644
--- a/src/gallium/drivers/swr/swr_shader.cpp
+++ b/src/gallium/drivers/swr/swr_shader.cpp
@@ -1553,7 +1553,9 @@ BuilderSWR::CompileGS(struct swr_context *ctx, swr_jit_gs_key &key)
GlobalValue::ExternalLinkage,
"GS",
JM()->mpCurrentModule);
-#if LLVM_VERSION_MAJOR < 5
+#if LLVM_VERSION_MAJOR >= 13
+ pFunction->addParamAttrs(AttributeList::FunctionIndex, attrBuilder);
+#elif LLVM_VERSION_MAJOR < 5
AttributeSet attrSet = AttributeSet::get(
JM()->mContext, AttributeSet::FunctionIndex, attrBuilder);
pFunction->addAttributes(AttributeSet::FunctionIndex, attrSet);
@@ -1781,7 +1783,9 @@ BuilderSWR::CompileTES(struct swr_context *ctx, swr_jit_tes_key &key)
"TES",
JM()->mpCurrentModule);
-#if LLVM_VERSION_MAJOR < 5
+#if LLVM_VERSION_MAJOR >= 13
+ pFunction->addParamAttrs(AttributeList::FunctionIndex, attrBuilder);
+#elif LLVM_VERSION_MAJOR < 5
AttributeSet attrSet = AttributeSet::get(
JM()->mContext, AttributeSet::FunctionIndex, attrBuilder);
pFunction->addAttributes(AttributeSet::FunctionIndex, attrSet);
@@ -2082,7 +2086,9 @@ BuilderSWR::CompileTCS(struct swr_context *ctx, swr_jit_tcs_key &key)
"TCS",
JM()->mpCurrentModule);
-#if LLVM_VERSION_MAJOR < 5
+#if LLVM_VERSION_MAJOR >= 13
+ pFunction->addParamAttrs(AttributeList::FunctionIndex, attrBuilder);
+#elif LLVM_VERSION_MAJOR < 5
AttributeSet attrSet = AttributeSet::get(
JM()->mContext, AttributeSet::FunctionIndex, attrBuilder);
pFunction->addAttributes(AttributeSet::FunctionIndex, attrSet);
@@ -2337,7 +2343,9 @@ BuilderSWR::CompileVS(struct swr_context *ctx, swr_jit_vs_key &key)
GlobalValue::ExternalLinkage,
"VS",
JM()->mpCurrentModule);
-#if LLVM_VERSION_MAJOR < 5
+#if LLVM_VERSION_MAJOR >= 13
+ pFunction->addParamAttrs(AttributeList::FunctionIndex, attrBuilder);
+#elif LLVM_VERSION_MAJOR < 5
AttributeSet attrSet = AttributeSet::get(
JM()->mContext, AttributeSet::FunctionIndex, attrBuilder);
pFunction->addAttributes(AttributeSet::FunctionIndex, attrSet);
@@ -2642,7 +2650,9 @@ BuilderSWR::CompileFS(struct swr_context *ctx, swr_jit_fs_key &key)
GlobalValue::ExternalLinkage,
"FS",
JM()->mpCurrentModule);
-#if LLVM_VERSION_MAJOR < 5
+#if LLVM_VERSION_MAJOR >= 13
+ pFunction->addParamAttrs(AttributeList::FunctionIndex, attrBuilder);
+#elif LLVM_VERSION_MAJOR < 5
AttributeSet attrSet = AttributeSet::get(
JM()->mContext, AttributeSet::FunctionIndex, attrBuilder);
pFunction->addAttributes(AttributeSet::FunctionIndex, attrSet);
--
GitLab

View file

@ -26,17 +26,19 @@ makedepends=('meson' 'ninja' 'bison' 'flex' 'python' 'python-mako' 'python-appdi
'libepoxy' 'libxv' 'libxshmfence' 'libxxf86vm' 'libxdamage' 'zstd' 'lm_sensors' 'libunwind' 'vulkan-icd-loader'
'llvm' 'clang' 'llvm-libs' 'glibc' 'gcc' 'gcc-libs' 'libomxil-bellagio')
depends=('libdrm' 'libxcb' 'wayland' 'python' 'libclc' 'clang' 'libx11' 'libxshmfence' 'zstd' 'libelf' 'llvm-libs' 'expat' 'libxxf86vm'
'libxdamage' 'libomxil-bellagio' 'libunwind' 'lm_sensors' 'libglvnd' 'vulkan-icd-loader' 'llvm' 'clang' 'gcc-libs' 'gcc'
'libxdamage' 'libomxil-bellagio' 'libunwind' 'lm_sensors' 'libglvnd' 'vulkan-icd-loader' 'clang' 'gcc-libs' 'gcc'
'glslang')
source=("https://archive.mesa3d.org/mesa-$pkgver.tar.xz"
"swr-llvm13-patch1.patch"
"swr-llvm13-patch2.patch"
"ac_llvm_helper.patch"
"aco_instruction_selection.patch"
"LICENSE")
md5sums=("SKIP"
"SKIP"
"SKIP"
"SKIP"
"SKIP"
"SKIP")
if [[ $_llvm = "y" ]]; then
source+=("0001-enable-llvm-by-default.patch")

View file

@ -0,0 +1,12 @@
diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp
index e350cf42..c3bec5ab 100644
--- a/src/amd/compiler/aco_instruction_selection.cpp
+++ b/src/amd/compiler/aco_instruction_selection.cpp
@@ -29,6 +29,7 @@
#include <map>
#include <numeric>
#include <stack>
+#include <utility>
#include "ac_shader_util.h"
#include "aco_ir.h"