aurora: add asynchronous OpenXR stereo replay bridge

This commit is contained in:
iChris4 committed 2026-09-03 04:00:02 +02:00
1 parent 8c8e4561e9
commit d8788de919
17 files changed
+1521 -74

No files matched your search

+1
View File
@@ -17,6 +17,7 @@ if (AURORA_ENABLE_GX)
add_executable(gx_fifo_tests
gx_fifo_test.cpp
gx_test_stubs.cpp
stereo_replay_test.cpp
texture_bind_group_cache_key_test.cpp
../lib/gfx/efb_ram_encoder.cpp
# GX API implementations (encoders)
+8
View File
@@ -49,6 +49,7 @@ std::recursive_mutex& renderer_gpu_mutex() noexcept {
} // namespace aurora
extern "C" bool aurora_wait_for_frame_worker_for(uint32_t) { return true; }
extern "C" void aurora_quiesce_frame_worker() {}
// --- aurora::log_internal ---
namespace aurora {
@@ -453,6 +454,13 @@ void resolve_pass(TextureHandle texture, ClipRect rect, bool clearColor, bool cl
record.persistentCopy = persistentCopy;
testing::s_resolvePassRecords.push_back(std::move(record));
}
// The recorded resolve is the display copy's; the flag only steers render-pass
// bookkeeping that lives in common.cpp, which this target does not compile.
void mark_last_resolve_as_display_copy() noexcept {}
void set_stereo_stop_at_display_copy(bool value) noexcept {}
bool get_stereo_stop_at_display_copy() noexcept { return true; }
void set_stereo_skip_copy_clears(bool value) noexcept {}
bool get_stereo_skip_copy_clears() noexcept { return true; }
void queue_palette_conv(tex_palette_conv::ConvRequest req) {}
void begin_offscreen(uint32_t width, uint32_t height) {}
void end_offscreen() {}
+41
View File
@@ -0,0 +1,41 @@
#include "gfx/stereo_replay.hpp"
#include <gtest/gtest.h>
namespace aurora::gfx::stereo_replay {
namespace {
TEST(StereoReplayTest, EyeFrustumPreservesGameDepthMapping) {
const Mat4x4<float> game{
{10.0f, 11.0f, 12.0f, 13.0f},
{20.0f, 21.0f, 22.0f, 23.0f},
{30.0f, 31.0f, 32.0f, 33.0f},
{40.0f, 41.0f, 42.0f, 43.0f},
};
const Mat4x4<float> eye{
{1.1f, 1.2f, 1.3f, 1.4f},
{2.1f, 2.2f, 2.3f, 2.4f},
{3.1f, 3.2f, 3.3f, 3.4f},
{4.1f, 4.2f, 4.3f, 4.4f},
};
const auto result = compose_projection(eye, game);
EXPECT_FLOAT_EQ(result.m0[0], eye.m0[0]);
EXPECT_FLOAT_EQ(result.m0[2], eye.m0[2]);
EXPECT_FLOAT_EQ(result.m1[1], eye.m1[1]);
EXPECT_FLOAT_EQ(result.m1[2], eye.m1[2]);
for (size_t row = 0; row < 4; ++row) {
for (size_t column = 0; column < 4; ++column) {
const bool frustumTerm =
(row == 0 && (column == 0 || column == 2)) ||
(row == 1 && (column == 1 || column == 2));
if (!frustumTerm) {
EXPECT_FLOAT_EQ(result[row][column], game[row][column]);
}
}
}
}
} // namespace
} // namespace aurora::gfx::stereo_replay