mirror of
https://github.com/mborgerson/xemu.git
synced 2025-12-01 16:10:01 +00:00
apu/vp: Make number of voice workers configurable
This commit is contained in:
@ -214,6 +214,10 @@ display:
|
||||
default: false
|
||||
|
||||
audio:
|
||||
vp:
|
||||
num_workers:
|
||||
type: integer
|
||||
default: 16
|
||||
use_dsp: bool
|
||||
hrtf:
|
||||
type: bool
|
||||
|
||||
@ -1761,6 +1761,8 @@ static void voice_work_init(MCPXAPUState *d)
|
||||
{
|
||||
VoiceWorkDispatch *vwd = &d->vp.voice_work_dispatch;
|
||||
|
||||
g_config.audio.vp.num_workers = MAX(1, MIN(g_config.audio.vp.num_workers, MAX_VOICE_WORKERS));
|
||||
|
||||
vwd->workers_should_exit = false;
|
||||
vwd->workers_pending = 0;
|
||||
vwd->queue_len = 0;
|
||||
|
||||
@ -31,7 +31,8 @@
|
||||
#include "svf.h"
|
||||
#include "hrtf.h"
|
||||
|
||||
#define NUM_VOICE_WORKERS 4
|
||||
#define NUM_VOICE_WORKERS g_config.audio.vp.num_workers
|
||||
#define MAX_VOICE_WORKERS 16
|
||||
|
||||
typedef struct MCPXAPUState MCPXAPUState;
|
||||
|
||||
@ -65,7 +66,7 @@ typedef struct VoiceWorker {
|
||||
|
||||
typedef struct VoiceWorkDispatch {
|
||||
QemuMutex lock;
|
||||
VoiceWorker workers[NUM_VOICE_WORKERS];
|
||||
VoiceWorker workers[MAX_VOICE_WORKERS];
|
||||
bool workers_should_exit;
|
||||
QemuCond work_pending;
|
||||
uint64_t workers_pending;
|
||||
|
||||
Reference in New Issue
Block a user