From 7bd58bb4d6761f77ccf01d156927384c3b8c2fe6 Mon Sep 17 00:00:00 2001
From: Jens Koenen <koenen@vr.rwth-aachen.de>
Date: Tue, 28 Feb 2023 22:21:24 +0100
Subject: [PATCH] Change variables in the frame metadata of the dual-layer
 reprojection strategy

---
 src/strategy/dual_layer_reprojection.cpp | 5 +++--
 src/strategy/dual_layer_reprojection.hpp | 3 ++-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/strategy/dual_layer_reprojection.cpp b/src/strategy/dual_layer_reprojection.cpp
index 52f042e1..040a2d48 100644
--- a/src/strategy/dual_layer_reprojection.cpp
+++ b/src/strategy/dual_layer_reprojection.cpp
@@ -146,9 +146,10 @@ bool DualLayerReprojection::on_render(VkCommandBuffer command_buffer, lava::inde
     DualLayerReprojectionMetadata metadata;
     metadata.projection_matrix = this->get_stereo_transform()->get_projection_matrix(EYE_RIGHT);
     metadata.head_eye_projection_matrix = this->get_stereo_transform()->get_view_eye_projection_matrix(EYE_RIGHT);
+    metadata.layer_resolution = this->get_headset()->get_framebuffer_resolution();
+    metadata.layer_separation = this->layer_constant_threshold;
     metadata.slope_threshold = this->reproject_slope_threshold;
-    metadata.render_resolution = this->get_headset()->get_framebuffer_resolution();
-
+    
     this->get_headset()->submit_metadata(std::span<uint8_t>((uint8_t*)&metadata, sizeof(metadata)));
 
     ShadowCache::Ptr shadow_cache = this->get_application()->get_shadow_cache();
diff --git a/src/strategy/dual_layer_reprojection.hpp b/src/strategy/dual_layer_reprojection.hpp
index 0f163bfe..b1d224c4 100644
--- a/src/strategy/dual_layer_reprojection.hpp
+++ b/src/strategy/dual_layer_reprojection.hpp
@@ -13,7 +13,8 @@ struct DualLayerReprojectionMetadata
 {
     glm::mat4 projection_matrix;
     glm::mat4 head_eye_projection_matrix;
-    glm::uvec2 render_resolution;
+    glm::uvec2 layer_resolution;
+    float layer_separation;
     float slope_threshold;
 };
 
-- 
GitLab