1

I try to unit test my render engine by comparing two QImage generated with grabFrameBuffer().

It works perfectly on my laptop (Mac OS 10.9.2 non retina) and perfectly on my co-worker laptop (which is retina). But when I try to run the tests Travis-CI it generate the image but with a diff ±5% from the one I generated.

I'm using Qt 5.2.1, don't hesitate to ask for any more info

Thomas Ayoub
  • 29,063
  • 15
  • 95
  • 142
  • is that diff even worth worrying about? all you need for good graphics is good enough – ratchet freak Apr 17 '14 at 14:58
  • @ratchetfreak the issue is I can't automatically find if this little difference is the current one (kind of artifact) or coming from a bug – Thomas Ayoub Apr 17 '14 at 15:01
  • possible duplicate of [OpenGL deterministic rendering between GPU vendor](http://stackoverflow.com/questions/7922526/opengl-deterministic-rendering-between-gpu-vendor) – genpfault Apr 30 '14 at 22:42

1 Answers1

3

The invariance requirements of the OpenGL spec (Appendix A, "Invariance", page 600) only apply within a single implementation, not across implementations:

The OpenGL specification is not pixel exact. It therefore does not guarantee an exact match between images produced by different GL implementations. However, the specification does specify exact matches, in some cases, for images produced by the same implementation.

genpfault
  • 51,148
  • 11
  • 85
  • 139
  • Any source...? Just to be sure :) – Thomas Ayoub Apr 17 '14 at 15:05
  • @ꜱᴀᴍᴏᴛʜ: Edited with spec reference + quote. – genpfault Apr 17 '14 at 15:08
  • Well, I did my maths again and I find ±5% of diff in pixels... Is it still *normal*? – Thomas Ayoub Apr 17 '14 at 16:06
  • [This guy](http://arek.bdmonkeys.net/bugs/invariance/index.html) compares the output of a half-dozen GL implementations, some of which have strikingly different output. So depending on what you're doing 5% might not be unexpected. – genpfault Apr 17 '14 at 16:23
  • I think you could devise a pathological case with a 100% difference between conforming implementations. For example, if the images produced consisted of alternating rows of black and white pixels. – GuyRT Apr 17 '14 at 22:40