Fix crash when using Filamat lite library (#1780)
This commit is contained in:
@@ -73,6 +73,13 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
// The filamat library has two variants: full and lite. Here we default to the "full" variant.
|
||||
// Replace "full" with "lite" to use the filamat-lite variant, which has a smaller binary size
|
||||
// but comes with certain restrictions. See "Filamat Lite" in libs/filamat/README.md.
|
||||
defaultConfig {
|
||||
missingDimensionStrategy 'functionality', 'full'
|
||||
}
|
||||
|
||||
// We use the .filamat extension for materials compiled with matc
|
||||
// Telling aapt to not compress them allows to load them efficiently
|
||||
aaptOptions {
|
||||
|
||||
Binary file not shown.
@@ -212,6 +212,10 @@ class MainActivity : Activity() {
|
||||
" material.clearCoat = 1.0;\n" +
|
||||
"}\n")
|
||||
|
||||
// Turn off shader code optimization so this sample is compatible with the "lite"
|
||||
// variant of the filamat library.
|
||||
.optimization(MaterialBuilder.Optimization.NONE)
|
||||
|
||||
.build()
|
||||
|
||||
if (matPackage.isValid) {
|
||||
|
||||
@@ -79,6 +79,10 @@ bool GLSLToolsLite::findProperties(
|
||||
filament::backend::ShaderType type,
|
||||
const utils::CString& material,
|
||||
MaterialBuilder::PropertyList& properties) const noexcept {
|
||||
if (material.empty()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const std::string shaderCode = stripComments(material.c_str());
|
||||
|
||||
size_t start = 0, end = 0;
|
||||
|
||||
Reference in New Issue
Block a user