![]() |
SDL2 Audio Callback Buffer Change | ![]() |
![]() |
SDL2 Audio Callback Buffer Change | ![]() |
Sam Lantinga
![]() |
![]() |
Yep, thanks for the heads up. I'll pull the memset from those drivers.
Cheers! On Wed, Jul 4, 2012 at 12:53 PM, Brian Barnes wrote:
|
||||||||||||||
|
![]() |
SDL2 Audio Callback Buffer Change | ![]() |
Sam Lantinga
![]() |
![]() |
Done!
On Thu, Jul 5, 2012 at 12:03 PM, Sam Lantinga wrote:
|
||||||||||||||||
|
![]() |
SDL2 Audio Callback Buffer Change | ![]() |
Forest Hale
Guest
![]() |
![]() |
I will note that in my game engines I regularly use memset before writing streaming data to intentionally fill the cache lines, with a small but measurable performance benefit on x86 despite the
redundancy of the act itself. Never really figured out why it helps but it does in my experience, I can only assume that my stream writing code is failing to satisfy the write-combine logic in some way. I have confirmed a performance gain from memset before writing on everything I've ever tried it on - sound data copies out of mixer buffers, skeletal animation of model vertices, and so on... But I do not have sufficient experience with other architectures to say whether memsetting first is a win or loss on other CPU architectures, just that on x86 it seems to help. On 07/05/2012 09:03 AM, Sam Lantinga wrote:
-- LordHavoc Author of DarkPlaces Quake1 engine - http://icculus.org/twilight/darkplaces Co-designer of Nexuiz - http://alientrap.org/nexuiz "War does not prove who is right, it proves who is left." - Unknown "Any sufficiently advanced technology is indistinguishable from a rigged demo." - James Klass "A game is a series of interesting choices." - Sid Meier _______________________________________________ SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
||||||||||||||
|
![]() |
SDL2 Audio Callback Buffer Change | ![]() |
Vance, Michael
Guest
![]() |
![]() |
On many architectures memset benefits from hardware support from instructions like dcbz on the PPC (which is essentially a combined prefetch or cache block zero). If you find optimizations like this interesting you may also want to explore usage of the restrict keyword.
m.
SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
||||||||||||||||||||||||
|
![]() |
SDL2 Audio Callback Buffer Change | ![]() |
Sam Lantinga
![]() |
![]() |
The memset implementation is probably using SIMD with a prefetch instruction. You might be able to get the same benefit by inlining that asm yourself. There are some examples of this in the SDL blitter code. :)
On Thu, Jul 5, 2012 at 12:26 PM, Forest Hale wrote:
|
||||||||||||||||||||
|