diff options
author | Chris Robinson <[email protected]> | 2012-09-20 14:54:28 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2012-09-20 14:54:28 -0700 |
commit | ccd35bffe7ba6365e194a9332cf73e71412b80cd (patch) | |
tree | 44c7d9b204c828fb062cf606463f2873b3622aef /Alc/ALc.c | |
parent | d1c93525ed6f3e2ff42d6e7dcaf0c75521fa1556 (diff) |
Help ensure the update size is a multiple of 4 with SSE
Diffstat (limited to 'Alc/ALc.c')
-rw-r--r-- | Alc/ALc.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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; |