10 #include <string_view>
16 #include "alc/inprogext.h"
18 #include "alnumeric.h"
19 #include "core/buffer_storage.h"
23 enum class EaxStorage
: uint8_t {
31 struct ALbuffer
: public BufferStorage
{
32 ALbitfieldSOFT Access
{0u};
34 al::vector
<std::byte
,16> mDataStorage
;
36 ALuint OriginalSize
{0};
38 ALuint UnpackAlign
{0};
40 ALuint UnpackAmbiOrder
{1};
42 ALbitfieldSOFT MappedAccess
{0u};
43 ALsizei MappedOffset
{0};
44 ALsizei MappedSize
{0};
46 ALuint mLoopStart
{0u};
49 /* Number of times buffer was attached to a source (deletion can only occur when 0) */
50 std::atomic
<ALuint
> ref
{0u};
55 static void SetName(ALCcontext
*context
, ALuint id
, std::string_view name
);
60 EaxStorage eax_x_ram_mode
{EaxStorage::Automatic
};
61 bool eax_x_ram_is_hardware
{};
65 struct BufferSubList
{
66 uint64_t FreeMask
{~0_u64
};
67 gsl::owner
<std::array
<ALbuffer
,64>*> Buffers
{nullptr};
69 BufferSubList() noexcept
= default;
70 BufferSubList(const BufferSubList
&) = delete;
71 BufferSubList(BufferSubList
&& rhs
) noexcept
: FreeMask
{rhs
.FreeMask
}, Buffers
{rhs
.Buffers
}
72 { rhs
.FreeMask
= ~0_u64
; rhs
.Buffers
= nullptr; }
75 BufferSubList
& operator=(const BufferSubList
&) = delete;
76 BufferSubList
& operator=(BufferSubList
&& rhs
) noexcept
77 { std::swap(FreeMask
, rhs
.FreeMask
); std::swap(Buffers
, rhs
.Buffers
); return *this; }