]> git.sesse.net Git - movit/commitdiff
Document EffectChain threading considerations.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 17 Jan 2014 18:01:21 +0000 (19:01 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 17 Jan 2014 18:01:21 +0000 (19:01 +0100)
effect_chain.h

index 407648bc9c5a6887e331d01bb4d372390509c219..db3b87006100b09820687efab1ba0bca6c699484 100644 (file)
@@ -6,6 +6,16 @@
 // them. Generally you set up your effect chain once and then call its render
 // functions once per frame; setting one up can be relatively expensive,
 // but rendering is fast.
 // them. Generally you set up your effect chain once and then call its render
 // functions once per frame; setting one up can be relatively expensive,
 // but rendering is fast.
+//
+// Threading considerations: EffectChain is “thread-compatible”; you can use
+// different EffectChains in multiple threads at the same time (assuming the
+// threads do not use the same OpenGL context, but this is a good idea anyway),
+// but you may not use one EffectChain from multiple threads simultaneously.
+// You _are_ allowed to use one EffectChain from multiple threads as long as
+// you only use it from one at a time (possibly by doing your own locking),
+// but if so, the threads' contexts need to be set up to share resources, since
+// the EffectChain holds textures and other OpenGL objects that are tied to the
+// context.
 
 #include <GL/glew.h>
 #include <stdio.h>
 
 #include <GL/glew.h>
 #include <stdio.h>