summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md39
-rwxr-xr-xdeqp-run25
-rwxr-xr-xmesa-debug-asan5
-rwxr-xr-xmesa-run60
4 files changed, 89 insertions, 40 deletions
diff --git a/README.md b/README.md
index c2573b3..1de4868 100644
--- a/README.md
+++ b/README.md
@@ -4,8 +4,8 @@ A collection of scripts to build and test [Mesa](https://www.mesa3d.org/) withou
## Scripts
-- [nj](nj) - Run [ninja](https://github.com/ninja-build/ninja) from anywhere in the project git repository. (upstream: [nj repo](gitlab.freedesktop.org/kwg/nj))
-- [mesa-run](mesa-run) - helper script. Not used directly. Requires [jq](https://github.com/jqlang/jq)
+- [nj](nj) - Run [ninja](https://github.com/ninja-build/ninja) from anywhere in the project git repository. (upstream: [nj repo](https://gitlab.freedesktop.org/kwg/nj))
+- [mesa-run](mesa-run) - helper script. Not used directly.
- [mesa-debug](mesa-debug) - Debug build
- [mesa-debug-asan](mesa-debug-asan) - Debug build with [AddressSanitizer](https://github.com/google/sanitizers/wiki/AddressSanitizer)
- [mesa-debug-optimized](mesa-debug-optimized) - Debug build with optimization
@@ -18,15 +18,15 @@ A collection of scripts to build and test [Mesa](https://www.mesa3d.org/) withou
### Configure and build debug build
-```sh
-mesa-debug configure
-nj debug install
+```console
+$ mesa-debug configure
+$ nj debug install
```
### Run program with local Mesa build
-```sh
-mesa-debug glxinfo
+```console
+$ mesa-debug glxinfo
```
### Run dEQP
@@ -37,20 +37,33 @@ On desktop Linux, `deqp-run` should be run from a git checkout of [VK-GL-CTS](ht
#### Single test
-```sh
-deqp-run dEQP-VK.graphicsfuzz.spv-stable-pillars-volatile-nontemporal-store
+```console
+$ deqp-run dEQP-VK.graphicsfuzz.spv-stable-pillars-volatile-nontemporal-store
```
#### Test suite
-```sh
-deqp-run vk
+```console
+$ deqp-run vk
+```
+
+#### Full command
+
+```console
+$ deqp-run --cmd vk
+deqp-runner run --caselist [...]
+```
+
+Particularly useful for running a single test under `gdb`:
+
+```console
+$ mesa-gdb $(deqp-run --cmd dEQP-VK.graphicsfuzz.spv-stable-pillars-volatile-nontemporal-store)
```
### Make Markdown table of dEQP test results
-```sh
-deqp-results-to-markdown
+```console
+$ deqp-results-to-markdown
```
#### Example output
diff --git a/deqp-run b/deqp-run
index 3dd33cc..63f59a6 100755
--- a/deqp-run
+++ b/deqp-run
@@ -21,11 +21,11 @@ readonly -A LINUX_DEQP_BIN=(
[gles31]=build/modules/gles31/deqp-gles31
)
readonly -A CHROMEOS_DEQP_CASELIST=(
- [vk]=/usr/local/deqp/caselists/vk.txt
- [egl]=/usr/local/deqp/caselists/egl.txt
- [gles2]=/usr/local/deqp/caselists/gles2.txt
- [gles3]=/usr/local/deqp/caselists/gles3.txt
- [gles31]=/usr/local/deqp/caselists/gles31.txt
+ [vk]=/usr/local/deqp/caselists/vk.txt.zst
+ [egl]=/usr/local/deqp/caselists/egl.txt.zst
+ [gles2]=/usr/local/deqp/caselists/gles2.txt.zst
+ [gles3]=/usr/local/deqp/caselists/gles3.txt.zst
+ [gles31]=/usr/local/deqp/caselists/gles31.txt.zst
)
readonly -A LINUX_DEQP_CASELIST=(
@@ -48,6 +48,12 @@ readonly -a DEQP_OPTIONS=(
--deqp-visibility=hidden
)
+mode=execute
+if [[ $1 == --cmd ]]; then
+ mode=print-command
+ shift
+fi
+
if [[ $# -eq 1 ]]; then
if [[ $1 == dEQP-* ]]; then
single_test="$1"
@@ -90,6 +96,10 @@ DEQP_BIN="$(realpath "${DEQP_BIN}")"
if [[ -n $single_test ]]; then
cd "$(dirname "${DEQP_BIN}")" || die "can't cd"
+ if [[ $mode == print-command ]]; then
+ echo "${DEQP_BIN}" "${DEQP_OPTIONS[@]}" -n "${single_test}"
+ exit
+ fi
exec "${DEQP_BIN}" "${DEQP_OPTIONS[@]}" -n "${single_test}"
fi
@@ -112,7 +122,12 @@ DEQP_RUNNER_ARGS=(
--caselist "${CASELIST}"
--deqp "${DEQP_BIN}"
--testlog-to-xml "${TESTLOG_TO_XML}"
+ --timeout 360
--output "${OUTPUT_DIR}"
)
+if [[ $mode == print-command ]]; then
+ echo deqp-runner run "${DEQP_RUNNER_ARGS[@]}" -- "${DEQP_OPTIONS[@]}"
+ exit
+fi
exec deqp-runner run "${DEQP_RUNNER_ARGS[@]}" -- "${DEQP_OPTIONS[@]}"
diff --git a/mesa-debug-asan b/mesa-debug-asan
index 3ff7dce..cfd7928 100755
--- a/mesa-debug-asan
+++ b/mesa-debug-asan
@@ -4,6 +4,9 @@ export cflags="-ggdb3 -O0 -march=native -pipe"
export cxxflags="${cflags}"
export buildtype=debug
export builddir=~/projects/mesa/build-debug-asan
-export extra_args=(-Db_sanitize="address,undefined")
+export extra_args="-Db_sanitize=address,undefined:-Db_lundef=false"
+
+export GCC_ASAN_PRELOAD=$(gcc -print-file-name=libasan.so)
+export CLANG_ASAN_PRELOAD=$(clang -print-file-name=libclang_rt.asan-x86_64.so)
exec mesa-run "$@"
diff --git a/mesa-run b/mesa-run
index 1f8c2d9..274c18b 100755
--- a/mesa-run
+++ b/mesa-run
@@ -8,17 +8,19 @@ die() {
[[ -z ${builddir} ]] && die "builddir must be set"
prefix="${builddir}"/install
+IFS=: read -r -a extra_args <<< "${extra_args}"
+
machine=$(uname -m)
case "$machine" in
x86_64)
- vk_icd="intel_icd.${machine}.json"
vulkan_drivers=intel
gallium_drivers=iris
tools=drm-shim,intel
- extra_args+=(-Dintel-clc=enabled)
+ extra_args+=(
+ -Dintel-rt=disabled
+ )
;;
aarch64|arm*)
- vk_icd="freedreno_icd.${machine}.json"
vulkan_drivers=freedreno
gallium_drivers=freedreno
tools=drm-shim,freedreno
@@ -28,35 +30,59 @@ esac
case "$1" in
wipe|wipeout)
echo "Removing ${builddir}"
- exec meson setup --wipe "${builddir}"
- ;;
+ rm -r "${builddir}"
+ ;&
configure)
- export LLVM_MAJOR_VERSION="16"
- export LLVM_CONFIG="/usr/lib/llvm/${LLVM_MAJOR_VERSION}/bin/llvm-config"
+ export LLVM_MAJOR_VERSION="20"
+ llvm_config_paths=(
+ "/usr/bin/llvm-config-${LLVM_MAJOR_VERSION}"
+ "/usr/lib/llvm/${LLVM_MAJOR_VERSION}/bin/llvm-config"
+ )
+ for llvm_config in "${llvm_config_paths[@]}"; do
+ if [[ -x "${llvm_config}" ]]; then
+ export LLVM_CONFIG="${llvm_config}"
+ break
+ fi
+ done
+
+ llvm_pkg_config_paths=(
+ "/usr/lib/llvm/${LLVM_MAJOR_VERSION}/lib64/pkgconfig"
+ "/usr/lib/x86_64-linux-gnu/pkgconfig"
+ )
+ for llvm_pkg_config_path in "${llvm_pkg_config_paths[@]}"; do
+ if [[ -f "${llvm_pkg_config_path}/LLVMSPIRVLib.pc" ]]; then
+ export LLVM_CONFIG="${llvm_config}"
+ spirv_llvm_translator_pkg_config_path="${llvm_pkg_config_path}"
+ break
+ fi
+ done
+
#export CC="/usr/lib/llvm/${LLVM_MAJOR_VERSION}/bin/clang"
#export CXX="/usr/lib/llvm/${LLVM_MAJOR_VERSION}/bin/clang++"
#export CC_LD="/usr/lib/llvm/${LLVM_MAJOR_VERSION}/bin/lld"
#export CXX_LD="${CC_LD}"
+ export CC_LD="mold"
+ export CXX_LD="mold"
args=(
- --pkg-config-path "/usr/lib/llvm/${LLVM_MAJOR_VERSION}/lib64/pkgconfig"
+ --pkg-config-path "${spirv_llvm_translator_pkg_config_path}"
-Dprefix="${prefix}"
-Dc_args="${cflags}"
-Dcpp_args="${cxxflags}"
-Dtools="${tools}"
- -Dbuild-tests=true
+ -Dbuild-tests=false
-Dvulkan-drivers="${vulkan_drivers}"
-Dgallium-drivers="${gallium_drivers}"
-Dgallium-rusticl=false
- -Dgallium-va=auto
- -Dgallium-xa=disabled
- -Dvideo-codecs="vc1dec,h264dec,h264enc,h265dec,h265enc"
+ -Dgallium-va=disabled
+ -Dintel-elk=false
-Dvulkan-beta=true
-Dbuildtype="${buildtype}"
-Dbackend=ninja
"${extra_args[@]}"
"${builddir}"
)
+ echo meson setup --reconfigure "${args[@]}"
exec meson setup --reconfigure "${args[@]}"
;;
build)
@@ -64,12 +90,4 @@ build)
;;
esac
-if ! command -v jq &> /dev/null; then
- die "jq needs to be installed"
-fi
-
-libdir=$(jq -r '.[] | select(.name == "libdir").value' "${builddir}"/meson-info/intro-buildoptions.json)
-export LD_LIBRARY_PATH="${prefix}/${libdir}:${LD_LIBRARY_PATH}"
-export LIBGL_DRIVERS_PATH="${prefix}/${libdir}"/dri
-export VK_ICD_FILENAMES="${prefix}"/share/vulkan/icd.d/"${vk_icd}"
-exec "$@"
+LD_PRELOAD="${GCC_ASAN_PRELOAD}" exec meson devenv -C "${builddir}" -w "${PWD}" "$@"