-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose 2 symbols from android_main #1739
base: dev
Are you sure you want to change the base?
Conversation
CI gfxreconstruct build queued with queue ID 255434. |
CI gfxreconstruct build # 4824 running. |
CI gfxreconstruct build # 4824 passed. |
CI gfxreconstruct build queued with queue ID 257140. |
CI gfxreconstruct build # 4834 running. |
CI gfxreconstruct build # 4834 passed. |
8649f3a
to
d69a888
Compare
CI gfxreconstruct build queued with queue ID 257347. |
CI gfxreconstruct build # 4836 running. |
CI gfxreconstruct build # 4836 failed. |
d69a888
to
cd94b79
Compare
CI gfxreconstruct build queued with queue ID 257792. |
CI gfxreconstruct build # 4838 running. |
CI gfxreconstruct build # 4838 passed. |
cd94b79
to
a05d10e
Compare
CI gfxreconstruct build queued with queue ID 257826. |
CI gfxreconstruct build # 4840 running. |
CI gfxreconstruct build # 4840 passed. |
a05d10e
to
e0bb8e7
Compare
CI gfxreconstruct build queued with queue ID 257885. |
CI gfxreconstruct build # 4843 running. |
CI gfxreconstruct build # 4843 passed. |
e0bb8e7
to
87b8876
Compare
CI gfxreconstruct build queued with queue ID 259546. |
CI gfxreconstruct build # 4864 running. |
CI gfxreconstruct build # 4864 failed. |
CI gfxreconstruct build queued with queue ID 260151. |
CI gfxreconstruct build # 4875 running. |
CI gfxreconstruct build # 4875 passed. |
CI gfxreconstruct build # 4885 running. |
CI gfxreconstruct build # 4885 passed. |
78300bd
to
6c29b4c
Compare
CI gfxreconstruct build queued with queue ID 263769. |
CI gfxreconstruct build # 4892 running. |
CI gfxreconstruct build # 4892 failed. |
6c29b4c
to
6cee752
Compare
CI gfxreconstruct build queued with queue ID 263824. |
CI gfxreconstruct build # 4894 running. |
CI gfxreconstruct build # 4894 passed. |
static bool injecting_api_calls_g = false; | ||
#endif | ||
|
||
using PFN_BeginInjectedCommands = void (*)(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, I wonder if those callbacks should have some void* pointers to allow using code not to rely on globals, just to have a bit a cleaner API even if it is not strictly needed for the current uses. Something like
using PFN_BeginInjectedCommands = void (*)(void*);
using PFN_EndInjectedCommands = void (*)(void*);
static PFN_BeginInjectedCommands BeginInjectCommands_fp = BeginEndInjectedCommandsNoop;
static PFN_EndInjectedCommands EndInjectCommands_fp = BeginEndInjectedCommandsNoop;
static void* InjectCommandsData_ptr = nullptr;
extern "C" void SetInjectedCommandCallbacks(PFN_BeginInjectedCommands begin_fp, PFN_EndInjectedCommands end_fp, void* data)
{
BeginInjectCommands_fp = begin_fp;
EndInjectCommands_fp = end_fp;
InjectCommandsData_ptr = data;
}
void BeginInjectedCommands()
{
....
BeginInjectCommands_fp(InjectCommandsData_ptr);
}
Edit by @panos-lunarg: Fixed markdown formatting
extern "C" void SetInjectedCommandCallbacks(PFN_BeginInjectedCommands begin_fp, PFN_EndInjectedCommands end_fp) | ||
{ | ||
BeginInjectCommands_fp = begin_fp; | ||
EndInjectCommands_fp = end_fp; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To allow a client to clear the callbacks, this should check if begin_fp / end_fp is nullptr, and if so assign BeginEndInjectedCommandsNoop.
Otherwise when for example unloading the sokatoa vulkan layer, it cannot cleanup after itself and keep this code in a working state.
(just a note, I don't think we run into this, but would be better if the API supports cleanup)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, I wonder if we should have some header/place where all exported api's are declared with some docu.
Right now the exported functions are defined in different cpp files, and if I don't know what to look out for I would not find any connection. (well maybe there is no connection :-) ).
6cee752
to
c9ffccf
Compare
CI gfxreconstruct build queued with queue ID 265998. |
@dfriederich All your comments have good points. I hoped I addressed all of them |
CI gfxreconstruct build # 4914 running. |
CI gfxreconstruct build # 4914 failed. |
CI gfxreconstruct build queued with queue ID 266385. |
CI gfxreconstruct build # 4915 running. |
CI gfxreconstruct build # 4915 passed. |
MainGetCurrentBlockIndex and MainGetLoadingTrimmedState whould de discoveralbe through dlopen + dlsym from the android replay native .so: - MainGetCurrentBlockIndex(): Returns the current block index as calculated from the file processor - MainGetLoadingTrimmedState(): Returns wheter file processor is between a FrameStateBegin/FrameStateEnd markers pair
c9ffccf
to
5bdc58a
Compare
CI gfxreconstruct build queued with queue ID 284987. |
CI gfxreconstruct build # 5158 running. |
CI gfxreconstruct build # 5158 passed. |
MainGetCurrentBlockIndex and MainGetLoadingTrimmedState whould de discoveralbe through dlopen + dlsym from the android replay native .so:
MainGetCurrentBlockIndex(): Returns the current block index as calculated from the file processor
MainGetLoadingTrimmedState(): Returns wheter file processor is between a FrameStateBegin/FrameStateEnd markers pair