Skip to content

Testing a wgpu application #4182

Answered by cwfitzgerald
zmitchell asked this question in Q&A
Discussion options

You must be logged in to vote

If I want to test a command that says "draw a circle", would the test render the circle in a solid color, read the texture back into CPU memory, then check a pixel inside the circle to see if it's the right color? Is that the general strategy?

That's quite a common solution. We do this within wgpu itself and I do it in my library rend3. The devil is in the details though. wgpu and rend3 use bindings to an nvidia library called FLIP which does human-style image comparisons. I personally am quite a fan of it for how well it deals with noisy inputs or inputs with very low variance.

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by zmitchell
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants