mirror of
https://github.com/godotengine/godot-angle-static.git
synced 2026-01-04 22:09:59 +03:00
This benchmark will attempt to reproduce the slowdown we see in D3D11 on the turbulenz GPU particles demo. BUG=angle:705 Change-Id: I9c4c2f09d4282feae30f448fd374cdbb6bceae9b Reviewed-on: https://chromium-review.googlesource.com/216467 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
23 lines
547 B
C++
23 lines
547 B
C++
//
|
|
// Copyright (c) 2014 The ANGLE Project Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
//
|
|
|
|
#include "random_utils.h"
|
|
#include <time.h>
|
|
#include <cstdlib>
|
|
|
|
float RandomBetween(float min, float max)
|
|
{
|
|
static bool randInitialized = false;
|
|
if (!randInitialized)
|
|
{
|
|
srand(time(NULL));
|
|
randInitialized = true;
|
|
}
|
|
|
|
const size_t divisor = 10000;
|
|
return min + ((rand() % divisor) / static_cast<float>(divisor)) * (max - min);
|
|
}
|