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

@ -13,7 +13,7 @@
#include "texturesparseresidency.h"
/*
Virtual texture page
Virtual texture page
Contains all functions and objects for a single page of a virtual texture
*/
@ -69,7 +69,7 @@ bool VirtualTexturePage::release(VkDevice device)
}
/*
Virtual texture
Virtual texture
Contains the virtual pages and memory binding information for a whole virtual texture
*/
@ -714,7 +714,7 @@ void VulkanExample::fillRandomPages()
{
vkDeviceWaitIdle(device);
std::default_random_engine rndEngine(std::random_device{}());
std::default_random_engine rndEngine(benchmark.active ? 0 : std::random_device{}());
std::uniform_real_distribution<float> rndDist(0.0f, 1.0f);
std::vector<VirtualTexturePage> updatedPages;
@ -810,7 +810,7 @@ void VulkanExample::flushRandomPages()
{
vkDeviceWaitIdle(device);
std::default_random_engine rndEngine(std::random_device{}());
std::default_random_engine rndEngine(benchmark.active ? 0 : std::random_device{}());
std::uniform_real_distribution<float> rndDist(0.0f, 1.0f);
std::vector<VirtualTexturePage> updatedPages;