Unigine::CPUShaderCallableStateless Class
Header: | #include <UnigineThread.h> |
CPUShaderCallableStateless is a template class that provides a simplified way to execute custom multithreaded logic using the CPUShader class.
Typically, to use a CPUShader, you need to inherit from the base CPUShader class and manually implement the process() method. However, CPUShaderCallableStateless allows you to pass in the processing logic and optional cleanup logic directly as function objects without writing a custom class or managing inheritance.
Unlike CPUShaderCallable, this variant does not require shared state or a destroy function.
Template Parameters:
- Process - function called per thread.
Signature: void(int thread_num, int num_threads)
CPUShaderCallableStateless Class
Members
static CPUShaderCallableStatelessPtr create ( Process func_process_ ) #
Creates a new shader task with execution logic.Arguments
- Process func_process_ - Function executed on each thread.
void process ( int thread_num, int num_threads ) #
Overridden from CPUShader. Called once per thread during execution. Invokes the provided processing function.Arguments
- int thread_num - Index of the current thread.
- int num_threads - Total number of threads assigned to this task.
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)