Bitfield enum defining processing characteristics and backend requirements for buffer operations.
ProcessingToken provides a flexible bitfield system for specifying how buffers and their processors should be handled within the MayaFlux engine. These tokens enable fine-grained control over processing rate, execution location, and concurrency patterns, allowing the system to optimize resource allocation and execution strategies based on specific requirements.
The token system is designed as a bitfield to allow combination of orthogonal characteristics:
This architecture enables the buffer system to make intelligent decisions about processor compatibility, resource allocation, and execution optimization while maintaining flexibility for custom processing scenarios.
| Enumerator |
|---|
| SAMPLE_RATE | Processes data at audio sample rate with buffer-sized chunks.
Evaluates one audio buffer size (typically 512 samples) at a time, executing at sample_rate/buffer_size frequency. This is the standard token for audio processing operations that work with discrete audio blocks in real-time processing scenarios.
|
| FRAME_RATE | Processes data at video frame rate.
Evaluates one video frame at a time, typically at 30-120 Hz depending on the video processing requirements. This token is optimized for video buffer operations and graphics processing workflows that operate on complete frame data.
|
| CPU_PROCESS | Executes processing operations on CPU threads.
Specifies that the processing should occur on CPU cores using traditional threading models. This is optimal for operations that benefit from CPU's sequential processing capabilities or require complex branching logic.
|
| GPU_PPOCESS | Executes processing operations on GPU hardware.
Specifies that the processing should leverage GPU compute capabilities, typically through compute shaders, CUDA, or OpenCL. This is optimal for massively parallel operations that can benefit from GPU's parallel architecture.
|
| SEQUENTIAL | Processes operations sequentially, one after another.
Ensures that processing operations are executed in a deterministic order without parallelization. This is essential for operations where execution order affects the final result or when shared resources require serialized access.
|
| PARALLEL | Processes operations in parallel when possible.
Enables concurrent execution of processing operations when they can be safely parallelized. This maximizes throughput for operations that can benefit from parallel execution without introducing race conditions.
|
| AUDIO_BACKEND | Standard audio processing backend configuration.
Combines SAMPLE_RATE | CPU_PROCESS | SEQUENTIAL for traditional audio processing. This processes audio on the chosen backend (default RtAudio) using CPU threads in sequential order within the audio callback loop. This is the most common configuration for real-time audio processing applications.
|
| GRAPHICS_BACKEND | Standard graphics processing backend configuration.
Combines FRAME_RATE | GPU_PROCESS | PARALLEL for graphics processing. This processes video/graphics data on the chosen backend (default GLFW) using GPU hardware with parallel execution within the graphics callback loop. Optimal for real-time graphics processing and video effects.
|
| AUDIO_PARALLEL | High-performance audio processing with GPU acceleration.
Combines SAMPLE_RATE | GPU_PROCESS | PARALLEL for GPU-accelerated audio processing. This offloads audio processing to GPU hardware, typically using compute shaders for parallel execution. Useful for computationally intensive audio operations like convolution, FFT processing, or complex effects that benefit from GPU parallelization.
|
| WINDOW_EVENTS | Window event stream processing.
Processes window lifecycle events (resize, close, focus) and input events (keyboard, mouse) at frame rate using CPU in sequential order. This is distinct from graphics rendering - it handles the window container itself, not its visual content.
|
78 : uint32_t {
79
80
81
82
83
84
85
87
88
89
90
91
92
93
94
96
97
98
99
100
101
102
103
105
106
107
108
109
110
111
112
114
115
116
117
118
119
120
121
123
124
125
126
127
128
129
130
132
133
134
135
136
137
138
139
140
142
143
144
145
146
147
148
149
150
152
153
154
155
156
157
158
159
160
162
163
164
165
166
167
168
169
170
172};
@ SAMPLE_RATE
Processes data at audio sample rate with buffer-sized chunks.
@ CPU_PROCESS
Executes processing operations on CPU threads.
@ AUDIO_BACKEND
Standard audio processing backend configuration.
@ PARALLEL
Processes operations in parallel when possible.
@ SEQUENTIAL
Processes operations sequentially, one after another.
@ GRAPHICS_BACKEND
Standard graphics processing backend configuration.
@ FRAME_RATE
Processes data at video frame rate.
@ WINDOW_EVENTS
Window event stream processing.
@ GPU_PPOCESS
Executes processing operations on GPU hardware.
@ AUDIO_PARALLEL
High-performance parallel audio processing domain.