Mir

Code review comment for lp:~vanvugt/mir/fix-1350674

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Alan: All fixed.

Robert: GLProgramFamily has several benefits, although I only realised late in the game I could have introduced it separately...

Benefits of introducing GLProgramFamily:
  * It's more efficient: Multiple programs can and do share some shaders (e.g. the vertex shader in GLRenderer).
  * It results in significantly less coupling (no factory required as you can see).
  * It's safer. GLProgram's attempt to use RAII on GL programs would become unsafe when you hit copy constructors (e.g. put them in containers). The new copy then only works up to the point the original copy gets destroyed, and then the new copy stops working. So in order to RAII GLProgram safely, reference counting (and hence more inefficient indirection using the heap and shared pointers) would be required too.

Benefits of not introducing GLProgramFamily:
  * The diff would be smaller for this bug fix.

« Back to merge proposal