Fixed random seed when run in benchmark mode, use default random engine instead of fixed mersene twister
Refs #269
This commit is contained in:
parent
5790f30c17
commit
9e073bdd3b
11 changed files with 55 additions and 60 deletions
|
|
@ -115,7 +115,6 @@ public:
|
||||||
camera.setRotation(glm::vec3(-30.0f, -45.0f, 0.0f));
|
camera.setRotation(glm::vec3(-30.0f, -45.0f, 0.0f));
|
||||||
camera.setTranslation(glm::vec3(0.0f, 0.0f, -3.5f));
|
camera.setTranslation(glm::vec3(0.0f, 0.0f, -3.5f));
|
||||||
settings.overlay = true;
|
settings.overlay = true;
|
||||||
srand((unsigned int)time(NULL));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~VulkanExample()
|
~VulkanExample()
|
||||||
|
|
@ -669,12 +668,11 @@ public:
|
||||||
// todo: base on frametime
|
// todo: base on frametime
|
||||||
//compute.ubo.deltaT = frameTimer * 0.0075f;
|
//compute.ubo.deltaT = frameTimer * 0.0075f;
|
||||||
|
|
||||||
std::mt19937 rg((unsigned)time(nullptr));
|
|
||||||
std::uniform_real_distribution<float> rd(1.0f, 6.0f);
|
|
||||||
|
|
||||||
if (simulateWind) {
|
if (simulateWind) {
|
||||||
compute.ubo.gravity.x = cos(glm::radians(-timer * 360.0f)) * (rd(rg) - rd(rg));
|
std::default_random_engine rndEngine(benchmark.active ? 0 : (unsigned)time(nullptr));
|
||||||
compute.ubo.gravity.z = sin(glm::radians(timer * 360.0f)) * (rd(rg) - rd(rg));
|
std::uniform_real_distribution<float> rd(1.0f, 6.0f);
|
||||||
|
compute.ubo.gravity.x = cos(glm::radians(-timer * 360.0f)) * (rd(rndEngine) - rd(rndEngine));
|
||||||
|
compute.ubo.gravity.z = sin(glm::radians(timer * 360.0f)) * (rd(rndEngine) - rd(rndEngine));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
compute.ubo.gravity.x = 0.0f;
|
compute.ubo.gravity.x = 0.0f;
|
||||||
|
|
|
||||||
|
|
@ -289,7 +289,7 @@ public:
|
||||||
// Initial particle positions
|
// Initial particle positions
|
||||||
std::vector<Particle> particleBuffer(numParticles);
|
std::vector<Particle> particleBuffer(numParticles);
|
||||||
|
|
||||||
std::mt19937 rndGen(static_cast<uint32_t>(time(0)));
|
std::default_random_engine rndEngine(benchmark.active ? 0 : (unsigned)time(nullptr));
|
||||||
std::normal_distribution<float> rndDist(0.0f, 1.0f);
|
std::normal_distribution<float> rndDist(0.0f, 1.0f);
|
||||||
|
|
||||||
for (uint32_t i = 0; i < static_cast<uint32_t>(attractors.size()); i++)
|
for (uint32_t i = 0; i < static_cast<uint32_t>(attractors.size()); i++)
|
||||||
|
|
@ -307,15 +307,15 @@ public:
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Position
|
// Position
|
||||||
glm::vec3 position(attractors[i] + glm::vec3(rndDist(rndGen), rndDist(rndGen), rndDist(rndGen)) * 0.75f);
|
glm::vec3 position(attractors[i] + glm::vec3(rndDist(rndEngine), rndDist(rndEngine), rndDist(rndEngine)) * 0.75f);
|
||||||
float len = glm::length(glm::normalize(position - attractors[i]));
|
float len = glm::length(glm::normalize(position - attractors[i]));
|
||||||
position.y *= 2.0f - (len * len);
|
position.y *= 2.0f - (len * len);
|
||||||
|
|
||||||
// Velocity
|
// Velocity
|
||||||
glm::vec3 angular = glm::vec3(0.5f, 1.5f, 0.5f) * (((i % 2) == 0) ? 1.0f : -1.0f);
|
glm::vec3 angular = glm::vec3(0.5f, 1.5f, 0.5f) * (((i % 2) == 0) ? 1.0f : -1.0f);
|
||||||
glm::vec3 velocity = glm::cross((position - attractors[i]), angular) + glm::vec3(rndDist(rndGen), rndDist(rndGen), rndDist(rndGen) * 0.025f);
|
glm::vec3 velocity = glm::cross((position - attractors[i]), angular) + glm::vec3(rndDist(rndEngine), rndDist(rndEngine), rndDist(rndEngine) * 0.025f);
|
||||||
|
|
||||||
float mass = (rndDist(rndGen) * 0.5f + 0.5f) * 75.0f;
|
float mass = (rndDist(rndEngine) * 0.5f + 0.5f) * 75.0f;
|
||||||
particle.pos = glm::vec4(position, mass);
|
particle.pos = glm::vec4(position, mass);
|
||||||
particle.vel = glm::vec4(velocity, 0.0f);
|
particle.vel = glm::vec4(velocity, 0.0f);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -233,14 +233,13 @@ public:
|
||||||
// Setup and fill the compute shader storage buffers containing the particles
|
// Setup and fill the compute shader storage buffers containing the particles
|
||||||
void prepareStorageBuffers()
|
void prepareStorageBuffers()
|
||||||
{
|
{
|
||||||
std::mt19937 rGenerator;
|
std::default_random_engine rndEngine(benchmark.active ? 0 : (unsigned)time(nullptr));
|
||||||
std::uniform_real_distribution<float> rDistribution(-1.0f, 1.0f);
|
std::uniform_real_distribution<float> rndDist(-1.0f, 1.0f);
|
||||||
|
|
||||||
// Initial particle positions
|
// Initial particle positions
|
||||||
std::vector<Particle> particleBuffer(PARTICLE_COUNT);
|
std::vector<Particle> particleBuffer(PARTICLE_COUNT);
|
||||||
for (auto& particle : particleBuffer)
|
for (auto& particle : particleBuffer) {
|
||||||
{
|
particle.pos = glm::vec2(rndDist(rndEngine), rndDist(rndEngine));
|
||||||
particle.pos = glm::vec2(rDistribution(rGenerator), rDistribution(rGenerator));
|
|
||||||
particle.vel = glm::vec2(0.0f);
|
particle.vel = glm::vec2(0.0f);
|
||||||
particle.gradientPos.x = particle.pos.x / 2.0f;
|
particle.gradientPos.x = particle.pos.x / 2.0f;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -446,12 +446,11 @@ public:
|
||||||
VK_CHECK_RESULT(uniformBuffers.dynamic.map());
|
VK_CHECK_RESULT(uniformBuffers.dynamic.map());
|
||||||
|
|
||||||
// Prepare per-object matrices with offsets and random rotations
|
// Prepare per-object matrices with offsets and random rotations
|
||||||
std::mt19937 rndGen(static_cast<uint32_t>(time(0)));
|
std::default_random_engine rndEngine(benchmark.active ? 0 : (unsigned)time(nullptr));
|
||||||
std::normal_distribution<float> rndDist(-1.0f, 1.0f);
|
std::normal_distribution<float> rndDist(-1.0f, 1.0f);
|
||||||
for (uint32_t i = 0; i < OBJECT_INSTANCES; i++)
|
for (uint32_t i = 0; i < OBJECT_INSTANCES; i++) {
|
||||||
{
|
rotations[i] = glm::vec3(rndDist(rndEngine), rndDist(rndEngine), rndDist(rndEngine)) * 2.0f * (float)M_PI;
|
||||||
rotations[i] = glm::vec3(rndDist(rndGen), rndDist(rndGen), rndDist(rndGen)) * 2.0f * (float)M_PI;
|
rotationSpeeds[i] = glm::vec3(rndDist(rndEngine), rndDist(rndEngine), rndDist(rndEngine));
|
||||||
rotationSpeeds[i] = glm::vec3(rndDist(rndGen), rndDist(rndGen), rndDist(rndGen));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
updateUniformBuffers();
|
updateUniformBuffers();
|
||||||
|
|
|
||||||
|
|
@ -594,16 +594,15 @@ public:
|
||||||
std::vector<InstanceData> instanceData;
|
std::vector<InstanceData> instanceData;
|
||||||
instanceData.resize(objectCount);
|
instanceData.resize(objectCount);
|
||||||
|
|
||||||
std::mt19937 rndGenerator((unsigned)time(NULL));
|
std::default_random_engine rndEngine(benchmark.active ? 0 : (unsigned)time(nullptr));
|
||||||
std::uniform_real_distribution<float> uniformDist(0.0f, 1.0f);
|
std::uniform_real_distribution<float> uniformDist(0.0f, 1.0f);
|
||||||
|
|
||||||
for (uint32_t i = 0; i < objectCount; i++)
|
for (uint32_t i = 0; i < objectCount; i++) {
|
||||||
{
|
instanceData[i].rot = glm::vec3(0.0f, float(M_PI) * uniformDist(rndEngine), 0.0f);
|
||||||
instanceData[i].rot = glm::vec3(0.0f, float(M_PI) * uniformDist(rndGenerator), 0.0f);
|
float theta = 2 * float(M_PI) * uniformDist(rndEngine);
|
||||||
float theta = 2 * float(M_PI) * uniformDist(rndGenerator);
|
float phi = acos(1 - 2 * uniformDist(rndEngine));
|
||||||
float phi = acos(1 - 2 * uniformDist(rndGenerator));
|
|
||||||
instanceData[i].pos = glm::vec3(sin(phi) * cos(theta), 0.0f, cos(phi)) * PLANT_RADIUS;
|
instanceData[i].pos = glm::vec3(sin(phi) * cos(theta), 0.0f, cos(phi)) * PLANT_RADIUS;
|
||||||
instanceData[i].scale = 1.0f + uniformDist(rndGenerator) * 2.0f;
|
instanceData[i].scale = 1.0f + uniformDist(rndEngine) * 2.0f;
|
||||||
instanceData[i].texIndex = i / OBJECT_INSTANCE_COUNT;
|
instanceData[i].texIndex = i / OBJECT_INSTANCE_COUNT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -441,7 +441,7 @@ public:
|
||||||
std::vector<InstanceData> instanceData;
|
std::vector<InstanceData> instanceData;
|
||||||
instanceData.resize(INSTANCE_COUNT);
|
instanceData.resize(INSTANCE_COUNT);
|
||||||
|
|
||||||
std::mt19937 rndGenerator(benchmark.active ? 0 : (unsigned)time(NULL));
|
std::default_random_engine rndGenerator(benchmark.active ? 0 : (unsigned)time(nullptr));
|
||||||
std::uniform_real_distribution<float> uniformDist(0.0, 1.0);
|
std::uniform_real_distribution<float> uniformDist(0.0, 1.0);
|
||||||
std::uniform_int_distribution<uint32_t> rndTextureIndex(0, textures.rocks.layerCount);
|
std::uniform_int_distribution<uint32_t> rndTextureIndex(0, textures.rocks.layerCount);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -118,6 +118,8 @@ public:
|
||||||
// View frustum for culling invisible objects
|
// View frustum for culling invisible objects
|
||||||
vks::Frustum frustum;
|
vks::Frustum frustum;
|
||||||
|
|
||||||
|
std::default_random_engine rndEngine;
|
||||||
|
|
||||||
VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION)
|
VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION)
|
||||||
{
|
{
|
||||||
zoom = -32.5f;
|
zoom = -32.5f;
|
||||||
|
|
@ -134,11 +136,10 @@ public:
|
||||||
#else
|
#else
|
||||||
std::cout << "numThreads = " << numThreads << std::endl;
|
std::cout << "numThreads = " << numThreads << std::endl;
|
||||||
#endif
|
#endif
|
||||||
srand(time(NULL));
|
|
||||||
|
|
||||||
threadPool.setThreadCount(numThreads);
|
threadPool.setThreadCount(numThreads);
|
||||||
|
|
||||||
numObjectsPerThread = 512 / numThreads;
|
numObjectsPerThread = 512 / numThreads;
|
||||||
|
rndEngine.seed(benchmark.active ? 0 : (unsigned)time(nullptr));
|
||||||
|
paused = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
~VulkanExample()
|
~VulkanExample()
|
||||||
|
|
@ -167,7 +168,8 @@ public:
|
||||||
|
|
||||||
float rnd(float range)
|
float rnd(float range)
|
||||||
{
|
{
|
||||||
return range * (rand() / double(RAND_MAX));
|
std::uniform_real_distribution<float> rndDist(0.0f, range);
|
||||||
|
return rndDist(rndEngine);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create all threads and initialize shader push constants
|
// Create all threads and initialize shader push constants
|
||||||
|
|
@ -193,11 +195,7 @@ public:
|
||||||
uint32_t posX = 0;
|
uint32_t posX = 0;
|
||||||
uint32_t posZ = 0;
|
uint32_t posZ = 0;
|
||||||
|
|
||||||
std::mt19937 rndGenerator((unsigned)time(NULL));
|
for (uint32_t i = 0; i < numThreads; i++) {
|
||||||
std::uniform_real_distribution<float> uniformDist(0.0f, 1.0f);
|
|
||||||
|
|
||||||
for (uint32_t i = 0; i < numThreads; i++)
|
|
||||||
{
|
|
||||||
ThreadData *thread = &threadData[i];
|
ThreadData *thread = &threadData[i];
|
||||||
|
|
||||||
// Create one command pool for each thread
|
// Create one command pool for each thread
|
||||||
|
|
@ -219,10 +217,9 @@ public:
|
||||||
thread->pushConstBlock.resize(numObjectsPerThread);
|
thread->pushConstBlock.resize(numObjectsPerThread);
|
||||||
thread->objectData.resize(numObjectsPerThread);
|
thread->objectData.resize(numObjectsPerThread);
|
||||||
|
|
||||||
for (uint32_t j = 0; j < numObjectsPerThread; j++)
|
for (uint32_t j = 0; j < numObjectsPerThread; j++) {
|
||||||
{
|
float theta = 2.0f * float(M_PI) * rnd(1.0f);
|
||||||
float theta = 2.0f * float(M_PI) * uniformDist(rndGenerator);
|
float phi = acos(1.0f - 2.0f * rnd(1.0f));
|
||||||
float phi = acos(1.0f - 2.0f * uniformDist(rndGenerator));
|
|
||||||
thread->objectData[j].pos = glm::vec3(sin(phi) * cos(theta), 0.0f, cos(phi)) * 35.0f;
|
thread->objectData[j].pos = glm::vec3(sin(phi) * cos(theta), 0.0f, cos(phi)) * 35.0f;
|
||||||
|
|
||||||
thread->objectData[j].rotation = glm::vec3(0.0f, rnd(360.0f), 0.0f);
|
thread->objectData[j].rotation = glm::vec3(0.0f, rnd(360.0f), 0.0f);
|
||||||
|
|
@ -268,15 +265,16 @@ public:
|
||||||
vkCmdBindPipeline(cmdBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, pipelines.phong);
|
vkCmdBindPipeline(cmdBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, pipelines.phong);
|
||||||
|
|
||||||
// Update
|
// Update
|
||||||
objectData->rotation.y += 2.5f * objectData->rotationSpeed * frameTimer;
|
if (!paused) {
|
||||||
if (objectData->rotation.y > 360.0f)
|
objectData->rotation.y += 2.5f * objectData->rotationSpeed * frameTimer;
|
||||||
{
|
if (objectData->rotation.y > 360.0f) {
|
||||||
objectData->rotation.y -= 360.0f;
|
objectData->rotation.y -= 360.0f;
|
||||||
|
}
|
||||||
|
objectData->deltaT += 0.15f * frameTimer;
|
||||||
|
if (objectData->deltaT > 1.0f)
|
||||||
|
objectData->deltaT -= 1.0f;
|
||||||
|
objectData->pos.y = sin(glm::radians(objectData->deltaT * 360.0f)) * 2.5f;
|
||||||
}
|
}
|
||||||
objectData->deltaT += 0.15f * frameTimer;
|
|
||||||
if (objectData->deltaT > 1.0f)
|
|
||||||
objectData->deltaT -= 1.0f;
|
|
||||||
objectData->pos.y = sin(glm::radians(objectData->deltaT * 360.0f)) * 2.5f;
|
|
||||||
|
|
||||||
objectData->model = glm::translate(glm::mat4(1.0f), objectData->pos);
|
objectData->model = glm::translate(glm::mat4(1.0f), objectData->pos);
|
||||||
objectData->model = glm::rotate(objectData->model, -sinf(glm::radians(objectData->deltaT * 360.0f)) * 0.25f, glm::vec3(objectData->rotationDir, 0.0f, 0.0f));
|
objectData->model = glm::rotate(objectData->model, -sinf(glm::radians(objectData->deltaT * 360.0f)) * 0.25f, glm::vec3(objectData->rotationDir, 0.0f, 0.0f));
|
||||||
|
|
@ -593,8 +591,7 @@ public:
|
||||||
|
|
||||||
// Wait for fence to signal that all command buffers are ready
|
// Wait for fence to signal that all command buffers are ready
|
||||||
VkResult fenceRes;
|
VkResult fenceRes;
|
||||||
do
|
do {
|
||||||
{
|
|
||||||
fenceRes = vkWaitForFences(device, 1, &renderFence, VK_TRUE, 100000000);
|
fenceRes = vkWaitForFences(device, 1, &renderFence, VK_TRUE, 100000000);
|
||||||
} while (fenceRes == VK_TIMEOUT);
|
} while (fenceRes == VK_TIMEOUT);
|
||||||
VK_CHECK_RESULT(fenceRes);
|
VK_CHECK_RESULT(fenceRes);
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <random>
|
||||||
|
|
||||||
#define GLM_FORCE_RADIANS
|
#define GLM_FORCE_RADIANS
|
||||||
#define GLM_FORCE_DEPTH_ZERO_TO_ONE
|
#define GLM_FORCE_DEPTH_ZERO_TO_ONE
|
||||||
|
|
@ -123,6 +124,8 @@ public:
|
||||||
|
|
||||||
std::vector<Particle> particleBuffer;
|
std::vector<Particle> particleBuffer;
|
||||||
|
|
||||||
|
std::default_random_engine rndEngine;
|
||||||
|
|
||||||
VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION)
|
VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION)
|
||||||
{
|
{
|
||||||
zoom = -75.0f;
|
zoom = -75.0f;
|
||||||
|
|
@ -131,7 +134,7 @@ public:
|
||||||
settings.overlay = true;
|
settings.overlay = true;
|
||||||
zoomSpeed *= 1.5f;
|
zoomSpeed *= 1.5f;
|
||||||
timerSpeed *= 8.0f;
|
timerSpeed *= 8.0f;
|
||||||
srand(time(NULL));
|
rndEngine.seed(benchmark.active ? 0 : (unsigned)time(nullptr));
|
||||||
}
|
}
|
||||||
|
|
||||||
~VulkanExample()
|
~VulkanExample()
|
||||||
|
|
@ -217,7 +220,8 @@ public:
|
||||||
|
|
||||||
float rnd(float range)
|
float rnd(float range)
|
||||||
{
|
{
|
||||||
return range * (rand() / float(RAND_MAX));
|
std::uniform_real_distribution<float> rndDist(0.0f, range);
|
||||||
|
return rndDist(rndEngine);
|
||||||
}
|
}
|
||||||
|
|
||||||
void initParticle(Particle *particle, glm::vec3 emitterPos)
|
void initParticle(Particle *particle, glm::vec3 emitterPos)
|
||||||
|
|
|
||||||
|
|
@ -1007,17 +1007,16 @@ public:
|
||||||
updateUniformBufferSSAOParams();
|
updateUniformBufferSSAOParams();
|
||||||
|
|
||||||
// SSAO
|
// SSAO
|
||||||
|
std::default_random_engine rndEngine(benchmark.active ? 0 : (unsigned)time(nullptr));
|
||||||
std::uniform_real_distribution<float> rndDist(0.0f, 1.0f);
|
std::uniform_real_distribution<float> rndDist(0.0f, 1.0f);
|
||||||
std::random_device rndDev;
|
|
||||||
std::default_random_engine rndGen;
|
|
||||||
|
|
||||||
// Sample kernel
|
// Sample kernel
|
||||||
std::vector<glm::vec4> ssaoKernel(SSAO_KERNEL_SIZE);
|
std::vector<glm::vec4> ssaoKernel(SSAO_KERNEL_SIZE);
|
||||||
for (uint32_t i = 0; i < SSAO_KERNEL_SIZE; ++i)
|
for (uint32_t i = 0; i < SSAO_KERNEL_SIZE; ++i)
|
||||||
{
|
{
|
||||||
glm::vec3 sample(rndDist(rndGen) * 2.0 - 1.0, rndDist(rndGen) * 2.0 - 1.0, rndDist(rndGen));
|
glm::vec3 sample(rndDist(rndEngine) * 2.0 - 1.0, rndDist(rndEngine) * 2.0 - 1.0, rndDist(rndEngine));
|
||||||
sample = glm::normalize(sample);
|
sample = glm::normalize(sample);
|
||||||
sample *= rndDist(rndGen);
|
sample *= rndDist(rndEngine);
|
||||||
float scale = float(i) / float(SSAO_KERNEL_SIZE);
|
float scale = float(i) / float(SSAO_KERNEL_SIZE);
|
||||||
scale = lerp(0.1f, 1.0f, scale * scale);
|
scale = lerp(0.1f, 1.0f, scale * scale);
|
||||||
ssaoKernel[i] = glm::vec4(sample * scale, 0.0f);
|
ssaoKernel[i] = glm::vec4(sample * scale, 0.0f);
|
||||||
|
|
@ -1035,7 +1034,7 @@ public:
|
||||||
std::vector<glm::vec4> ssaoNoise(SSAO_NOISE_DIM * SSAO_NOISE_DIM);
|
std::vector<glm::vec4> ssaoNoise(SSAO_NOISE_DIM * SSAO_NOISE_DIM);
|
||||||
for (uint32_t i = 0; i < static_cast<uint32_t>(ssaoNoise.size()); i++)
|
for (uint32_t i = 0; i < static_cast<uint32_t>(ssaoNoise.size()); i++)
|
||||||
{
|
{
|
||||||
ssaoNoise[i] = glm::vec4(rndDist(rndGen) * 2.0f - 1.0f, rndDist(rndGen) * 2.0f - 1.0f, 0.0f, 0.0f);
|
ssaoNoise[i] = glm::vec4(rndDist(rndEngine) * 2.0f - 1.0f, rndDist(rndEngine) * 2.0f - 1.0f, 0.0f, 0.0f);
|
||||||
}
|
}
|
||||||
// Upload as texture
|
// Upload as texture
|
||||||
textures.ssaoNoise.fromBuffer(ssaoNoise.data(), ssaoNoise.size() * sizeof(glm::vec4), VK_FORMAT_R32G32B32A32_SFLOAT, SSAO_NOISE_DIM, SSAO_NOISE_DIM, vulkanDevice, queue, VK_FILTER_NEAREST);
|
textures.ssaoNoise.fromBuffer(ssaoNoise.data(), ssaoNoise.size() * sizeof(glm::vec4), VK_FORMAT_R32G32B32A32_SFLOAT, SSAO_NOISE_DIM, SSAO_NOISE_DIM, vulkanDevice, queue, VK_FILTER_NEAREST);
|
||||||
|
|
|
||||||
|
|
@ -1009,7 +1009,7 @@ public:
|
||||||
glm::vec3(1.0f, 1.0f, 0.0f),
|
glm::vec3(1.0f, 1.0f, 0.0f),
|
||||||
};
|
};
|
||||||
|
|
||||||
std::mt19937 rndGen(benchmark.active ? 0 : (unsigned)time(NULL));
|
std::default_random_engine rndGen(benchmark.active ? 0 : (unsigned)time(nullptr));
|
||||||
std::uniform_real_distribution<float> rndDist(-1.0f, 1.0f);
|
std::uniform_real_distribution<float> rndDist(-1.0f, 1.0f);
|
||||||
std::uniform_int_distribution<uint32_t> rndCol(0, static_cast<uint32_t>(colors.size()-1));
|
std::uniform_int_distribution<uint32_t> rndCol(0, static_cast<uint32_t>(colors.size()-1));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -962,7 +962,7 @@ public:
|
||||||
void fillVirtualTexture(int32_t &mipLevel)
|
void fillVirtualTexture(int32_t &mipLevel)
|
||||||
{
|
{
|
||||||
vkDeviceWaitIdle(device);
|
vkDeviceWaitIdle(device);
|
||||||
std::default_random_engine rndEngine(std::random_device{}());
|
std::default_random_engine rndEngine(benchmark.active ? 0 : (unsigned)time(nullptr));
|
||||||
std::uniform_real_distribution<float> rndDist(0.0f, 1.0f);
|
std::uniform_real_distribution<float> rndDist(0.0f, 1.0f);
|
||||||
std::vector<VkImageBlit> imageBlits;
|
std::vector<VkImageBlit> imageBlits;
|
||||||
for (auto& page : texture.pages)
|
for (auto& page : texture.pages)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue