16

I'm new to OpenGL and GLSL. I'd like to TDD shaders, but haven't found anything on the topic except glsl-unit, which appears to be WebGL specific.

Is there a "standard" way of unit testing shaders? What are best practices in this area? Are there unit-testing frameworks for GLSL?

If it helps, I'm targeting OpenGL ES 2.0 for iOS devices.

Nicol Bolas
  • 449,505
  • 63
  • 781
  • 982
Tobias
  • 6,388
  • 4
  • 39
  • 64
  • Shaders are generally pretty small, maybe 100-200 lines for long ones. They're not really something you *need* to write tests and such for. TDD is mainly for large, complex systems. Shaders currently don't rise to the level where such things are necessary. – Nicol Bolas Feb 04 '12 at 21:41
  • 17
    @NicolBolas I have to disagree, particularly when your customer will be running your shaders on multiple vendors' cards. I've worked in an environment where making a change to a shader and testing it locally didn't find problems with other cards. Had we had unit tests for them, our buildbots would have run them on machines with a wider variety of cards and caught the issues. This is particularly true when dealing with potential NaNs on Nvidia, which generally don't show up on ATI. So I think it's a valid question. – user1118321 Feb 04 '12 at 21:53

0 Answers0