Browse Source

add "fbo_shared" config option (true=use FBOs in dynamically loaded modules)

pull/1639/head
bsp2 6 years ago
parent
commit
149eb47fe4
4 changed files with 96 additions and 81 deletions
  1. +2
    -0
      include/global_ui.hpp
  2. +11
    -0
      src/settings.cpp
  3. +3
    -2
      src/widgets/FramebufferWidget.cpp
  4. +80
    -79
      vst2_bin/settings.json

+ 2
- 0
include/global_ui.hpp View File

@@ -105,6 +105,7 @@ struct GlobalUI {
} param_info;

bool b_fbo; // usually true. set to false when using the VirtualBox GL driver.
bool b_fbo_shared; // this may or may not work. default is false (=> don't use FBOs in dynamically loaded modules).
int pending_swap_interval; // -1=none, 1=vsync on, 0=vsync off

void init(void) {
@@ -156,6 +157,7 @@ struct GlobalUI {
param_info.placeholder_framecount = 0;

b_fbo = true;
b_fbo_shared = false;
pending_swap_interval = -1;
}



+ 11
- 0
src/settings.cpp View File

@@ -86,6 +86,10 @@ static json_t *settingsToJson() {
json_t *fboJ = json_boolean(global_ui->b_fbo);
json_object_set_new(rootJ, "fbo", fboJ);

// fbo_shared (dynamically loaded modules)
json_t *fbo_sharedJ = json_boolean(global_ui->b_fbo_shared);
json_object_set_new(rootJ, "fbo_shared", fbo_sharedJ);

// touchInput
int touchInput = lglw_touchinput_get(global_ui->window.lglw);
json_t *touchInputJ = json_boolean(touchInput);
@@ -273,6 +277,13 @@ static void settingsFromJson(json_t *rootJ, bool bWindowSizeOnly) {
global_ui->b_fbo = json_is_true(fboJ);
}

// fbo support in dynamically loaded modules (not working with VirtualBox GL driver or Windows NVidia driver)
json_t *fbo_sharedJ = json_object_get(rootJ, "fbo_shared");
if (fbo_sharedJ)
{
global_ui->b_fbo_shared = json_is_true(fbo_sharedJ);
}

// allowCursorLock
json_t *allowCursorLockJ = json_object_get(rootJ, "allowCursorLock");
if (allowCursorLockJ)


+ 3
- 2
src/widgets/FramebufferWidget.cpp View File

@@ -36,12 +36,13 @@ FramebufferWidget::~FramebufferWidget() {

void FramebufferWidget::draw(NVGcontext *vg) {
// Bypass framebuffer rendering entirely
// printf("xxx FramebufferWidget::draw\n");
// printf("xxx FramebufferWidget::draw: global_ui=%p\n", global_ui);
#ifdef RACK_PLUGIN_SHARED
bool bFBO = false;
bool bFBO = global_ui->b_fbo_shared;
#else
bool bFBO = global_ui->b_fbo;
#endif // RACK_PLUGIN_SHARED
// printf("xxx FramebufferWidget::draw: global_ui=%p, bFBO=%d\n", global_ui, bFBO);
// (note) FBO path crashes when plugin is a DLL (!)
// (the glGenFramebuffers() call in nvgluCreateFramebuffer() to be precise)
if(!bFBO)


+ 80
- 79
vst2_bin/settings.json View File

@@ -14,6 +14,7 @@
"refreshRate": 30,
"vsync": true,
"fbo": true,
"fbo_shared": false,
"touchInput": false,
"touchKbd": false,
"oversampleFactor": 1.0,
@@ -31,16 +32,8 @@
"moduleBrowser": {
"favorites": [
{
"plugin": "AS",
"model": "TriLFO"
},
{
"plugin": "AS",
"model": "AtNuVrTr"
},
{
"plugin": "AS",
"model": "ADSR"
"plugin": "Core",
"model": "Notes"
},
{
"plugin": "21kHz",
@@ -51,8 +44,16 @@
"model": "SpecificValue"
},
{
"plugin": "Core",
"model": "Notes"
"plugin": "AS",
"model": "ADSR"
},
{
"plugin": "AS",
"model": "TriLFO"
},
{
"plugin": "AS",
"model": "AtNuVrTr"
},
{
"plugin": "AudibleInstruments",
@@ -62,57 +63,45 @@
"plugin": "AudibleInstruments",
"model": "Elements"
},
{
"plugin": "Autodafe",
"model": "Multiple 1x8"
},
{
"plugin": "AudibleInstruments",
"model": "Clouds"
},
{
"plugin": "Bidoo",
"model": "rabBIT"
"plugin": "Autodafe",
"model": "Multiple 1x8"
},
{
"plugin": "Befaco",
"model": "Mixer"
},
{
"plugin": "Bogaudio",
"model": "Bogaudio-Additator"
},
{
"plugin": "Bogaudio",
"model": "Bogaudio-XCO"
},
{
"plugin": "Bogaudio",
"model": "Bogaudio-XFade"
},
{
"plugin": "Befaco",
"model": "SlewLimiter"
},
{
"plugin": "Bidoo",
"model": "lIMbO"
},
{
"plugin": "Bidoo",
"model": "ÎŁ"
},
{
"plugin": "Bidoo",
"model": "lIMbO"
"model": "rabBIT"
},
{
"plugin": "Bogaudio",
"model": "Bogaudio-Noise"
"model": "Bogaudio-XCO"
},
{
"plugin": "DHE-Modules",
"model": "Cubic"
"plugin": "Bogaudio",
"model": "Bogaudio-Additator"
},
{
"plugin": "Bogaudio",
"model": "Bogaudio-SampleHold"
"model": "Bogaudio-XFade"
},
{
"plugin": "Bogaudio",
@@ -124,23 +113,23 @@
},
{
"plugin": "Bogaudio",
"model": "Bogaudio-Switch"
"model": "Bogaudio-Noise"
},
{
"plugin": "Fundamental",
"model": "VCA-1"
"plugin": "Bogaudio",
"model": "Bogaudio-SampleHold"
},
{
"plugin": "Fundamental",
"model": "VCO"
"plugin": "Bogaudio",
"model": "Bogaudio-Switch"
},
{
"plugin": "Fundamental",
"model": "VCO2"
"plugin": "DHE-Modules",
"model": "Cubic"
},
{
"plugin": "Fundamental",
"model": "VCMixer"
"plugin": "ErraticInstruments",
"model": "MPEToCV"
},
{
"plugin": "FrankBussFormula",
@@ -148,47 +137,55 @@
},
{
"plugin": "Fundamental",
"model": "Scope"
"model": "VCO"
},
{
"plugin": "Fundamental",
"model": "LFO"
"model": "VCO2"
},
{
"plugin": "Fundamental",
"model": "VCF"
},
{
"plugin": "Fundamental",
"model": "VCA-1"
},
{
"plugin": "Fundamental",
"model": "VCA"
},
{
"plugin": "ErraticInstruments",
"model": "MPEToCV"
"plugin": "Fundamental",
"model": "LFO"
},
{
"plugin": "Fundamental",
"model": "LFO2"
},
{
"plugin": "huaba",
"model": "EQ3"
"plugin": "Fundamental",
"model": "VCMixer"
},
{
"plugin": "JE",
"model": "RingModulator"
"plugin": "Fundamental",
"model": "Scope"
},
{
"plugin": "HetrickCV",
"model": "Exponent"
},
{
"plugin": "ML_modules",
"model": "VoltMeter"
"plugin": "huaba",
"model": "EQ3"
},
{
"plugin": "mscHack",
"model": "Maude221"
"plugin": "JE",
"model": "RingModulator"
},
{
"plugin": "LindenbergResearch",
"model": "VCF"
},
{
"plugin": "LindenbergResearch",
@@ -203,64 +200,68 @@
"model": "Westcoast VCS"
},
{
"plugin": "LindenbergResearch",
"model": "VCF"
"plugin": "ML_modules",
"model": "VoltMeter"
},
{
"plugin": "Southpole",
"model": "Abr"
"plugin": "mscHack",
"model": "Maude221"
},
{
"plugin": "PG-Instruments",
"model": "PGVCF"
"model": "PGPanner"
},
{
"plugin": "PG-Instruments",
"model": "PGPanner"
"model": "PGVCF"
},
{
"plugin": "bsp",
"model": "RMS"
"plugin": "Southpole",
"model": "Abr"
},
{
"plugin": "bsp",
"model": "Obxd_VCF"
"plugin": "Valley",
"model": "Dexter"
},
{
"plugin": "bsp",
"model": "Legato"
"plugin": "Valley",
"model": "Plateau"
},
{
"plugin": "bsp",
"model": "Sway"
"model": "AttenuMixer"
},
{
"plugin": "bsp",
"model": "TunedDelayLine"
"model": "DownSampler"
},
{
"plugin": "Template_shared",
"model": "MyModule"
"plugin": "bsp",
"model": "Legato"
},
{
"plugin": "bsp",
"model": "Scanner"
"model": "Obxd_VCF"
},
{
"plugin": "Valley",
"model": "Plateau"
"plugin": "bsp",
"model": "RMS"
},
{
"plugin": "bsp",
"model": "AttenuMixer"
"model": "Scanner"
},
{
"plugin": "Valley",
"model": "Dexter"
"plugin": "bsp",
"model": "Sway"
},
{
"plugin": "bsp",
"model": "DownSampler"
"model": "TunedDelayLine"
},
{
"plugin": "Template_shared",
"model": "MyModule"
}
]
},


Loading…
Cancel
Save