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.
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
Properly convert Java char to C char in inputSwizzle #876
Properly convert Java char to C char in inputSwizzle #876
Changes from 4 commits
5eea92e
0bedf8d
4638ca0
0ff0788
7da5422
89b29cb
13a571c
647a5fc
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you are creating the texture in the test, I'd prefer not to need a reference file. You can transcode the swizzled
t
toKTX_TTF_RGBA32
and compare those pixels with the pixels inrgba
. Given the full on colors you are using I don't think compression & transcode will change them.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd also like to avoid that reference file. (One reason: The
tests/testimages
directory already contains >100 files, without any information about what these files are, where they come from, and what they are used for. I'd like to avoid throwing more images on that pile...)And what you suggested might ... nearly work: From a quick test, converting the resulting data to
KTX_TTF_RGBA32
gave the following input/output pxiel values:The swizzling is applied correctly, but there is a slight deviation in the formerly "pure" colors, of
+/- 2
in some components. I don't know where this might come from - maybe something about SRGB, or it's a compression artifact, or whatnot. If you have an idea what might be causing this (or how to avoid this), I could change it accordingly.Regarldless of that, the test could be changed to not use a reference image, by comparing the result of converting the image to
KTX_TTF_RGBA32
to pixel values that are created programmatically (using the same functions that are used for creating the input image).This could then be
2, 255, 2
)expected=(0, 255, 0)
but with some "epsilon" of maybe+/-5
to account for the slight changes...Any preference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer the fixed comparison as the test will not then be sensitive to changes in the encoder. You could also try
ktxTexture2_CompressAstcEx
. Perhaps that will have less artifacts.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, in order to have proper test coverage, I can not only 'try' this (as an alternative), but actually have to test this in addition to the current test. Both of them (basis and astc) are going through different code paths (even though they are doing the same sort of conversion for the swizzling).