the ShaderCompilerService handles async shader compilation (#6848)

It supports KHR_parallel_shader_compile as well as a
thread pool of GL contexts.

- we have a new 2-priorities queue for shader compilation
- use this feature in gltfio in the ubershader case
This commit is contained in:
Mathias Agopian
2023-06-14 10:51:02 -07:00
committed by GitHub
parent 09aeeccfa7
commit 74f5d8a066
41 changed files with 1487 additions and 567 deletions

View File

@@ -119,6 +119,16 @@ Material* ArchiveCache::getMaterial(const ArchiveRequirements& reqs) {
.package(spec.package, spec.packageByteCount)
.build(mEngine);
}
// compile everything at low priority
mMaterials[i]->compile(Material::CompilerPriorityQueue::LOW);
// promote variants we care about to high priority
mMaterials[i]->compile(Material::CompilerPriorityQueue::HIGH,
UserVariantFilterBit::DIRECTIONAL_LIGHTING |
UserVariantFilterBit::DYNAMIC_LIGHTING |
UserVariantFilterBit::SHADOW_RECEIVER);
return mMaterials[i];
}
}