mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-05-10 10:51:42 +00:00
hwr2: Imgui EndFrame if we didn't Render
fixes a failed ImGui assertion in Debug builds
This commit is contained in:
parent
1958394635
commit
7c01136247
1 changed files with 8 additions and 1 deletions
|
|
@ -54,6 +54,7 @@ struct InternalPassData
|
||||||
|
|
||||||
static std::unique_ptr<InternalPassData> g_passes;
|
static std::unique_ptr<InternalPassData> g_passes;
|
||||||
static Rhi* g_last_known_rhi = nullptr;
|
static Rhi* g_last_known_rhi = nullptr;
|
||||||
|
static bool g_imgui_frame_active = false;
|
||||||
|
|
||||||
Handle<Rhi> srb2::sys::g_current_rhi = kNullHandle;
|
Handle<Rhi> srb2::sys::g_current_rhi = kNullHandle;
|
||||||
|
|
||||||
|
|
@ -220,6 +221,7 @@ static InternalPassData build_pass_manager()
|
||||||
[](PassManager&, Rhi& rhi) {},
|
[](PassManager&, Rhi& rhi) {},
|
||||||
[framebuffer_manager](PassManager&, Rhi& rhi)
|
[framebuffer_manager](PassManager&, Rhi& rhi)
|
||||||
{
|
{
|
||||||
|
g_imgui_frame_active = false;
|
||||||
rhi.present();
|
rhi.present();
|
||||||
rhi.finish();
|
rhi.finish();
|
||||||
framebuffer_manager->reset_post();
|
framebuffer_manager->reset_post();
|
||||||
|
|
@ -322,11 +324,16 @@ void I_NewTwodeeFrame(void)
|
||||||
|
|
||||||
void I_NewImguiFrame(void)
|
void I_NewImguiFrame(void)
|
||||||
{
|
{
|
||||||
// TODO move this to srb2loop
|
if (g_imgui_frame_active)
|
||||||
|
{
|
||||||
|
ImGui::EndFrame();
|
||||||
|
g_imgui_frame_active = false;
|
||||||
|
}
|
||||||
ImGuiIO& io = ImGui::GetIO();
|
ImGuiIO& io = ImGui::GetIO();
|
||||||
io.DisplaySize.x = vid.realwidth;
|
io.DisplaySize.x = vid.realwidth;
|
||||||
io.DisplaySize.y = vid.realheight;
|
io.DisplaySize.y = vid.realheight;
|
||||||
ImGui::NewFrame();
|
ImGui::NewFrame();
|
||||||
|
g_imgui_frame_active = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void maybe_reinit_passes(Rhi* rhi)
|
static void maybe_reinit_passes(Rhi* rhi)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue