Commit Graph

200 Commits

Author SHA1 Message Date
Eric Wasylishen f3da00395d style: replace (void) with () 2024-02-26 21:07:22 -07:00
Eric Wasylishen 227a92f8a2 build: get rid of "bin" subdirectory 2024-02-04 19:52:16 -07:00
Jonathan Linat 39074b8249
CI: Enable Qt5 + lightpreview (#406)
* chore(CI): refine current 'cmake.yml' file content

* chore(CI): enable Qt5 on Linux and macOS

* Appveyor.yml: remove deploy step

we are deploying from GitHub Actions now

* build-linux-64.sh: adjust .zip wildcard

to hopefully not break on PR builds

* build-linux-64.sh: remove fragile unzip/readelf lines

* lightpreview\CMakeLists.txt: only install Qt on Win/Mac

* lightpreview: attempt to fix mac Qt packaging

* lightpreview: apple fixes

* Install qtdbus on macOS

* try alternate dbus module name

* try cmake find_package for dbus

* also find Qt5PrintSupport

* build-osx.sh: remove coreutils install

we don't use sha256sum anymore

* lightpreview/CMakeLists.txt: create .app bundle on macOS

* Update CMakeLists.txt

* build-*: run cpack as part of the build command

on my macOS test system, running cpack separately
is doubling the build time

* cmake: factor out add_loader_path_to_rpath function, apply to all targets

* chore(CI): add steps to re-pack the 'doc' and 'bin' directories

* chore(CI): remove GitHub release-related step (to be re-introduced)

* chore(CI): adjust inflating destination directories

---------

Co-authored-by: Eric Wasylishen <ewasylishen@gmail.com>
2024-01-08 20:16:41 -07:00
Eric Wasylishen 8ab9960ca0 lightpreview: don't crash when vis is run more than once 2023-12-24 17:22:01 -07:00
Eric Wasylishen 6351cc50e6 rename: vec_t -> double 2023-12-23 21:09:16 -07:00
Eric Wasylishen e9b9999062 vis: factor out duplicate code 2023-12-03 11:41:36 -07:00
Erika b45871efdb
vis algorithm improvement (2h42 -> 57m on ad_dm5) (#361)
* vis algorithm improvement, new commandline option -targetchecks

* vis: only calculate num_expected_targetchecks if needed

Fixes a bit of performance regression when -targetchecks was added, when running
with -targetchecks 0, apparently due to the cost of all the std::popcount's.

gmsp3v2.bsp, 32 threads:
18s (brushbsp branch 9388d43b1c)
21.1s (vis algorithm improvement)
18.2s (this commit)

* vis: default targetchecks to 0.5

gmsp3v2.bsp vis, 32 threads: 18.2s -> 10.6s

---------

Co-authored-by: Eric Wasylishen <ewasylishen@gmail.com>
2023-12-02 13:41:56 -07:00
Erika c94d44ae61 possible alternate fix for #261
Eric: gmsp3v2.bsp vis: 51.96s -> 18.57s (32 threads)
2023-11-11 15:35:49 -07:00
Eric Wasylishen 64daf7ef75 vis: code style updates 2023-11-11 15:03:00 -07:00
Eric Wasylishen 189cc0586c vis:: restore warnings disabled in 74e1a0f6f0 2023-11-11 14:56:15 -07:00
Eric Wasylishen 5bcb2d4657 vis: remove MAX_PORTALS_ON_LEAF
reduces memory use a bit

gmsp3v2.bsp - 51.96s elapsed
2023-11-11 13:10:01 -07:00
Eric Wasylishen e3c6ace7ad vis: code style updates 2023-11-11 12:59:45 -07:00
Eric Wasylishen 57d5b22a95 vis: use size_t when accessing vis winding points
no perf change observed
2023-11-08 22:41:38 -07:00
Eric Wasylishen 54e7aadda7 vis: revert alloca() back to stack storage in ClipStackWinding
- the MAX_WINDING limit was already enforced
- on Windows, alloca() generates __chkstk calls which adds a bit of overhead

gmsp3v2 benchmark (32 threads, 2 runs per config):

before (with alloca): 58.8s, 59.1s
this commit (no alloca): 56.2s, 56.4s
2023-11-08 22:31:52 -07:00
Eric Wasylishen c9edf4ddaa vis: huge speedup from fixing false sharing with stat counters
gmsp3v2.bsp, 32 threads 3950x, 157s -> 61s
2023-11-08 00:05:08 -07:00
Eric Wasylishen e9532346c7 vis: partly fix perf regression of Oct 2021
- drops usage of winding_storage_hybrid
- makes pstack_t trivially default initializable again (like the C
  original)
- we weren't making use of the unlimited size of winding_storage_hybrid;
  the original vis already has an allowance for if a winding exceeds
  the fixed stack allocation size (24) and we were still applying that
  limit

before:

cmake-build-release\tests\tests.exe -r=xml -sf=*benchmark.cc
Testing started at 1:53 PM ...

|               ns/op |                op/s |    err% |     total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
|               45.15 |       22,149,002.06 |    0.1% |      0.01 | `create pstack_t`
|               47.04 |       21,256,429.80 |    0.1% |      0.01 | `create pstack_t + 1x AllocStackWinding`
|               48.28 |       20,710,594.32 |    0.2% |      0.01 | `create pstack_t + 2x AllocStackWinding`
|              128.52 |        7,780,603.30 |    0.3% |      0.01 | `setup + ClipStackWinding`

Benchmark from: https://www.quaddicted.com/tools/vis_benchmark

cmake-build-release\vis\vis.exe -nostate -nopercent gmsp3v2.bsp

153.31s elapsed

after:

cmake-build-release\tests\tests.exe -r=xml -sf=*benchmark.cc
Testing started at 1:46 PM ...

|               ns/op |                op/s |    err% |     total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
|                1.64 |      610,528,630.06 |    0.3% |      0.01 | `create pstack_t`
|                3.29 |      303,895,535.45 |    0.6% |      0.01 | `create pstack_t + 1x AllocStackWinding`
|                5.20 |      192,172,148.84 |    0.2% |      0.01 | `create pstack_t + 2x AllocStackWinding`
|               66.84 |       14,960,818.66 |    1.0% |      0.01 | `setup + ClipStackWinding`

Benchmark from: https://www.quaddicted.com/tools/vis_benchmark

cmake-build-release\vis\vis.exe -nostate -nopercent gmsp3v2.bsp

141.42s elapsed
2023-11-05 13:58:36 -07:00
Eric Wasylishen 872f5fe8a0 build: copy + install mingw dll's libgcc_s_seh-1.dll, libstdc++-6.dll, libwinpthread-1.dll 2023-09-16 14:28:06 -06:00
Eric Wasylishen 7608a78b44 style: use std::min/std::max/std::clamp and remove using 2023-08-07 15:42:29 -06:00
Eric Wasylishen 465e59fc16 apply auto formatting 2023-07-09 15:04:16 -06:00
Eric Wasylishen f28522a077 vis: replace ffsl with std::countr_zero 2023-07-08 20:04:05 -06:00
Eric Wasylishen 50c1e38a27 vis: parallel CalcAmbientSounds 2023-06-19 21:59:06 -06:00
Eric Wasylishen 9c6f6c2589 common: change FError to throw an exception 2023-06-03 22:24:20 -06:00
Random c6ea63ba95
made CMake relative for use as a sub-project within other CMake projects (#356) 2023-05-10 19:45:51 -06:00
Eric Wasylishen ed756bd602 common: add support for writing .rst documentation from settings 2023-04-16 14:55:43 -06:00
Eric Wasylishen e069d7b9b8 style: update settings api to follow current coding style 2023-04-16 11:55:38 -06:00
Eric Wasylishen eda6155844 cleanup: run ./clang-format-all.sh
clang-format version 15.0.7
2023-02-18 22:59:43 -07:00
Eric Wasylishen 8f49cf3894 refactor: Mod_Q1BSP_DecompressVis -> DecompressVis 2023-01-30 19:56:40 -07:00
Eric Wasylishen 912dd0cdeb vis: migrate CalcPHS from DecompressRow to Mod_Q1BSP_DecompressVis 2023-01-30 19:56:37 -07:00
Eric Wasylishen e490eb3ade refactor: move Mod_Q1BSP_DecompressVis to bsputils.cc 2023-01-30 19:56:34 -07:00
Eric Wasylishen 8f79f6a972 vis: rename portal_t -> visportal_t
fixes symbol collision causing crashes on macOS
2022-12-21 01:03:03 -07:00
Eric Wasylishen 331dbfc20d vis: refactor output_group and advanced_group to avoid name clash with light 2022-12-08 21:32:39 -07:00
Eric Wasylishen 2ff9eda020 vis: refactor winding_t -> viswinding_t 2022-12-08 21:29:22 -07:00
Eric Wasylishen 642c4b589c tests: add vis_main() taking std::vector 2022-12-08 21:27:37 -07:00
Eric Wasylishen 9ab4ea8176 Move SetConsoleMode() call to logging::preinitialize(); helper
Don't do ENABLE_VIRTUAL_TERMINAL_INPUT as it breaks arrow key history
navigation in Windows Terminal after running one of the ericw-tools exe's.
2022-11-19 10:05:14 -07:00
ttimo fb459253fe Enable support for ANSI color codes on Windows 10 and newer, without needing to enable system wide. Good for CreateProcess CREATE_NEW_CONSOLE situations. 2022-11-15 11:09:19 -06:00
Eric Wasylishen 2bd2515792 all: cleanup unused includes (Clion - detect not directly used) 2022-10-31 21:37:34 -06:00
Eric Wasylishen 35ffc00462 all: add LIGHT_/QBSP_/VIS_ prefixes to epsilons where necessary 2022-10-30 15:08:10 -06:00
Jonathan eafac17625 Merge branch 'brushbsp' of https://github.com/ericwa/ericw-tools into brushbsp 2022-10-26 10:59:13 -04:00
Jonathan dcef4c6f9c allow vis to use .bsp instead of .map if passed .map at cmd line 2022-10-26 10:59:07 -04:00
Eric Wasylishen 636b376577 squash brushbsp-compilation-speedup branch
move function implementations out of headers
2022-10-21 18:00:58 -06:00
Jonathan 075481a36f add -nocolor for TB, etc
fix crashes on vis and light for invalid options
fix TB and others not receiving output
2022-08-31 12:58:04 -04:00
Eric Wasylishen f3b9de57c6 build: add tbbmalloc 2022-08-09 00:19:39 -06:00
Jonathan 335db1c0e4 move map_source_location to parser as parser_source_location since the locations actually come from there rather than from the map; now the parser keeps track of the location, so it's a bit easier to follow 2022-08-05 23:17:15 -04:00
Jonathan 26a18d5cc3 add logging::header/funcheader to easily and consistently print function or "active routine" headers
add OOP percent_clock wrapper to make printing percents easier, not used yet
2022-08-01 09:35:21 -04:00
Jonathan 1d8a0c1df3 clang-format pass 2022-07-28 06:14:54 -04:00
Eric Wasylishen b7969eee49 vis: rename options -> vis_options 2022-07-10 17:26:55 -06:00
Eric Wasylishen 050886f32c tests: unify tests under one target
to ease sharing code. vis/light tests are going to need the testqbsp infrastructure.
2022-07-10 16:36:15 -06:00
Jonathan 43c5e942b2 move faceextents_t & friends to common
use stb_image_write for PNGs for better compression on bsp.json
add in code for spitting out a lightmap from a face. doesn't support other styles and such yet.
2022-07-08 02:06:06 -04:00
Eric Wasylishen 22f0def4b1 update Catch2 to v3.0.1 2022-06-26 13:21:29 -06:00
Jonathan 1718512b09 remove unnecessary "uncompressed_q2" - can just be a single buffer now
another ptr->vector
2022-06-23 17:08:50 -04:00