adding basic timing

This commit is contained in:
Dynamitos
2025-01-24 22:34:23 +01:00
parent 39b5de6576
commit 21ceebbe4b
3 changed files with 18 additions and 4 deletions
+3 -1
View File
@@ -42,9 +42,11 @@ void Scene::render(Camera cam, RenderParameter params)
}
});
}
auto start = std::chrono::high_resolution_clock::now();
threadPool.runBatch(std::move(batch));
auto end = std::chrono::high_resolution_clock::now();
std::cout << std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count() << std::endl;
std::memcpy(image.data(), accumulator.data(), accumulator.size() * sizeof(glm::vec3));
std::cout << samp << std::endl;
}
});
}
+2 -3
View File
@@ -1,5 +1,4 @@
#include "Window.h"
#include <assert.h>
#include <iostream>
#define GLSL(...) "#version 400\n" #__VA_ARGS__
@@ -7,13 +6,13 @@
Window::Window(int width, int height) : width(width), height(height)
{
glewExperimental = true;
assert(glfwInit());
glfwInit();
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); // We don't want the old OpenGL
window = glfwCreateWindow(width, height, "RayTracer", nullptr, nullptr);
glfwMakeContextCurrent(window);
assert(!glewInit());
glewInit();
glGenVertexArrays(1, &vao);
glBindVertexArray(vao);
glGenTextures(1, &texture);