Repository navigation
Conversation
In addition to checking that the data correctly roundtrips, we now check that the encoded data does not exceed the specified bound.
We now validate that the data roundtrips, decoding is memory safe wrt input/output, and decoding fails on truncated inputs. Note: memory safety wrt output is within the "align to 32-bit" requirement, as such we need to pad the output buffers a little bit for this example. Also remove +3 from demo/main.cpp/validateDecodeMeshlet; it's redundant there because triangle count is already divisible by 4.
We now check that decodeMeshletRaw has the same error behavior and outputs the same result as decodeMeshlet minus the expected alignment on the output buffer.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
We already have "real world" testing for meshlet codec in demo/main.cpp, but this adds extra unit tests to ensure various combinations are tested correctly, and that we exercise failure paths for encoding (insufficient output buffer) and decoding (truncated inputs). Also codecfuzz now checks that encodeMeshletBound is conservative.
Because the format is not finalized, no tests with fixed input/output data are provided.
This contribution is sponsored by Valve.