diff options
author | Chris Robinson <[email protected]> | 2023-05-23 01:54:46 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2023-05-23 01:54:46 -0700 |
commit | 85c82693e89a76f17257a2ef8256ca22e5192289 (patch) | |
tree | 35119a7242d3e8f4ea99262e8ec92a5929d7b758 /al | |
parent | b5da8485c2c01ec4039e0d15d03879dbc45f6b88 (diff) |
Use the macros to declare the indirect context thunks
Diffstat (limited to 'al')
-rw-r--r-- | al/debug.cpp | 49 | ||||
-rw-r--r-- | al/direct_defs.h | 8 |
2 files changed, 15 insertions, 42 deletions
diff --git a/al/debug.cpp b/al/debug.cpp index 7d119944..5a3f4873 100644 --- a/al/debug.cpp +++ b/al/debug.cpp @@ -18,6 +18,7 @@ #include "alc/inprogext.h" #include "alspan.h" #include "core/logging.h" +#include "direct_defs.h" #include "opthelpers.h" #include "threads.h" @@ -233,13 +234,7 @@ void ALCcontext::sendDebugMessage(std::unique_lock<std::mutex> &debuglock, Debug } -FORCE_ALIGN void AL_APIENTRY alDebugMessageCallbackEXT(ALDEBUGPROCEXT callback, void *userParam) noexcept -{ - auto context = GetContextRef(); - if(!context) UNLIKELY return; - return alDebugMessageCallbackDirectEXT(context.get(), callback, userParam); -} - +FORCE_ALIGN DECL_FUNCEXT2(void, alDebugMessageCallback,EXT, ALDEBUGPROCEXT, void*) FORCE_ALIGN void AL_APIENTRY alDebugMessageCallbackDirectEXT(ALCcontext *context, ALDEBUGPROCEXT callback, void *userParam) noexcept { @@ -249,13 +244,7 @@ FORCE_ALIGN void AL_APIENTRY alDebugMessageCallbackDirectEXT(ALCcontext *context } -FORCE_ALIGN void AL_APIENTRY alDebugMessageInsertEXT(ALenum source, ALenum type, ALuint id, ALenum severity, ALsizei length, const ALchar *message) noexcept -{ - auto context = GetContextRef(); - if(!context) UNLIKELY return; - return alDebugMessageInsertDirectEXT(context.get(), source, type, id, severity, length, message); -} - +FORCE_ALIGN DECL_FUNCEXT6(void, alDebugMessageInsert,EXT, ALenum, ALenum, ALuint, ALenum, ALsizei, const ALchar*) FORCE_ALIGN void AL_APIENTRY alDebugMessageInsertDirectEXT(ALCcontext *context, ALenum source, ALenum type, ALuint id, ALenum severity, ALsizei length, const ALchar *message) noexcept { @@ -295,13 +284,7 @@ FORCE_ALIGN void AL_APIENTRY alDebugMessageInsertDirectEXT(ALCcontext *context, } -FORCE_ALIGN void AL_APIENTRY alDebugMessageControlEXT(ALenum source, ALenum type, ALenum severity, ALsizei count, const ALuint *ids, ALboolean enable) noexcept -{ - auto context = GetContextRef(); - if(!context) UNLIKELY return; - return alDebugMessageControlDirectEXT(context.get(), source, type, severity, count, ids, enable); -} - +FORCE_ALIGN DECL_FUNCEXT6(void, alDebugMessageControl,EXT, ALenum, ALenum, ALenum, ALsizei, const ALuint*, ALboolean) FORCE_ALIGN void AL_APIENTRY alDebugMessageControlDirectEXT(ALCcontext *context, ALenum source, ALenum type, ALenum severity, ALsizei count, const ALuint *ids, ALboolean enable) noexcept { @@ -397,13 +380,7 @@ FORCE_ALIGN void AL_APIENTRY alDebugMessageControlDirectEXT(ALCcontext *context, } -FORCE_ALIGN void AL_APIENTRY alPushDebugGroupEXT(ALenum source, ALuint id, ALsizei length, const ALchar *message) noexcept -{ - auto context = GetContextRef(); - if(!context) UNLIKELY return; - return alPushDebugGroupDirectEXT(context.get(), source, id, length, message); -} - +FORCE_ALIGN DECL_FUNCEXT4(void, alPushDebugGroup,EXT, ALenum, ALuint, ALsizei, const ALchar*) FORCE_ALIGN void AL_APIENTRY alPushDebugGroupDirectEXT(ALCcontext *context, ALenum source, ALuint id, ALsizei length, const ALchar *message) noexcept { @@ -445,13 +422,7 @@ FORCE_ALIGN void AL_APIENTRY alPushDebugGroupDirectEXT(ALCcontext *context, ALen newback.mMessage.data()); } -FORCE_ALIGN void AL_APIENTRY alPopDebugGroupEXT(void) noexcept -{ - auto context = GetContextRef(); - if(!context) UNLIKELY return; - return alPopDebugGroupDirectEXT(context.get()); -} - +FORCE_ALIGN DECL_FUNCEXT(void, alPopDebugGroup,EXT) FORCE_ALIGN void AL_APIENTRY alPopDebugGroupDirectEXT(ALCcontext *context) noexcept { std::unique_lock<std::mutex> debuglock{context->mDebugCbLock}; @@ -474,13 +445,7 @@ FORCE_ALIGN void AL_APIENTRY alPopDebugGroupDirectEXT(ALCcontext *context) noexc } -FORCE_ALIGN ALuint AL_APIENTRY alGetDebugMessageLogEXT(ALuint count, ALsizei logBufSize, ALenum *sources, ALenum *types, ALuint *ids, ALenum *severities, ALsizei *lengths, ALchar *logBuf) noexcept -{ - auto context = GetContextRef(); - if(!context) UNLIKELY return 0; - return alGetDebugMessageLogDirectEXT(context.get(), count, logBufSize, sources, types, ids, severities, lengths, logBuf); -} - +FORCE_ALIGN DECL_FUNCEXT8(ALuint, alGetDebugMessageLog,EXT, ALuint, ALsizei, ALenum*, ALenum*, ALuint*, ALenum*, ALsizei*, ALchar*) FORCE_ALIGN ALuint AL_APIENTRY alGetDebugMessageLogDirectEXT(ALCcontext *context, ALuint count, ALsizei logBufSize, ALenum *sources, ALenum *types, ALuint *ids, ALenum *severities, ALsizei *lengths, ALchar *logBuf) noexcept diff --git a/al/direct_defs.h b/al/direct_defs.h index d8946eb4..7526b611 100644 --- a/al/direct_defs.h +++ b/al/direct_defs.h @@ -116,4 +116,12 @@ R AL_APIENTRY Name##Ext(T1 a, T2 b, T3 c, T4 d, T5 e, T6 f) noexcept \ return Name##Direct##Ext(context.get(), a, b, c, d, e, f); \ } +#define DECL_FUNCEXT8(R, Name,Ext, T1, T2, T3, T4, T5, T6, T7, T8) \ +R AL_APIENTRY Name##Ext(T1 a, T2 b, T3 c, T4 d, T5 e, T6 f, T7 g, T8 h) noexcept \ +{ \ + auto context = GetContextRef(); \ + if(!context) UNLIKELY return detail_::DefaultVal<R>(); \ + return Name##Direct##Ext(context.get(), a, b, c, d, e, f, g, h); \ +} + #endif /* AL_DIRECT_DEFS_H */ |