diff --git a/src/gui/gui.h b/src/gui/gui.h index 37b58cd78..eec988fca 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -1577,6 +1577,7 @@ class FurnaceGUI { int wasapiEx; int chanOscThreads; int renderPoolThreads; + int showPool; unsigned int maxUndoSteps; String mainFontPath; String headFontPath; @@ -1755,6 +1756,7 @@ class FurnaceGUI { wasapiEx(0), chanOscThreads(0), renderPoolThreads(0), + showPool(0), maxUndoSteps(100), mainFontPath(""), headFontPath(""), diff --git a/src/gui/settings.cpp b/src/gui/settings.cpp index f77200f47..4b5d88899 100644 --- a/src/gui/settings.cpp +++ b/src/gui/settings.cpp @@ -892,34 +892,36 @@ void FurnaceGUI::drawSettings() { ImGui::EndTable(); } - bool renderPoolThreadsB=(settings.renderPoolThreads>0); - if (ImGui::Checkbox("Multi-threaded (EXPERIMENTAL)",&renderPoolThreadsB)) { - if (renderPoolThreadsB) { - settings.renderPoolThreads=2; - } else { - settings.renderPoolThreads=0; + if (settings.showPool) { + bool renderPoolThreadsB=(settings.renderPoolThreads>0); + if (ImGui::Checkbox("Multi-threaded (EXPERIMENTAL)",&renderPoolThreadsB)) { + if (renderPoolThreadsB) { + settings.renderPoolThreads=2; + } else { + settings.renderPoolThreads=0; + } + } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("runs chip emulation on separate threads.\nmay increase performance on multi-core CPUs.\n\nwarnings:\n- experimental! currently broken/not working well.\n- only useful on multi-chip songs."); } - } - if (ImGui::IsItemHovered()) { - ImGui::SetTooltip("runs chip emulation on separate threads.\nmay increase performance on multi-core CPUs.\n\nwarnings:\n- experimental! currently broken/not working well.\n- only useful on multi-chip songs."); - } - if (renderPoolThreadsB) { - pushWarningColor(settings.renderPoolThreads>cpuCores,settings.renderPoolThreads>cpuCores); - if (ImGui::InputInt("Number of threads",&settings.renderPoolThreads)) { - if (settings.renderPoolThreads<2) settings.renderPoolThreads=2; - if (settings.renderPoolThreads>32) settings.renderPoolThreads=32; - } - if (settings.renderPoolThreads>=DIV_MAX_CHIPS) { - if (ImGui::IsItemHovered()) { - ImGui::SetTooltip("that's the limit!"); + if (renderPoolThreadsB) { + pushWarningColor(settings.renderPoolThreads>cpuCores,settings.renderPoolThreads>cpuCores); + if (ImGui::InputInt("Number of threads",&settings.renderPoolThreads)) { + if (settings.renderPoolThreads<2) settings.renderPoolThreads=2; + if (settings.renderPoolThreads>32) settings.renderPoolThreads=32; } - } else if (settings.renderPoolThreads>cpuCores) { - if (ImGui::IsItemHovered()) { - ImGui::SetTooltip("it is a VERY bad idea to set this number higher than your CPU core count (%d)!",cpuCores); + if (settings.renderPoolThreads>=DIV_MAX_CHIPS) { + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("that's the limit!"); + } + } else if (settings.renderPoolThreads>cpuCores) { + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("it is a VERY bad idea to set this number higher than your CPU core count (%d)!",cpuCores); + } } + popWarningColor(); } - popWarningColor(); } bool lowLatencyB=settings.lowLatency; @@ -3063,6 +3065,7 @@ void FurnaceGUI::drawSettings() { // "Nice Amiga cover of the song!" - enables hidden systems (YMU759/SoundUnit/Dummy) // "42 63" - enables all instrument types // "4-bit FDS" - enables partial pitch linearity option + // "Power of the Chip" - enables options for multi-threaded audio // "????" - enables stuff CONFIG_SECTION("Cheat Codes") { // SUBSECTION ENTER CODE: @@ -3317,6 +3320,7 @@ void FurnaceGUI::syncSettings() { settings.wasapiEx=e->getConfInt("wasapiEx",0); settings.chanOscThreads=e->getConfInt("chanOscThreads",0); settings.renderPoolThreads=e->getConfInt("renderPoolThreads",0); + settings.showPool=e->getConfInt("showPool",0); clampSetting(settings.mainFontSize,2,96); clampSetting(settings.headFontSize,2,96); @@ -3467,7 +3471,8 @@ void FurnaceGUI::syncSettings() { clampSetting(settings.classicChipOptions,0,1); clampSetting(settings.wasapiEx,0,1); clampSetting(settings.chanOscThreads,0,256); - clampSetting(settings.renderPoolThreads,0,256); + clampSetting(settings.renderPoolThreads,0,DIV_MAX_CHIPS); + clampSetting(settings.showPool,0,1); if (settings.exportLoops<0.0) settings.exportLoops=0.0; if (settings.exportFadeOut<0.0) settings.exportFadeOut=0.0; @@ -3726,6 +3731,7 @@ void FurnaceGUI::commitSettings() { e->setConf("wasapiEx",settings.wasapiEx); e->setConf("chanOscThreads",settings.chanOscThreads); e->setConf("renderPoolThreads",settings.renderPoolThreads); + e->setConf("showPool",settings.showPool); // colors for (int i=0; i