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:
parent
478b6c39bf
commit
3d4446fa15
6 changed files with 26 additions and 27 deletions
|
|
@ -64,7 +64,7 @@ public:
|
|||
{
|
||||
// Setup random colors and fixed positions for every sphere in the scene
|
||||
std::random_device rndDevice;
|
||||
std::default_random_engine rndEngine(rndDevice());
|
||||
std::default_random_engine rndEngine(benchmark.active ? 0 : rndDevice());
|
||||
std::uniform_real_distribution<float> rndDist(0.1f, 1.0f);
|
||||
for (uint32_t i = 0; i < spheres.size(); i++) {
|
||||
spheres[i].color = glm::vec4(rndDist(rndEngine), rndDist(rndEngine), rndDist(rndEngine), 1.0f);
|
||||
|
|
@ -149,7 +149,7 @@ public:
|
|||
vks::initializers::descriptorSetLayoutBinding(VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, VK_SHADER_STAGE_VERTEX_BIT, 0),
|
||||
};
|
||||
VkDescriptorSetLayoutCreateInfo descriptorLayout = vks::initializers::descriptorSetLayoutCreateInfo(setLayoutBindings);
|
||||
VK_CHECK_RESULT(vkCreateDescriptorSetLayout(device, &descriptorLayout, nullptr, &descriptorSetLayout));
|
||||
VK_CHECK_RESULT(vkCreateDescriptorSetLayout(device, &descriptorLayout, nullptr, &descriptorSetLayout));
|
||||
|
||||
// Set
|
||||
VkDescriptorSetAllocateInfo allocInfo = vks::initializers::descriptorSetAllocateInfo(descriptorPool, &descriptorSetLayout, 1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue