docs/android/dokka/filament-android/com.google.android.filament/-engine/compile.md
//filament-android/com.google.android.filament/Engine/compile
[main]
open fun compile(priority: Material.CompilerPriorityQueue, material: Material, view: View, shadowReceiver: Engine.FeatureState, skinning: Engine.FeatureState, handler: Any, callback: Runnable)
Asynchronously ensures that the variants of the specified Material required to render it in the provided View are compiled. This determines the necessary permutations of feature flags based on the supplied View, and compiles the corresponding shader variants. See compile for important details about the compilation process, callback scheduling, priorities, and flushing the engine.
main
| priority | Which priority queue to use, LOW or HIGH. |
| material | The Material whose variants will be compiled. |
| view | The View in which the material will be rendered. |
| shadowReceiver | Indicates whether to compile variants where the material receives shadows. Use FeatureState.INDETERMINATE to compile both permutations. |
| skinning | Indicates whether to compile variants with skinning. Use FeatureState.INDETERMINATE to compile both permutations. |
| handler | An Executor. On Android this can also be a Handler. |
| callback | callback called on the main thread when the compilation is done by backend. |