Apply a random seed when NOT in benchmark mode to have 100% deterministic runs in all samples (#1127)

* Apply a random seed when NOT in benchmark mode to have 100% deterministic runs

These samples lack the check for benchmark.active when applying a random seed, which is done for other samples.

* Update texture3d.cpp
This commit is contained in:
takayhan-AMD 2024-05-18 10:01:01 +02:00 committed by GitHub
parent 478b6c39bf
commit 3d4446fa15
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 26 additions and 27 deletions

View file

@ -1,6 +1,6 @@
/*
* Vulkan Example - Using VK_EXT_graphics_pipeline_library
*
*
* Copyright (C) 2022-2023 by Sascha Willems - www.saschawillems.de
*
* This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
@ -374,7 +374,7 @@ public:
shaderStageCI.pName = "main";
// Select lighting model using a specialization constant
srand((unsigned int)time(NULL));
srand(benchmark.active ? 0 : ((unsigned int)time(NULL)));
uint32_t lighting_model = (int)(rand() % 4);
// Each shader constant of a shader stage corresponds to one map entry