Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
c5eab43423 | |||
288d5002f3 | |||
39f3fa7d5b | |||
cf909a81db | |||
f0d99f8f54 | |||
9770391bc4 | |||
eb328fc2df | |||
7e91f70e02 | |||
9c72741e69 | |||
660dd63792 |
5
.gitignore
vendored
5
.gitignore
vendored
@ -20,9 +20,14 @@ libraries/source/cxxtest-4.4/*
|
||||
libraries/source/fcollada/*
|
||||
libraries/source/nvtt/*
|
||||
libraries/source/spidermonkey/*
|
||||
libraries/source/spirv-reflect/*
|
||||
!libraries/source/**/build.sh
|
||||
!libraries/source/**/patches/
|
||||
|
||||
# Tools
|
||||
archives/
|
||||
source/tools/spirv/rules.*.json
|
||||
|
||||
# premake5 build files, adapted from upstream
|
||||
build/premake/premake5/**/.gitignore
|
||||
build/premake/premake5/**/.travis.yml
|
||||
|
@ -344,15 +344,6 @@
|
||||
"dependencies": ["shadows"],
|
||||
"config": "shadowpcf"
|
||||
},
|
||||
{
|
||||
"type": "slider",
|
||||
"label": "Cutoff distance",
|
||||
"tooltip": "Hides shadows beyond a certain distance from a camera.",
|
||||
"dependencies": ["shadows"],
|
||||
"config": "shadowscutoffdistance",
|
||||
"min": 100,
|
||||
"max": 1500
|
||||
},
|
||||
{
|
||||
"type": "boolean",
|
||||
"label": "Cover whole map",
|
||||
@ -360,6 +351,15 @@
|
||||
"dependencies": ["shadows"],
|
||||
"config": "shadowscovermap"
|
||||
},
|
||||
{
|
||||
"type": "slider",
|
||||
"label": "Cutoff distance",
|
||||
"tooltip": "Hides shadows beyond a certain distance from a camera.",
|
||||
"dependencies": ["shadows", { "config": "shadowscovermap", "value": "false" }],
|
||||
"config": "shadowscutoffdistance",
|
||||
"min": 100,
|
||||
"max": 1500
|
||||
},
|
||||
{
|
||||
"type": "boolean",
|
||||
"label": "Water effects",
|
||||
|
@ -56,18 +56,25 @@
|
||||
}
|
||||
],
|
||||
"AINames": [
|
||||
"Cimon",
|
||||
"Aristides",
|
||||
"Xenophon",
|
||||
"Hippias",
|
||||
"Cleisthenes",
|
||||
"Thucydides",
|
||||
"Alcibiades",
|
||||
"Miltiades",
|
||||
"Aristides",
|
||||
"Callias",
|
||||
"Chabrias",
|
||||
"Cimon",
|
||||
"Cleisthenes",
|
||||
"Cleon",
|
||||
"Cleophon",
|
||||
"Conon",
|
||||
"Demosthenes",
|
||||
"Ephialtes",
|
||||
"Hippias",
|
||||
"Miltiades",
|
||||
"Nicias",
|
||||
"Phocion",
|
||||
"Pisistratus",
|
||||
"Thrasybulus",
|
||||
"Demosthenes"
|
||||
"Thucydides",
|
||||
"Xenophon"
|
||||
],
|
||||
"SkirmishReplacements": {
|
||||
"skirmish/units/default_infantry_ranged_b": "units/athen/infantry_slinger_b",
|
||||
|
@ -76,13 +76,16 @@
|
||||
}
|
||||
],
|
||||
"AINames": [
|
||||
"Prasutagus",
|
||||
"Venutius",
|
||||
"Adminius",
|
||||
"Cassivellaunus",
|
||||
"Cogidubnus",
|
||||
"Commius",
|
||||
"Comux",
|
||||
"Adminius",
|
||||
"Dubnovellaunus",
|
||||
"Imanuentius",
|
||||
"Mandubracius",
|
||||
"Prasutagus",
|
||||
"Venutius",
|
||||
"Vosenius"
|
||||
],
|
||||
"SkirmishReplacements": {
|
||||
|
@ -63,6 +63,7 @@
|
||||
"Audax",
|
||||
"Calcus",
|
||||
"Ditalcus",
|
||||
"Litennon",
|
||||
"Minurus",
|
||||
"Olyndicus",
|
||||
"Orison",
|
||||
|
@ -60,16 +60,21 @@
|
||||
}
|
||||
],
|
||||
"AINames": [
|
||||
"Dienekes",
|
||||
"Agis II",
|
||||
"Archidamus",
|
||||
"Lysander",
|
||||
"Pausanias",
|
||||
"Agesilaus",
|
||||
"Agesipolis",
|
||||
"Agis II",
|
||||
"Anaxandridas",
|
||||
"Archidamus",
|
||||
"Cleomenes",
|
||||
"Dienekes",
|
||||
"Echestratus",
|
||||
"Eurycrates",
|
||||
"Eucleidas",
|
||||
"Agesipolis"
|
||||
"Eurybiades",
|
||||
"Eurycrates",
|
||||
"Gylippus",
|
||||
"Leotychidas",
|
||||
"Lysander",
|
||||
"Pausanias"
|
||||
],
|
||||
"SkirmishReplacements": {
|
||||
"skirmish/structures/default_house_10": "structures/{civ}/house",
|
||||
|
@ -127,6 +127,8 @@ pipeline {
|
||||
}
|
||||
steps {
|
||||
ws("workspace/nightly-svn") {
|
||||
bat "del /s /q binaries\\data\\mods\\mod\\shaders\\spirv"
|
||||
bat "del /s /q binaries\\data\\mods\\public\\shaders\\spirv"
|
||||
bat "python source/tools/spirv/compile.py -d binaries/data/mods/mod binaries/data/mods/mod source/tools/spirv/rules.json binaries/data/mods/mod"
|
||||
bat "python source/tools/spirv/compile.py -d binaries/data/mods/mod binaries/data/mods/public source/tools/spirv/rules.json binaries/data/mods/public"
|
||||
}
|
||||
|
@ -811,6 +811,7 @@ GNUTLS_DIR="$(pwd)/gnutls"
|
||||
HOGWEED_LIBS="-L${NETTLE_DIR}/lib -lhogweed" \
|
||||
GMP_CFLAGS="-I${GMP_DIR}/include" \
|
||||
GMP_LIBS="-L${GMP_DIR}/lib -lgmp" \
|
||||
"$HOST_PLATFORM" \
|
||||
--prefix="$INSTALL_DIR" \
|
||||
--enable-shared=no \
|
||||
--without-idn \
|
||||
@ -818,8 +819,10 @@ GNUTLS_DIR="$(pwd)/gnutls"
|
||||
--with-included-libtasn1 \
|
||||
--without-p11-kit \
|
||||
--without-brotli \
|
||||
--without-zstd \
|
||||
--without-tpm2 \
|
||||
--disable-libdane \
|
||||
--disable-tests \
|
||||
--disable-guile \
|
||||
--disable-doc \
|
||||
--disable-tools \
|
||||
--disable-nls
|
||||
|
@ -24,6 +24,7 @@ esac
|
||||
without_nvtt=false
|
||||
with_system_nvtt=false
|
||||
with_system_mozjs=false
|
||||
with_spirv_reflect=false
|
||||
|
||||
JOBS=${JOBS:="-j2"}
|
||||
|
||||
@ -32,6 +33,7 @@ for i in "$@"; do
|
||||
--without-nvtt) without_nvtt=true ;;
|
||||
--with-system-nvtt) with_system_nvtt=true ;;
|
||||
--with-system-mozjs) with_system_mozjs=true ;;
|
||||
--with-spirv-reflect) with_spirv_reflect=true ;;
|
||||
-j*) JOBS=$i ;;
|
||||
esac
|
||||
done
|
||||
@ -67,5 +69,8 @@ if [ "$with_system_mozjs" = "false" ]; then
|
||||
cp source/spidermonkey/bin/* ../binaries/system/
|
||||
fi
|
||||
echo
|
||||
if [ "$with_spirv_reflect" = "true" ]; then
|
||||
./source/spirv-reflect/build.sh || die "spirv-reflect build failed"
|
||||
fi
|
||||
|
||||
echo "Done."
|
||||
|
35
libraries/source/spirv-reflect/build.sh
Executable file
35
libraries/source/spirv-reflect/build.sh
Executable file
@ -0,0 +1,35 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
PV=1.3.290.0
|
||||
LIB_VERSION=${PV}
|
||||
|
||||
if [ -e .already-built ] && [ "$(cat .already-built || true)" = "${LIB_VERSION}" ]; then
|
||||
echo "spirv-reflect is already up to date."
|
||||
exit
|
||||
fi
|
||||
|
||||
# fetch
|
||||
if [ ! -e "vulkan-sdk-${PV}.tar.gz" ]; then
|
||||
curl -fLo "vulkan-sdk-${PV}.tar.gz" \
|
||||
"https://github.com/KhronosGroup/SPIRV-Reflect/archive/refs/tags/vulkan-sdk-${PV}.tar.gz"
|
||||
fi
|
||||
|
||||
# unpack
|
||||
rm -Rf "SPIRV-Reflect-vulkan-sdk-${PV}"
|
||||
tar xf "vulkan-sdk-${PV}.tar.gz"
|
||||
|
||||
# configure
|
||||
cmake -B build -S "SPIRV-Reflect-vulkan-sdk-${PV}" \
|
||||
-DCMAKE_INSTALL_PREFIX="$(realpath . || true)"
|
||||
|
||||
# build
|
||||
cmake --build build
|
||||
|
||||
# install
|
||||
rm -Rf bin
|
||||
cmake --install build
|
||||
|
||||
echo "${LIB_VERSION}" >.already-built
|
20
source/tools/dist/build-archives.sh
vendored
20
source/tools/dist/build-archives.sh
vendored
@ -23,7 +23,7 @@ LANGS="ast ca cs de el en_GB es eu fi fr gd hu id it nl pl pt_BR ru sk sv tr uk"
|
||||
REGEX=$(printf "\|%s" ${LANGS} | cut -c 2-)
|
||||
REGEX=".*/\(${REGEX}\)\.[-A-Za-z0-9_.]\+\.po"
|
||||
|
||||
find binaries/ -name "*.po" | grep -v "$REGEX" | xargs rm -v || die "Error filtering languages."
|
||||
find binaries/ -name "*.po" | grep -v "$REGEX" | xargs rm -fv || die "Error filtering languages."
|
||||
|
||||
# Build archive(s) - don't archive the _test.* mods
|
||||
cd binaries/data/mods || die
|
||||
@ -40,13 +40,21 @@ cd - || die
|
||||
|
||||
BUILD_SHADERS="${BUILD_SHADERS:=true}"
|
||||
if [ "${BUILD_SHADERS}" = true ]; then
|
||||
PYTHON=${PYTHON:=$(command -v python3 || command -v python)}
|
||||
GLSLC=${GLSLC:=$(command -v glslc)}
|
||||
SPIRV_REFLECT=${SPIRV_REFLECT:=$(command -v spirv-reflect)}
|
||||
PYTHON=${PYTHON:=$(command -v python3 || command -v python || true)}
|
||||
GLSLC=${GLSLC:=$(command -v glslc || true)}
|
||||
SPIRV_REFLECT=${SPIRV_REFLECT:=$(command -v spirv-reflect || true)}
|
||||
if [ -e "$(realpath libraries/source/spirv-reflect/bin/spirv-reflect || true)" ]; then
|
||||
: "${SPIRV_REFLECT:=$(realpath libraries/source/spirv-reflect/bin/spirv-reflect || true)}"
|
||||
fi
|
||||
export SPIRV_REFLECT
|
||||
|
||||
[ -n "${PYTHON}" ] || die "Error: python is not available. Install it before proceeding."
|
||||
[ -n "${GLSLC}" ] || die "Error: glslc is not available. Install it with the Vulkan SDK before proceeding."
|
||||
[ -n "${SPIRV_REFLECT}" ] || die "Error: spirv-reflect is not available. Install it with the Vulkan SDK before proceeding."
|
||||
[ -n "${GLSLC}" ] ||
|
||||
die "Error: glslc is not available." \
|
||||
" Install it with the Vulkan SDK or shaderc package before proceeding."
|
||||
[ -n "${SPIRV_REFLECT}" ] ||
|
||||
die "Error: spirv-reflect is not available." \
|
||||
" Install it with the Vulkan SDK or build vendored spirv-reflect before proceeding."
|
||||
|
||||
cd source/tools/spirv || die
|
||||
|
||||
|
@ -25,10 +25,12 @@ import hashlib
|
||||
import itertools
|
||||
import json
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import xml.etree.ElementTree as ET
|
||||
from enum import Enum
|
||||
from pathlib import Path
|
||||
|
||||
import yaml
|
||||
|
||||
@ -124,7 +126,17 @@ def compile_and_reflect(input_mod_path, dependencies, stage, path, out_path, def
|
||||
)
|
||||
execute(command[:-2] + ["-g", "-E", "-o", preprocessor_output_path])
|
||||
raise ValueError(err)
|
||||
ret, out, err = execute(["spirv-reflect", "-y", "-v", "1", output_path])
|
||||
spirv_reflect = os.getenv("SPIRV_REFLECT", "spirv-reflect")
|
||||
if shutil.which(spirv_reflect) is None:
|
||||
spirv_reflect = (
|
||||
Path(__file__).resolve().parent.parent.parent.parent
|
||||
/ "libraries"
|
||||
/ "source"
|
||||
/ "spirv-reflect"
|
||||
/ "bin"
|
||||
/ "spirv-reflect"
|
||||
)
|
||||
ret, out, err = execute([spirv_reflect, "-y", "-v", "1", output_path])
|
||||
if ret:
|
||||
sys.stderr.write(
|
||||
"Command returned {}:\nCommand: {}\nInput path: {}\nOutput path: {}\n"
|
||||
|
Loading…
Reference in New Issue
Block a user