adding basic timing
This commit is contained in:
+3
-1
@@ -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;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user