-
Notifications
You must be signed in to change notification settings - Fork 237
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
Add vkformat checks to ktxTexture2_DecodeAstc #967
base: main
Are you sure you want to change the base?
Conversation
wasimabbas-arm
commented
Dec 23, 2024
•
edited
Loading
edited
- Adds checks for vkformat fixes ktxTexture2_DecodeAstc does not check its vkformat parameter #960
- Propogates vkformat correctly into creating astc profile
@MarkCallow I am struggling to understand the CI failures. In particular the TravisCI ones. Although one thing is consistent and good that the tests that are failing are all compare tests. But all of the following are confusing me.
or just the whole thing
it fails on my machine. How is that possible when it it runs part of the pack it succeeds but not on its own. I do see
Is that the explanation? that in the full run its not adding
I thought ASTC encoder has invariance accross platforms and compilers? Why are these happening any idea? |
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.
Thanks @wasimabbas-arm.
Do the tests for the vkformat
parameter test all possible cases? If I'm reading correctly you are testing for 3 cases:
- Not an LDR format, if decoding ASTC HDR
- An sRGB format, if decoding sRGB ASTC LDR.
- Not an ASTC format.
What about, e.g. requesting a 16- or 32-bit or a FLOAT format for ASTC LDR? Or a depth-stencil format? There are many formats so it is probably better to confirm a match with the input ASTC format and the capabilities of the astcenc decoder than check for all the negative possibilities.
Please do the format checks consistently, checking This->vkFormat (via the DFD) first and then checking if vkformat
is a suitable match. I got confused by the inconsistency during my review.
We definitely need unit tests for both the encode and decode functions.
@MarkCallow thanks for the review. Upon further analysis I have realised we don't really need the format argument. If we really need to decompress into 16- or 32-bit HDR formats that we can add later. For now I have removed the argument and its corresponding checks and docs. I am now calculating the decoding format from the ASTC format. We only support 3 options. RGBA8, sRGBA8 and RGBA32.
The compressions and decompressions are thoroughly tested part of the overal |
Thanks for the quick fixes. Will review tomorrow.
Yes, so I thought. Therefore the unittests should test proper handling of bad function parameters and verify that correct parameters result in the expected calls to astcenc. The latter is also covered to a large extent by the |
The encode.compare test is failing on macOS and Linux. It appears that no output is being created, If you scroll up in the log you can find the output from clitest.py which shows the command to run the failing subcase. Run that command locally and you should be able to easily find out why no output is being produced. I have merged the outstanding CTS update. You should update the test reference. This is unrelated to the above test failure, I think. |
I can't reproduce these. All tests pass on my Mac x86_64. When you run those locally remember to change the path to
Thank you. incoming. |
Neither can I. I note that the exit code shown for the failed tests is "-6". In python on Posix, this means the child process was killed by a signal 6 (SIGABRT). I don't know why. It may have something to do with macOS not finding a signed library or some other strange security issue though what could have changed on Travis I don't know. We haven't changed the macOS version requested on the runner. I will be away the next 3 days and can do no more now. Please investigate if you can. We need to see the stdout and stderr output when the test is run. I don't recall how to make |
Whatever the build problem is, it is to do with this PR. |
It does reproduce locally but only in the Debug config because the problem is:
This is because the sense of the test in
is testing for HDR. Change the The test I am looking at, subcase 149, is providing an SRGB format input file and outputting to a file with |
Woops, rookie mistake. Should have testesd both release and debug. Fixed in 0ead350
Not sure what you mean by subcase 149. IIRC the test that was failing was running
If I just run that without any subcases. like
Do you mean the 149th line? [edit] found it in the ci logs.
|
No I mean the subcase as reported by clitest.py when a test fails.
It is related to the array of subcases listed in compare.json. |
Is it intentional to generate UNORM ASTC images from SRGB input and compare input and output? IIRC |
I think the sRGB topic needs a bit of walk through the whole system.
Do you mean specifically for comparison purposes? At least thats not the case in
This doesn't sound right. This means you can't create "UNORM" ktx files?
For For metrics inside encode if the input format is sRGB then the decoded format will be
Then it should be fine.
As I said there is no conversion happening.
In that specific test I am only interested in any astc format. The way that test is written there will always be a mismatch between the 'args:encode:flag' and 'args:subcase' formats and resultant file names. This has however surfaced a problem, consider:
The issue is, AFAIK, there is no conversion from the input sRGB to output UNORM happening anywhere. Unless you think its happening before in the tool itself before it hits the decompressor? |
I mean specifically for testing metrics during ASTC encoding as is being done here.
We'll have to investigate what the metrics computations are doing. I'll ask RasterGrid if they can provide some insight.
You can create UNORM files. What I mean is the input sRGB data is silently decoded to linear before the texture is created.
Yes it is done implicitly in
But there is, as I've explained above.
Is it possible to re-write it in such a way that the
As I've already noted, conversion is happening. |
I mean the astc encoder/compressor/decompressor doesn't do any conversions. It only does compression/decompression. |
Was there anything else pending on this PR? |