aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/alBuffer.c
Commit message (Collapse)AuthorAgeFilesLines
* Convert alBuffer.c to C++Chris Robinson2018-10-311-1305/+0
| | | | A test to ensure everything works.
* Simplify some statementsFilip Gawin2018-10-291-1/+1
|
* Remove the unused thunk codeChris Robinson2018-02-021-1/+0
|
* Remove the individual source queue and buffer locksChris Robinson2018-02-021-48/+20
| | | | | | | They're inherently protected by the mutex for their respective lists. Should those mutexes be replaced by rwlocks the individual locks should also be reinstated, but they're unlikely to be unless a lot of contention starts happening in the read-only case.
* Fix error reporting for resource generationChris Robinson2018-01-271-0/+2
|
* Add some casts to pacify MSVCChris Robinson2018-01-271-2/+2
|
* Use a different method for storing and looking up buffersChris Robinson2018-01-271-81/+130
| | | | | | | | | | | | | | | | | Rather than each buffer being individually allocated with a generated 'thunk' ID that's used with a uint:ptr map, buffers are allocated in arrays of 64 within a vector. Each group of 64 has an associated 64-bit mask indicating which are free to use, and the buffer ID is comprised of the two array indices which directly locate the buffer (no searching, binary or otherwise). Currently no buffers are actually deallocated after being allocated, though they are reused. So an app that creates a ton of buffers once, then deletes them all and uses only a couple from then on, will have a bit of waste, while an app that's more consistent with the number of used buffers won't be a problem. This can be improved by removing elements of the containing vector that contain all-free buffers while there are plenty of other free buffers. Also, this method can easily be applied to other resources, like sources.
* Make some functions static that are only used in one sourceChris Robinson2018-01-261-4/+9
|
* Allow preserving converted samplesChris Robinson2018-01-261-5/+5
|
* Read the buffer unpack alignment under the buffer lockChris Robinson2018-01-261-69/+76
|
* Improve error reporting for buffersChris Robinson2018-01-261-262/+269
|
* Construct error messages using parameterized valuesChris Robinson2018-01-251-101/+107
|
* Provide messages for the remaining AL errorsChris Robinson2018-01-241-91/+105
|
* Set the buffer load error in LoadDataChris Robinson2018-01-241-42/+32
|
* Call the event callback when an error is generatedChris Robinson2018-01-241-7/+8
| | | | | Most errors don't yet provide correct object IDs or text messages for the AL error.
* Use a new proper buffer function with a flags parameterChris Robinson2018-01-231-9/+10
| | | | | | Rather than hackily combining bit flags with the format, to increase the number of potential flags. alBufferData now behaves as if calling alBufferStorageSOFT with a flags value of 0.
* Ensure read or write flags are specified with persistent mappingsChris Robinson2018-01-231-4/+7
|
* Track the buffer's mapped sectionChris Robinson2018-01-231-3/+8
|
* Add a flag for persistent mappingChris Robinson2018-01-231-6/+43
| | | | And a function to "flush" a mapped buffer
* Slightly simplify alBufferSubDataSOFTChris Robinson2018-01-221-36/+13
|
* Ensure proper alignment when preserving data tooChris Robinson2018-01-221-2/+3
|
* Don't bother allocating cleared memory for buffer storageChris Robinson2018-01-221-1/+1
|
* Add a flag for alBufferData to non-destructively resize the dataChris Robinson2018-01-221-7/+23
| | | | | | Requires having the same format as the last call to alBufferData. Also only makes sense when given a NULL data pointer, as otherwise the internal data will be overwritten anyway.
* Don't convert/copy samples with a NULL dest bufferChris Robinson2018-01-221-6/+4
| | | | Only happens with a 0 size, so there's nothing to copy or convert anyway.
* More cleanup for buffer loadingChris Robinson2018-01-211-186/+90
| | | | | Don't bother with unnecessary and unused converters, and remove some unsupported queries.
* Handle double-precision buffers in the mixerChris Robinson2018-01-211-24/+2
|
* Remove support for (signed) byte and ushort sample storageChris Robinson2018-01-211-6/+2
| | | | Also not used without buffer_samples
* Remove (u)int32 sample storage conversionChris Robinson2018-01-211-4/+0
| | | | Unused without the buffer_samples extension
* Remove the old buffer_samples functionsChris Robinson2018-01-211-161/+15
| | | | | | | The symbols are still there and exported to retain ABI compatibility, but they no longer do anything except set an AL_INVALID_OPERATION error. They're also removed from the function and enum tables, since they're not part of any supported extension.
* Avoid repeating some codeChris Robinson2018-01-211-12/+6
|
* Add methods to "map" a buffer's storageChris Robinson2018-01-201-12/+109
| | | | | | | | | | | | | | | | | | | | | | Requires the MAP_READ_BIT or MAP_WRITE_BIT flags to be OR'd with the format upon a call to alBufferData, to enable mappable storage for the given access types. This will fail if the format requires internal conversion and doesn't resemble the original input data, so the app can be guaranteed the size, type, and layout of the original data is the same as what's in storage. Then alMapBufferSOFT may be called with appropriate bit flags to get a readable and/or writable pointer to the buffer's sample storage. alUnmapBufferSOFT must be called when access is finished. It is currently invalid to map a buffer that is attached to a source, or to attach a buffer to a source that is currently mapped. This restriction may be eased in the future, at least to allow read- only access while in use (perhaps also to allow writing, if coherency can be achieved). Currently the access flags occupy the upper 8 bits of a 32-bit bitfield to avoid clashing with format enum values, which don't use more than 16 or 17 bits. This means any future formats are limited to 24-bit enum values, and also means only 8 flags are possible when declaring storage. The alternative would be to add a new function (alBufferStorage?) with a separate flags parameter.
* Return the effective alignment from SanitizeAlignmentChris Robinson2018-01-191-28/+26
|
* Store 8-bit sample types directly as unsigned byteChris Robinson2018-01-191-12/+12
|
* Remove unnecessary private AL_SOFT_buffer_samples2 definitionsChris Robinson2018-01-191-3/+0
|
* Make a function static that's only used in one source fileChris Robinson2018-01-171-1/+2
|
* Reformat the format arrayChris Robinson2018-01-171-36/+36
|
* Store mulaw and alaw samples directly in the bufferChris Robinson2018-01-171-24/+15
| | | | | | | They're now decompressed on the fly in the mixer. This is not a significant performance issue given that it only needs a 512-byte lookup table, and the buffer stores half as much data (it may actually be faster, requiring less overall memory).
* Remove a couple more uses of BYTE3Chris Robinson2017-03-311-2/+0
|
* Remove the (u)byte3 sample formatsChris Robinson2017-03-311-4/+0
| | | | | They're not accessible since the removal of the buffer_samples extension, and were kind of clunky to work with as 24-bit packed values.
* Use ALsizei in more placesChris Robinson2017-01-181-10/+10
|
* Use separate macros for atomics that don't take a memory orderChris Robinson2016-12-201-9/+9
|
* Remove use of DECL_CONSTChris Robinson2016-09-061-4/+4
| | | | | No idea if it was really gaining us anything, but removing it fixes a crash I was getting with libs built with Clang.
* Initialize some enums to dummy valuesChris Robinson2016-08-311-8/+9
|
* Use separate arrays for UIntMap keys and valuesChris Robinson2016-07-041-2/+2
|
* Avoid using realloc in a number of placesChris Robinson2016-05-211-12/+23
|
* Hold the buffer map lock while handling the bufferChris Robinson2016-05-101-1/+42
|
* Start AL_SOFT_buffer_samples2 as a replacement for AL_SOFT_buffer_samplesChris Robinson2016-04-251-6/+9
|
* Support AL_EXT_MULAW_BFORMATChris Robinson2014-10-311-0/+2
|
* Add preliminary AL_EXT_BFORMAT supportChris Robinson2014-10-311-0/+28
| | | | | Currently missing the AL_ORIENTATION source property. Gain stepping also does not work.
* Make the buffer's pack and unpack properties atomicChris Robinson2014-09-031-9/+9
|