Skip to content

backend: enhance data reshaper#9711

Open
poweifeng wants to merge 1 commit intomainfrom
pf/datashaper
Open

backend: enhance data reshaper#9711
poweifeng wants to merge 1 commit intomainfrom
pf/datashaper

Conversation

@poweifeng
Copy link
Contributor

  • add half float as source type
  • gray-scaled output when src-channel=1 and dest-channel=3 or 4

@poweifeng poweifeng added the internal Issue/PR does not affect clients label Feb 12, 2026
@poweifeng poweifeng requested review from bejado and z3moon February 12, 2026 20:40
}
for (size_t channel = srcChannelCount; channel < dstChannelCount; ++channel) {
out[channel] = dstMaxValue;
if (srcChannelCount == 1 && (dstChannelCount == 3 || dstChannelCount == 4)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

BTW have we checked if the compiler outlines the branches? If not it might be worth providing multiple loops for the various configurations to avoid so many branches so deep inside the nested loops.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that's a good point. I made all the branches constexpr instead, but had to add a templating layer.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

but I guess the downside is increase in binary size... but anyways, let me know what you think.

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks great, thanks for doing that! I was mostly concerned about performance for large textures.

 - add half float as source type
 - gray-scaled output when src-channel=1 and dest-channel=3 or 4
 - Ensure that per-pixel work is as-constexpr-as-possible
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal Issue/PR does not affect clients

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants