18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-02 02:42:46 +01:00

fix(render): texture streaming by default with Vulkan only, the streamer after a fallback, failed banks tried again

After review of #555:

- gfx.textures.streaming is on by default with the Vulkan renderer only, the one it was measured with; with OpenGL it stays
  off as before. A value set in eu07.ini is kept for either renderer. A Vulkan renderer falling back to OpenGL as it starts
  goes without it. The default turned on is logged, as the settings are logged before the renderer is chosen.
- The geometry streamer stopped by the shutdown of a Vulkan renderer that failed to start resumes for the OpenGL renderer
  made after it (geometry_streamer::resume()); before, every streamed model stayed undrawn for the session.
- A bank whose load failed is tried again: 5 s after the first failure, twice as long after each one that follows, up to
  5 min, by the streamer as it's drawn and by load_now(). Only the first failure in a row is logged. A transient read error
  no longer leaves the model undrawn till a restart.
This commit is contained in:
maj00r
2026-11-30 20:56:03 +01:00
parent d3c9a94af2
commit 65a7bed64e
7 changed files with 79 additions and 10 deletions
+16
View File
@@ -79,6 +79,18 @@ ui_layer uilayerstaticinitializer;
namespace
{
// gfx.textures.streaming not set in eu07.ini: the textures are streamed with the vulkan renderer, which was measured with it, and
// read whole with opengl as before
void default_texture_streaming()
{
if (Global.gfx_texture_streaming_set)
return;
Global.gfx_texture_streaming = (Global.GfxRenderer == "vulkan");
// the settings were logged before the renderer was chosen
if (Global.gfx_texture_streaming)
WriteLog("gfx.textures.streaming yes: the default of the vulkan renderer");
}
#ifdef _WIN32
// windows wakes a sleeping thread of a process which didn't ask for a finer timer in steps of up to ~15.6 ms.
// the wait of fpslimit sleeps, so a 10 ms frame slot of fpslimit 100 ended ~15.6 ms later, the pacer made it up
@@ -1615,6 +1627,7 @@ void eu07_application::select_gfx_backend()
{
m_gfxbackend = factory->backend("modern");
}
default_texture_streaming();
crashreport_add_info("gfxrenderer", Global.GfxRenderer);
WriteLog("renderer: " + (m_gfxbackend != nullptr ? m_gfxbackend->name : std::string("none")));
@@ -1697,6 +1710,7 @@ int eu07_application::fallback_to_opengl(std::string const &Reason)
crashreport_add_info("gfxrenderer_fallback", Reason);
Global.GfxRenderer = "default";
m_gfxbackend = gfx_renderer_factory::get_instance()->backend("modern");
default_texture_streaming();
crashreport_add_info("gfxrenderer", Global.GfxRenderer);
WriteLog("renderer: " + (m_gfxbackend != nullptr ? m_gfxbackend->name : std::string("none")));
@@ -1759,6 +1773,8 @@ int eu07_application::init_gfx()
// the reason is in the log already
GfxRenderer->Shutdown();
GfxRenderer.reset();
// the shutdown of the vulkan renderer stopped the streaming of the geometry; opengl streams it too
gfx::geometry_streamer::instance().resume();
if (fallback_to_opengl("the renderer failed to start") != 0)
{
return -1;