Skip to content

Switch filament and backend to Abseil logging #8691

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

bejado
Copy link
Member

@bejado bejado commented May 2, 2025

This switches everything under filament/ to Abseil logging. The following mapping between utils::slog and Abseil severity is used:

slog.d  ->  DLOG(INFO)
slog.i  ->  LOG(INFO)
slog.v  ->  LOG(INFO)
slog.w  ->  LOG(WARNING)
slog.e  ->  LOG(ERROR)

@pixelflinger
Copy link
Collaborator

Will you be able to check how this affect the binary size on a release build?

@bejado
Copy link
Member Author

bejado commented May 6, 2025

Will you be able to check how this affect the binary size on a release build?

Yes, I'm planning on check that. Unfortunately I think Abseil log uses std iostream, so we may see a binary size increase.

@@ -772,26 +774,25 @@ UTILS_NOINLINE
} else {
line = shader.substr(start, end - start);
}
out << lc++ << ": " << line.c_str() << '\n';
LOG(ERROR) << lc++ << ": " << line.c_str();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this should be a utils/std::stream, and then output to LOG(ERROR) at the end.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I thought about that. The difference is that with LOG(ERROR), Abseil prepends metadata for each line. I guess we have to decide which style we prefer.

@bejado bejado force-pushed the bjd/abseil-logging branch from 0585a5d to 3359ef4 Compare May 13, 2025 22:00
@bejado
Copy link
Member Author

bejado commented May 13, 2025

Unfortunately with Abseil, I'm seeing a 1.23 MiB binary size increase on Android. I'll need to investigate this some more to see what's going on. I was previously comparing main to an older branch which was skewing the results.

I'm seeing a 208.84 KiB binary size increase on Android.

jni/arm64-v8a/libfilament-jni.so:

Configuration Size (bytes)
Before Abseil 3459984
With Abseil 3673832

@bejado bejado force-pushed the bjd/abseil-logging branch from 3359ef4 to bd1cfba Compare May 14, 2025 22:52
@bejado bejado marked this pull request as ready for review May 14, 2025 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants