Skip to content
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

Expand formats support with R8 and RG8 #20

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

EmilioLaiso
Copy link

@EmilioLaiso EmilioLaiso commented Nov 11, 2022

Adds support for 1 and 2-channel textures.
First PR in this repo, I still have to build all the binaries on CI but I figured it would be better to do that once the PR is reviewed :)

Markes as draft because I don't want this to be merged until I'm done testing it in the project that is using those changes

examples/test.rs Outdated Show resolved Hide resolved
} else if (num_channels == 2) {
texel.x = byte_to_float(src_image.data[addr + 0]) * inv_255;
texel.y = byte_to_float(src_image.data[addr + 1]) * inv_255;
} else if (num_channels == 3) {
Copy link
Member

Choose a reason for hiding this comment

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

That's going to be a fun conflict with #15

Copy link
Author

@EmilioLaiso EmilioLaiso Nov 11, 2022

Choose a reason for hiding this comment

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

Shouldn't be too hard. Add clean_and_write_2_channels and clean_and_write_1_channel..at least from a quick glance it looks like that's the way to go?
Anyway I'm just noticing that also intel_tex_2 pretty much relies on RgbaSurfaces, so maybe this change may end up not needed after all 😅

Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't be too hard. Add clean_and_write_2_channels and clean_and_write_1_channel..at least from a quick glance it looks like that's the way to go?

It's a bit much to have those functions for every component count, I wish we could do something simpler and have the compiler "optimize it away" but there were some specific details...

Anyway I'm just noticing that also intel_tex_2 pretty much relies on RgbaSurfaces, so maybe this change may end up not needed after all 😅

As in shouldn't we update intel_tex_2 then?

examples/test.rs Outdated Show resolved Hide resolved
@EmilioLaiso
Copy link
Author

After testing this on my project, it seems to segfault so the PR is not ready yet

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.

None yet

2 participants