fix: Use R16_UNORM as internal render format if output is PF_L16#1294
Open
jmachowinski wants to merge 2 commits into
Open
fix: Use R16_UNORM as internal render format if output is PF_L16#1294jmachowinski wants to merge 2 commits into
jmachowinski wants to merge 2 commits into
Conversation
iche033
approved these changes
May 13, 2026
azeey
reviewed
Jun 23, 2026
azeey
left a comment
Contributor
There was a problem hiding this comment.
Thanks! Would you mind updating the PR description by filling out the template provided?
Also, from the Zulip conversation, this significantly improves performance. Would you be able to provide some benchmark results here?
Author
caguero
reviewed
Jun 30, 2026
caguero
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the patch!
I wonder if we should create a helper function to handle all formats in one place. Something like:
Ogre::PixelFormatGpu InternalRenderFormat(PixelFormat _format)
{
switch (_format)
{
case PF_L8:
case PF_L16:
return Ogre2Conversions::Convert(_format);
default:
return Ogre::PFG_RGBA8_UNORM_SRGB;
}
}
That way we not only handle the PF_L16 case and we use a single source of truth.
added 2 commits
July 1, 2026 13:10
This fixes a major performance regression, if a camera uses int16 as output format. The improvement comes from skipping an expensive texture conversion inside from SRGB to INT16 by rendering native to the wanted output format. Signed-off-by: Janosch Machowinski <J.Machowinski@cellumation.com>
Signed-off-by: Janosch Machowinski <J.Machowinski@cellumation.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


🦟 Bug fix
Summary
This fixes a major performance regression, if a camera uses int16 as output format. The improvement comes from skipping an expensive texture conversion inside from SRGB to INT16 by rendering native to the wanted output format.
Backport Policy
Checklist
codecheckpassed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-byandGenerated-bymessages.Backports: If this is a backport, please use Rebase and Merge instead.