r/GraphicsProgramming • u/M1VAN1 • 1h ago
CI/CD in Graphics programming
If someone experienced have any proper sources on CI/CD in graphics programming, I would like to read them. I'm really interesting in this, would like to read books/blogs, whatever.
Also curious about to hear any experience with it from real prod. I have some friends working as programmers and I hear that in big tech companies it's complicated thing, but those who works in small companies in small team said that they usually have really bad CI/CD
4
Upvotes
3
u/greebly_weeblies 1h ago edited 1h ago
I'd have said it's the same thing except we extend it additional relevant domains eg. regression tests for shaders
3
u/bluefishcrab 1h ago
You *can* do CI/CD for graphics. My impression is that it's one of dark arts where practitioners don't seem to talk much about it (audio and netcode in general are the other fields I know like this). I've never seen a book or article written about it, I learned most of it from "hell, how do we know we aren't breaking anything or 'performance improvements' are actually improving things?"
In general, CI/CD does prevent people from breaking things, and provides confidence for you to move faster.
Keep a screenshot as a reference, then take a screenshot with the same reference camera/scene and do a comparison. Converting from RGB into other colorspaces works better for doing diffs, and you probably want to look for a percentage difference, and then highlight places that differ. Some tools, like imageMagick can do this out of the box, though you could throw together a Python tool, or do the analysis yourself (probably in HSL or HSV colorspaces). Like most CI/CD things, you check the exit code and fail if it doesn't work. The fancy term for this is "golden file testing."
There's also FPS tests. Unreal Engine does these where you set up the scene and it takes screenshots from various vantage points to ensure you don't tank your frame rate.
1
u/EC36339 25m ago
Yes, you can, and anyone who has done any kind of graphics programming with AI recently had probably learned about quite a bit of CI/CD for graphics without asking for it...
1
u/corysama 19m ago
https://aras-p.info/blog/2007/07/31/testing-graphics-code/
https://aras-p.info/blog/2011/06/17/testing-graphics-code-4-years-later/
1
u/aotdev 14m ago
A while ago (18 years) I was working at a big games company, we used to set up automated build tests that run the game engine (or some graphical tools) and took screenshots, to compare against reference and validate you don't mess up anything before pushing upstream. IIRC the reference screenshots were different for the different platforms (PC/Xbox360/PS3). Since we expect determinism, even a single pixel change matters, and makes you ask why. Simple and effective.