Add SchedulerBenchmark test

This commit is contained in:
SirLynix
2024-02-02 14:27:37 +01:00
parent 7f1ef0fe41
commit 56751072f5
4 changed files with 203 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
#include <Nazara/Math/Sphere.hpp>
#include <Nazara/Math/Vector2.hpp>
#include <Nazara/Math/Vector3.hpp>
#include <memory>
// Don't use Nz::Color as it's 4 floats and may get us memory-bound
struct PixelColor
{
Nz::UInt8 r, g, b;
};
struct SceneData
{
std::size_t imageSize;
std::unique_ptr<PixelColor[]> pixels;
std::vector<Nz::Sphered> spheres;
Nz::Vector3d cameraPos;
Nz::Vector3d originPos;
Nz::Vector3d pixelDeltaU;
Nz::Vector3d pixelDeltaV;
};
void RayCast(SceneData& sceneData, const Nz::Vector2ui& origin, const Nz::Vector2ui& dims);