From ccd35bffe7ba6365e194a9332cf73e71412b80cd Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Thu, 20 Sep 2012 14:54:28 -0700 Subject: Help ensure the update size is a multiple of 4 with SSE --- Alc/ALc.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Alc/ALc.c') diff --git a/Alc/ALc.c b/Alc/ALc.c index 7b18481c..dcbd848f 100644 --- a/Alc/ALc.c +++ b/Alc/ALc.c @@ -1540,6 +1540,9 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList) device->UpdateSize = (ALuint64)device->UpdateSize * freq / device->Frequency; + /* SSE does best with the update size being a multiple of 4 */ + if((CPUCapFlags&CPU_CAP_SSE)) + device->UpdateSize = (device->UpdateSize+3)&~3; device->Frequency = freq; device->NumMonoSources = numMono; @@ -2799,6 +2802,8 @@ ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *deviceName) ConfigValueUInt(NULL, "period_size", &device->UpdateSize); device->UpdateSize = clampu(device->UpdateSize, 64, 8192); + if((CPUCapFlags&CPU_CAP_SSE)) + device->UpdateSize = (device->UpdateSize+3)&~3; ConfigValueUInt(NULL, "sources", &device->MaxNoOfSources); if(device->MaxNoOfSources == 0) device->MaxNoOfSources = 256; -- cgit v1.2.3