Android update and small improvements
-fixed code do cross compiling to android -fixed build with GCC (workaround) -added little benchmark -several small fixes -updated meson build (demos building, working with GCC, LDC and DMD) -added some meson options -added ImGUI bind for OpenGL3
This commit is contained in:
parent
86edfa4a57
commit
66860b9042
30 changed files with 1358 additions and 173 deletions
|
|
@ -37,12 +37,17 @@ struct ECSJobUpdater
|
|||
//pool.unregistExternalThread(thread_data);
|
||||
if(jobs)Mallocator.dispose(jobs);
|
||||
version(WebAssembly)pthread_key_delete(tls_key);
|
||||
else version(Android)pthread_key_delete(tls_key);
|
||||
}
|
||||
|
||||
version(WebAssembly)
|
||||
{
|
||||
__gshared pthread_key_t tls_key;
|
||||
}
|
||||
else version(Android)
|
||||
{
|
||||
__gshared pthread_key_t tls_key;
|
||||
}
|
||||
else static uint thread_id = 0;
|
||||
|
||||
ThreadPool pool;
|
||||
|
|
@ -105,6 +110,7 @@ struct ECSJobUpdater
|
|||
void onCreate(uint threads_count)
|
||||
{
|
||||
version(WebAssembly)pthread_key_create(&tls_key, null);
|
||||
else version(Android)pthread_key_create(&tls_key, null);
|
||||
|
||||
pool.initialize();
|
||||
thread_data = pool.registerExternalThread();
|
||||
|
|
@ -116,6 +122,7 @@ struct ECSJobUpdater
|
|||
uint getThreadID() @nogc nothrow
|
||||
{
|
||||
version(WebAssembly)return cast(int)pthread_getspecific(tls_key);
|
||||
else version(Android)return cast(int)pthread_getspecific(tls_key);
|
||||
else return thread_id;
|
||||
}
|
||||
|
||||
|
|
@ -200,6 +207,11 @@ struct ECSJobUpdater
|
|||
}
|
||||
else job.execute();
|
||||
}
|
||||
else version(Android)
|
||||
{
|
||||
pthread_setspecific(tls_key, cast(void*)th_data.threadId);
|
||||
job.execute();
|
||||
}
|
||||
else
|
||||
{
|
||||
updater.thread_id = th_data.threadId;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue