ES2 support: filament and filamat changes

This CL contains two parts:
- changes to matc/filamat
- changes to filament itself

Filamat can now generate ES2 compatible shaders. Only the unlit variant
is supported. Fog and picking are supported as well.
post-processing, skinning, instancing, all lighting and shadowing are not supported.

Filament is updated to not issue commands that are not supported in ES2.

Addtionnally, the hello-triangle sample is updated to work on an ES2 device.
This commit is contained in:
Mathias Agopian
2023-05-02 21:23:47 -07:00
committed by Mathias Agopian
parent 7cddd832aa
commit b4d842c342
36 changed files with 845 additions and 188 deletions
+6
View File
@@ -524,6 +524,12 @@ void GLSLPostProcessor::fullOptimization(const TShader& tShader,
glslOptions.fragment.default_int_precision = glslOptions.es ?
CompilerGLSL::Options::Precision::Mediump : CompilerGLSL::Options::Precision::Highp;
// TODO: this should be done only on the "feature level 0" variant
if (config.featureLevel == 0) {
// convert UBOs to plain uniforms if we're at feature level 0
glslOptions.emit_uniform_buffer_as_plain_uniforms = true;
}
CompilerGLSL glslCompiler(std::move(spirv));
glslCompiler.set_common_options(glslOptions);