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

Fix bug in copy image mipmap comparisons #2032

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

joshqti
Copy link
Contributor

@joshqti joshqti commented Aug 1, 2024

The destination image for mipmap copies is incorrect, use the width of the mip-level instead of mip-level 0. The check if (where < dstImageInfo->width) is not correct, width is the size of level 0, but it should be the width of the destination mip level.

Deletes redundant scanline comparison, which is confusing and uneccesary. compare_scanline and memcmp do the same thing, except compare_scanline correctly take image format into account, whereas memcmp finds all differences.

The destination image for mipmap copies
is incorrect, use the width of the mip-level
instead of mip-level 0.

Deletes redundant scanline comparison.
Copy link
Contributor

@bashbaug bashbaug left a comment

Choose a reason for hiding this comment

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

This seems reasonable to me, but these tests are hard to follow.

Is there any test execution time difference after this change? I'd want to check that calling compare_scanlines unconditionally vs. only after calling memcmp doesn't slow down testing, since memcmp will be sufficient for most image formats, and it'll be a lot faster to compare the entire scanline in one call using memcpy vs. pixel-by-pixel as part of compare_scanlines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants