wip
Some checks failed
continuous-integration/drone/pr Build is failing

This commit is contained in:
light7734 2025-10-09 16:32:09 +03:30
parent 80d87226ed
commit 98df2908a8
Signed by: light7734
GPG key ID: 8C30176798F1A6BA
3 changed files with 101 additions and 101 deletions

View file

@ -37,18 +37,18 @@ PRIVATE
add_test_module(renderer add_test_module(renderer
test/utils.cpp test/utils.cpp
# system.test.cpp system.test.cpp
# general backend tests through the frontend # general backend tests through the frontend
# frontend/messenger.test.cpp frontend/messenger.test.cpp
# frontend/context/surface.test.cpp frontend/context/surface.test.cpp
# frontend/context/device.test.cpp frontend/context/device.test.cpp
# frontend/context/swapchain.test.cpp frontend/context/swapchain.test.cpp
# frontend/renderer/pass.test.cpp frontend/renderer/pass.test.cpp
frontend/renderer/renderer.test.cpp frontend/renderer/renderer.test.cpp
# backend specific tests -- vk # backend specific tests -- vk
# backend/vk/context/instance.test.cpp backend/vk/context/instance.test.cpp
# backend specific tests -- dx # backend specific tests -- dx

View file

@ -5,92 +5,92 @@
Suite raii = "renderer_raii"_suite = [] { Suite raii = "renderer_raii"_suite = [] {
Case { "happy path won't throw" } = [] { Case { "happy path won't throw" } = [] {
auto fixture = FixtureDeviceSwapchain {}; auto fixture = FixtureDeviceSwapchain {};
// ignore = lt::renderer::IRenderer::create( ignore = lt::renderer::IRenderer::create(
// constants::api, constants::api,
// fixture.device(), fixture.device(),
// fixture.swapchain(), fixture.swapchain(),
// constants::frames_in_flight constants::frames_in_flight
// ); );
}; };
// Case { "unhappy path throws" } = [] { Case { "unhappy path throws" } = [] {
// auto fixture = FixtureDeviceSwapchain {}; auto fixture = FixtureDeviceSwapchain {};
//
// expect_throw([&] { expect_throw([&] {
// ignore = lt::renderer::IRenderer::create( ignore = lt::renderer::IRenderer::create(
// constants::api, constants::api,
// nullptr, nullptr,
// fixture.swapchain(), fixture.swapchain(),
// constants::frames_in_flight constants::frames_in_flight
// ); );
// }); });
//
// expect_throw([&] { expect_throw([&] {
// ignore = lt::renderer::IRenderer::create( ignore = lt::renderer::IRenderer::create(
// constants::api, constants::api,
// fixture.device(), fixture.device(),
// nullptr, nullptr,
// constants::frames_in_flight constants::frames_in_flight
// ); );
// }); });
//
// expect_throw([&] { expect_throw([&] {
// ignore = lt::renderer::IRenderer::create( ignore = lt::renderer::IRenderer::create(
// constants::api, constants::api,
// fixture.device(), fixture.device(),
// nullptr, nullptr,
// lt::renderer::IRenderer::frames_in_flight_upper_limit + 1 lt::renderer::IRenderer::frames_in_flight_upper_limit + 1
// ); );
// }); });
//
// expect_throw([&] { expect_throw([&] {
// ignore = lt::renderer::IRenderer::create( ignore = lt::renderer::IRenderer::create(
// constants::api, constants::api,
// fixture.device(), fixture.device(),
// nullptr, nullptr,
// lt::renderer::IRenderer::frames_in_flight_lower_limit - 1 lt::renderer::IRenderer::frames_in_flight_lower_limit - 1
// ); );
// }); });
// }; };
}; };
Suite draw = "renderer_draw"_suite = [] { Suite draw = "renderer_draw"_suite = [] {
using enum lt::renderer::IRenderer::DrawResult; using enum lt::renderer::IRenderer::DrawResult;
// Case { "renderer draw" } = [] { Case { "renderer draw" } = [] {
// auto fixture = FixtureDeviceSwapchain {}; auto fixture = FixtureDeviceSwapchain {};
// auto renderer = lt::renderer::IRenderer::create( auto renderer = lt::renderer::IRenderer::create(
// constants::api, constants::api,
// fixture.device(), fixture.device(),
// fixture.swapchain(), fixture.swapchain(),
// constants::frames_in_flight constants::frames_in_flight
// ); );
//
// for (auto frame_idx : std::views::iota(0u, 30u)) for (auto frame_idx : std::views::iota(0u, 30u))
// { {
// expect_eq(renderer->draw(frame_idx % constants::frames_in_flight), success); expect_eq(renderer->draw(frame_idx % constants::frames_in_flight), success);
// } }
// }; };
//
// Case { "post swapchain replacement renderer draw" } = [] { Case { "post swapchain replacement renderer draw" } = [] {
// auto fixture = FixtureDeviceSwapchain {}; auto fixture = FixtureDeviceSwapchain {};
// auto renderer = lt::renderer::IRenderer::create( auto renderer = lt::renderer::IRenderer::create(
// constants::api, constants::api,
// fixture.device(), fixture.device(),
// fixture.swapchain(), fixture.swapchain(),
// constants::frames_in_flight constants::frames_in_flight
// ); );
//
// for (auto frame_idx : std::views::iota(0u, 15u)) for (auto frame_idx : std::views::iota(0u, 15u))
// { {
// expect_eq(renderer->draw(frame_idx % constants::frames_in_flight), success); expect_eq(renderer->draw(frame_idx % constants::frames_in_flight), success);
// } }
//
// fixture.recreate_swapchain(); fixture.recreate_swapchain();
// renderer->replace_swapchain(fixture.swapchain()); renderer->replace_swapchain(fixture.swapchain());
// for (auto frame_idx : std::views::iota(0u, 15u)) for (auto frame_idx : std::views::iota(0u, 15u))
// { {
// expect_eq(renderer->draw(frame_idx % constants::frames_in_flight), success); expect_eq(renderer->draw(frame_idx % constants::frames_in_flight), success);
// } }
// }; };
}; };

View file

@ -131,21 +131,21 @@ public:
{ {
return m_device.get(); return m_device.get();
} }
//
// [[nodiscard]] auto swapchain() -> lt::renderer::ISwapchain * [[nodiscard]] auto swapchain() -> lt::renderer::ISwapchain *
// { {
// return m_swapchain.get(); return m_swapchain.get();
// } }
void recreate_swapchain() void recreate_swapchain()
{ {
// m_swapchain.reset(); m_swapchain.reset();
// m_swapchain = lt::renderer::ISwapchain::create( m_swapchain = lt::renderer::ISwapchain::create(
// constants::api, constants::api,
// surface(), surface(),
// gpu(), gpu(),
// m_device.get() m_device.get()
// ); );
} }
@ -201,7 +201,7 @@ private:
lt::memory::Scope<lt::renderer::IDevice> m_device { lt::memory::Scope<lt::renderer::IDevice> m_device {
lt::renderer::IDevice::create(constants::api, gpu(), surface()) lt::renderer::IDevice::create(constants::api, gpu(), surface())
}; };
//
lt::memory::Scope<lt::renderer::ISwapchain> m_swapchain { lt::memory::Scope<lt::renderer::ISwapchain> m_swapchain {
lt::renderer::ISwapchain::create(constants::api, surface(), gpu(), m_device.get()) lt::renderer::ISwapchain::create(constants::api, surface(), gpu(), m_device.get())
}; };