This is just an idea. I do not know how practical it is, but I think it is worth a shot.
I am quite a fan of integration tests.
We could implement a suite of image-based integration tests for the graphics module. We would render to an image and compare it with an expected image pixel by pixel. If a test fails, we could keep the wrong image and mark the differences somehow (maybe another transparent image pointing the pixels that differ). We could have simple tests and very complicated ones, with off-screen rendering, text, batched draws and texture arrays, etc.
This will give us a lot of confidence when making changes/optimizations to the different graphics backends, or when implementing a new one. Also, I think it would be really cool.
I would like to do this myself, but any help or insights will be greatly appreciated. Share your thoughts here first!
This is just an idea. I do not know how practical it is, but I think it is worth a shot.
I am quite a fan of integration tests.
We could implement a suite of image-based integration tests for the
graphics
module. We would render to an image and compare it with an expected image pixel by pixel. If a test fails, we could keep the wrong image and mark the differences somehow (maybe another transparent image pointing the pixels that differ). We could have simple tests and very complicated ones, with off-screen rendering, text, batched draws and texture arrays, etc.This will give us a lot of confidence when making changes/optimizations to the different graphics backends, or when implementing a new one. Also, I think it would be really cool.
I would like to do this myself, but any help or insights will be greatly appreciated. Share your thoughts here first!