[Openal-devel] Faster buffer model, and more random stuff

Sherief N. Farouk sherief at mganin.com
Mon Mar 3 03:36:09 PST 2008


Edit: I actually sent this to Sergey instead of to the mailing list..

-----Original Message-----
From: Sherief N. Farouk [mailto:sherief at mganin.com] 
Sent: Monday, March 03, 2008 5:51 AM
To: 'Сергей Беляшов'
Subject: RE: [Openal-devel] Faster buffer model, and more random stuff

I don't think this entry point would have advantage over a smart implementation of BufferData. What protects it from reallocating is the size parameter is larger than the previous buffer size?

On a side note: my argument for an immutable buffer was based on the fact that for most buffers that get their data updated frequently, format almost never changes, and most likely size.

- Sherief

-----Original Message-----
From: openal-devel-bounces at opensource.creative.com [mailto:openal-devel-bounces at opensource.creative.com] On Behalf Of ?????? ???????
Sent: Monday, March 03, 2008 4:45 AM
To: openal-devel at opensource.creative.com
Subject: [Openal-devel] Faster buffer model, and more random stuff

I think that is better to use update ideology than mapping or static buffers.
For example:
/** \brief update buffer data
 * @param name buffer name
 * @param format data format
 * @param data pointer to the data
 * @param size data size
 * @param frequency data frequency
 * @return actual size of data used by this command
 */
ALsizei alBufferDataUpdate(ALuint name, ALenum format, const ALvoid* data,
                                                    ALsizei size,
ALsizei frequency);

For recently created buffers it works as alBufferData() but for
buffers which already contains some data it only updates them. Return
result indicating how many data copied to the buffer (depends on
current buffer size and internal audio format).

This function has advantages over static buffer extension and buffer
mapping, because it protect buffer from changing at play time and hide
internal buffer format. Also it guarantee no new internal memory
allocations (except first call for empty buffers) unlike static buffer
and alBufferData().
But has one disadvantage - program should use its our buffer for
realtime audio decoding which need to be passed to the
alBufferDataUpdate.

P.S.: sorry, if I use other's idea.
_______________________________________________
Openal-devel mailing list
Openal-devel at opensource.creative.com
http://opensource.creative.com/mailman/listinfo/openal-devel




More information about the Openal-devel mailing list