chg: fix pacing on --capture

main
Dominik Madarász 2024-04-17 12:14:01 +02:00
parent b5fd58d69b
commit 0b048c960c
35 changed files with 11 additions and 20 deletions

View File

@ -24,12 +24,12 @@ for %%x in (*.exe) do (
echo [pass] reference image not found. Copying %%~nx.png ... echo [pass] reference image not found. Copying %%~nx.png ...
copy "tests\out\%%~nx.png" "tests\ref\%%~nx.png" copy "tests\out\%%~nx.png" "tests\ref\%%~nx.png"
) else ( ) else (
call gm compare -metric MSE -maximum-error 0.005 "tests\ref\%%~nx.png" "tests\out\%%~nx.png" -file "tests\diff\%%~nx.png" call gm compare -metric MSE -maximum-error 0.0065 "tests\ref\%%~nx.png" "tests\out\%%~nx.png" -file "tests\diff\%%~nx.png"
if errorlevel 1 ( if errorlevel 1 (
echo [fail] %%~nx.exe! Check "tests\diff\%%~nx.png" echo [fail] %%~nx.exe! Check "tests\diff\%%~nx.png"
) else ( ) else (
echo [pass] %%~nx.exe echo [pass] %%~nx.exe
del "tests\diff\%%~nx.png" @REM del "tests\diff\%%~nx.png"
) )
) )
) )

View File

@ -392388,6 +392388,8 @@ int fps_wait() {
} }
static static
void window_vsync(float hz) { void window_vsync(float hz) {
static uint64_t capture_target; do_once capture_target = optioni("--capture", 0);
if( capture_target ) return;
if( hz <= 0 ) return; if( hz <= 0 ) return;
do_once fps_locker(1); do_once fps_locker(1);
framerate = hz; framerate = hz;
@ -395715,7 +395717,7 @@ static void v4k_post_init(float refresh_rate) {
glfwShowWindow(window); glfwShowWindow(window);
glfwGetFramebufferSize(window, &w, &h); //glfwGetWindowSize(window, &w, &h); glfwGetFramebufferSize(window, &w, &h); //glfwGetWindowSize(window, &w, &h);
randset(time_ns()); randset(time_ns() * !optioni("--capture",0));
boot_time = -time_ss(); // measure boot time, this is continued in window_stats() boot_time = -time_ss(); // measure boot time, this is continued in window_stats()
// clean any errno setup by cooking stage // clean any errno setup by cooking stage
@ -395726,11 +395728,6 @@ static void v4k_post_init(float refresh_rate) {
// preload brdf LUT early // preload brdf LUT early
(void)brdf_lut(); (void)brdf_lut();
static uint64_t capture_target; do_once capture_target = optioni("--capture", 0);
if (capture_target) {
randset(capture_target);
}
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@ -40,7 +40,7 @@ static void v4k_post_init(float refresh_rate) {
glfwShowWindow(window); glfwShowWindow(window);
glfwGetFramebufferSize(window, &w, &h); //glfwGetWindowSize(window, &w, &h); glfwGetFramebufferSize(window, &w, &h); //glfwGetWindowSize(window, &w, &h);
randset(time_ns()); randset(time_ns() * !optioni("--capture",0));
boot_time = -time_ss(); // measure boot time, this is continued in window_stats() boot_time = -time_ss(); // measure boot time, this is continued in window_stats()
// clean any errno setup by cooking stage // clean any errno setup by cooking stage
@ -51,11 +51,6 @@ static void v4k_post_init(float refresh_rate) {
// preload brdf LUT early // preload brdf LUT early
(void)brdf_lut(); (void)brdf_lut();
static uint64_t capture_target; do_once capture_target = optioni("--capture", 0);
if (capture_target) {
randset(capture_target);
}
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@ -65,6 +65,8 @@ int fps_wait() {
} }
static static
void window_vsync(float hz) { void window_vsync(float hz) {
static uint64_t capture_target; do_once capture_target = optioni("--capture", 0);
if( capture_target ) return;
if( hz <= 0 ) return; if( hz <= 0 ) return;
do_once fps_locker(1); do_once fps_locker(1);
framerate = hz; framerate = hz;

View File

@ -26928,6 +26928,8 @@ int fps_wait() {
} }
static static
void window_vsync(float hz) { void window_vsync(float hz) {
static uint64_t capture_target; do_once capture_target = optioni("--capture", 0);
if( capture_target ) return;
if( hz <= 0 ) return; if( hz <= 0 ) return;
do_once fps_locker(1); do_once fps_locker(1);
framerate = hz; framerate = hz;
@ -30255,7 +30257,7 @@ static void v4k_post_init(float refresh_rate) {
glfwShowWindow(window); glfwShowWindow(window);
glfwGetFramebufferSize(window, &w, &h); //glfwGetWindowSize(window, &w, &h); glfwGetFramebufferSize(window, &w, &h); //glfwGetWindowSize(window, &w, &h);
randset(time_ns()); randset(time_ns() * !optioni("--capture",0));
boot_time = -time_ss(); // measure boot time, this is continued in window_stats() boot_time = -time_ss(); // measure boot time, this is continued in window_stats()
// clean any errno setup by cooking stage // clean any errno setup by cooking stage
@ -30266,11 +30268,6 @@ static void v4k_post_init(float refresh_rate) {
// preload brdf LUT early // preload brdf LUT early
(void)brdf_lut(); (void)brdf_lut();
static uint64_t capture_target; do_once capture_target = optioni("--capture", 0);
if (capture_target) {
randset(capture_target);
}
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

Binary file not shown.

Before

Width:  |  Height:  |  Size: 228 KiB

After

Width:  |  Height:  |  Size: 229 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 840 KiB

After

Width:  |  Height:  |  Size: 898 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 MiB

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 422 KiB

After

Width:  |  Height:  |  Size: 420 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 970 KiB

After

Width:  |  Height:  |  Size: 970 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 MiB

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 MiB

After

Width:  |  Height:  |  Size: 1.9 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 MiB

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 KiB

After

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1017 KiB

After

Width:  |  Height:  |  Size: 968 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 KiB

After

Width:  |  Height:  |  Size: 137 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 MiB

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 MiB

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 320 KiB

After

Width:  |  Height:  |  Size: 320 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 KiB

After

Width:  |  Height:  |  Size: 137 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 420 KiB

After

Width:  |  Height:  |  Size: 417 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 MiB

After

Width:  |  Height:  |  Size: 1.8 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 KiB

After

Width:  |  Height:  |  Size: 131 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 263 KiB

After

Width:  |  Height:  |  Size: 259 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 MiB

After

Width:  |  Height:  |  Size: 1.9 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 123 KiB

After

Width:  |  Height:  |  Size: 123 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 123 KiB

After

Width:  |  Height:  |  Size: 123 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 941 KiB

After

Width:  |  Height:  |  Size: 942 KiB