aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorladevieq <ladevie.quentin@gmail.com>2021-01-12 23:11:45 +0100
committerladevieq <ladevie.quentin@gmail.com>2021-01-12 23:11:45 +0100
commit41d9d143468e88ce5e76c5d3c0543095339a0242 (patch)
treecd11c0939ca165a7b620ab4107481a627fde171d /src
parent8d3ee7548f0c616cac09b03a4fa02900911ba723 (diff)
Fix random swapchain out_of_date on presentation
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp16
-rw-r--r--src/vk-renderer.cpp2
2 files changed, 9 insertions, 9 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 480d139..a9c7123 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -80,16 +80,14 @@ int main() {
}
// Image dimensions
- const float aspect_ratio = 16.0 / 9.0;
- const uint32_t width = 1920;
+ // const float aspect_ratio = 16.0 / 9.0;
+ const float aspect_ratio = 1;
+ const uint32_t width = 400;
const uint32_t height = width / aspect_ratio;
window wnd { width , height };
vkrenderer renderer { wnd };
- if(rdoc_api) rdoc_api->StartFrameCapture(NULL, NULL);
- renderer.initialization_frame();
-
const uint32_t samples_per_pixel = 1;
const uint32_t max_depth = 1;
@@ -133,15 +131,15 @@ int main() {
random_scene(inputs.spheres);
// PPM format header
- std::cout << "P3\n" << width << '\n' << height << "\n255" << std::endl;
+ // std::cout << "P3\n" << width << '\n' << height << "\n255" << std::endl;
- std::cerr << "Generating image" << std::endl;
+ // std::cerr << "Generating image" << std::endl;
// To start a frame capture, call StartFrameCapture.
// You can specify NULL, NULL for the device to capture on if you have only one device and
// either no windows at all or only one window, and it will capture from that device.
// See the documentation below for a longer explanation
- // if(rdoc_api) rdoc_api->StartFrameCapture(NULL, NULL);
+ if(rdoc_api) rdoc_api->StartFrameCapture(NULL, NULL);
auto start = std::chrono::high_resolution_clock::now();
renderer.compute(inputs, width, height);
@@ -152,6 +150,8 @@ int main() {
// stop the capture
if(rdoc_api) rdoc_api->EndFrameCapture(NULL, NULL);
+ pause();
+
//-------------------------
// GPU path tracer
//-------------------------
diff --git a/src/vk-renderer.cpp b/src/vk-renderer.cpp
index 75a1ef6..e00d672 100644
--- a/src/vk-renderer.cpp
+++ b/src/vk-renderer.cpp
@@ -92,7 +92,7 @@ void vkrenderer::compute(const input_data& inputs, size_t width, size_t height)
command_buffer,
VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
- VK_DEPENDENCY_DEVICE_GROUP_BIT,
+ 0,
0,
nullptr,
0,