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 assertions in PersistentTextureRequestsExample #737

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

skalarproduktraum
Copy link
Member

This PR fixes an issue with semi-deterministic assertions in PersistentTextureRequestsExample and replaces those with deterministic assertions run in a runAfterRender lambda.

@skalarproduktraum skalarproduktraum added the bugfix PR contains a bugfix label Apr 18, 2024
… issue after renderer shutdown with counting in runAfterRender lambda
@skalarproduktraum skalarproduktraum force-pushed the fix/persistent-texture-example-assertions branch from f2827ba to 1b80c07 Compare April 18, 2024 21:02
Copy link
Member

@aryaman-gupta aryaman-gupta left a comment

Choose a reason for hiding this comment

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

One minor comment, looks good to me otherwise!

val sum = file.readBytes().sum()
logger.info("Dumped: $file, ${file.length()} bytes, sum=$sum")
assertEquals(file.length(), 1280*720*4, "File should contain the correct number of bytes for a 1280x720xRGBA image")
assert(sum > 3000000) { "Sum of bytes in file should be non-zero" }
Copy link
Member

Choose a reason for hiding this comment

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

Why is the sum compared with 3000000? Is it not sufficient to check that it is not equal to zero? Changes in volume rendering code down the line could change the image generated and therefore the sum

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

Successfully merging this pull request may close these issues.

2 participants