I thought I wrote an `absdiff()` function for this exact scenario...
Oh yeah, it's in the d3d9 tests. It's not terribly clever. All it does is make sure the greater of the two operands is the minuend:
static inline unsigned int absdiff(unsigned int x, unsigned int y) { return x > y ? x - y : y - x; }
~~See~~ `wine/dlls/d3d9/tests/visual.c:66`. EDIT: Wait, that one didn't go in yet. I could've sworn I had one like that in...
Well, we have compare_uint() in the various Wine D3D tests. So does vkd3d, and we could probably use "return compare_uint(x, y, ulps);" here.