From abfc6360542cb480122313a36f6ed02c08074ed5 Mon Sep 17 00:00:00 2001 From: hgn Date: Fri, 16 Jul 2021 11:51:31 +0100 Subject: [PATCH 1/1] release mode flag for build script --- build.sh | 25 +++++++++++++++++++++---- csRadar.c | 1 + csRadar.h | 3 +++ ext_csr_free.c | 11 +++++++++++ 4 files changed, 36 insertions(+), 4 deletions(-) diff --git a/build.sh b/build.sh index 33bbae0..5159499 100755 --- a/build.sh +++ b/build.sh @@ -1,6 +1,23 @@ + +flags="-ggdb3 -Wall -fsanitize=address" + +while (( "$#" )); do + case $1 in + -r|--release) + flags="-Wall -O3" + echo "Release mode" + ;; + *) + echo "Unkown param: $1" + exit 1 + ;; + esac + shift +done + mkdir -p ext -echo gcc -ggdb3 -Wall -fsanitize=address -rdynamic csRadar.c -o csRadar -lm -ldl -gcc -ggdb3 -Wall -fsanitize=address -rdynamic csRadar.c -o csRadar -lm -ldl +echo build: csRadar +gcc $flags -rdynamic csRadar.c -o csRadar -lm -ldl -echo -ggdb3 -Wall -fsanitize=address -fpic -shared -o ext/csRadarFree.so ext_csr_free.c -lm -gcc -ggdb3 -Wall -fsanitize=address -fpic -shared -o ext/csRadarFree.so ext_csr_free.c -lm +echo build: ext/csRadarFree.so +gcc $flags -fpic -shared -o ext/csRadarFree.so ext_csr_free.c -lm diff --git a/csRadar.c b/csRadar.c index 9af5cda..1125373 100644 --- a/csRadar.c +++ b/csRadar.c @@ -107,6 +107,7 @@ int main( int argc, char *argv[] ) " -g Required if you are loading models\n" " -r 1024 Output resolution\n" " -o Specify output name/path\n" + " -e Same as default arg, but instead filters for entity class\n" " --padding=128 When cropping radar, add padding units to border\n" //" --standard-layers Use standard TAR layers/groups\n" " --write-normals Enable normals as an output stream\n" diff --git a/csRadar.h b/csRadar.h index 95e1048..36c00f8 100644 --- a/csRadar.h +++ b/csRadar.h @@ -49,6 +49,9 @@ struct csr_api char vmf_name[ 128 ]; // Just the base name eg. my_map EMSAA sampling_mode; + int write_normals; + int write_origins; + // Main API interface vmf_map *map; csr_target target; diff --git a/ext_csr_free.c b/ext_csr_free.c index 5873802..f6b0b85 100644 --- a/ext_csr_free.c +++ b/ext_csr_free.c @@ -27,6 +27,17 @@ void csr_ext_main( csr_api *api ) { if( !csr_init( api ) ) return; + + // Setup shader variants + if( api->write_origins ) + { + // Use origin fragment variant + } + + if( api->write_normals ) + { + // Increase stride + } csr_create_target( &api->target, api->resolution, api->resolution, api->sampling_mode, &shader_gbuffer ); csr_rt_clear( &api->target ); -- 2.25.1