mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-11 13:48:30 +09:00
[Feat, Perf, Test] (MG_Util, MG_Backend, MG_Test): test-lane SPIR-V validation latch; entry-local Private rewrite, in-chain rect lowering and uniform-Location strip
This commit is contained in:
@@ -54,9 +54,7 @@ namespace MobileGL::MG_Util::Async {
|
||||
// calling eglTerminate, which is the norm for a test binary and legal
|
||||
// for an application. Registered here, during main, so it runs before
|
||||
// the destructors of statics constructed at load time.
|
||||
if (ShaderCompilePool* pool = g_processPool.load(std::memory_order_acquire)) {
|
||||
pool->StopAndDrain();
|
||||
}
|
||||
ShaderCompilePool::StopAndDrainProcessPoolAtExit();
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -345,4 +343,10 @@ namespace MobileGL::MG_Util::Async {
|
||||
// eglInitialize to get its worker threads back, the re-arm belongs in
|
||||
// MobileGL::Initialize(), next to glslang::InitializeProcess().
|
||||
}
|
||||
|
||||
void ShaderCompilePool::StopAndDrainProcessPoolAtExit() {
|
||||
if (ShaderCompilePool* pool = g_processPool.load(std::memory_order_acquire)) {
|
||||
pool->StopAndDrain();
|
||||
}
|
||||
}
|
||||
} // namespace MobileGL::MG_Util::Async
|
||||
|
||||
@@ -109,6 +109,13 @@ namespace MobileGL::MG_Util::Async {
|
||||
// but they share glslang's process globals, which teardown is about to free.
|
||||
void StopAndDrain();
|
||||
|
||||
// StopAndDrain() on the process-wide pool if one was ever created; never creates
|
||||
// one. For extra atexit sentinels owned by other subsystems (the SPIR-V validation
|
||||
// switch registers one after forcing spirv-tools' lazy function-local tables into
|
||||
// existence, so the drain is sequenced before those tables' destructors - a worker
|
||||
// mid-Validate would otherwise touch freed memory during process exit).
|
||||
static void StopAndDrainProcessPoolAtExit();
|
||||
|
||||
Uint GetThreadCount() const;
|
||||
Uint GetMaxConcurrency() const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user