Unigine::PoolCPUShaders Class
Header: | #include <UnigineThread.h> |
PoolCPUShaders is a utility class that manages a thread pool dedicated to executing CPUShader tasks.
The pool allows shaders to run either synchronously (blocking until completion) or asynchronously (in the background). Internally, it handles thread reuse, signaling, task queuing, and process distribution across worker threads.
PoolCPUShaders Class
Members
int isInitialized ( ) #
Returns whether the pool has been initialized.Return value
Returns 1 if pool is initialized; 0 otherwise.bool isRunning ( ) #
Returns whether any shader is currently active.Return value
Returns true if at least one shader is running; false otherwise.int getNumActiveShaders ( ) #
Returns the number of currently active shaders.Return value
Number of currently running shader tasks.int getNumActiveProcesses ( ) #
Returns the number of active shader processes.Return value
Number of currently queued or running processes.int getCurrentThreadIndex ( ) #
Returns the index of the current thread within the shader pool.Return value
Index of the current thread in the pool, if called from a worker thread.int getNumThreads ( ) #
Returns the number of worker threads available in the pool.Return value
Total number of threads in the shader pool.void wait ( ) #
Blocks until all currently active shader tasks have completed.void signal ( ) #
Signals the worker threads to resume execution (used internally).The information on this page is valid for UNIGINE 2.20 SDK.
Last update:
2025-07-10
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)