From: Steinar H. Gunderson Date: Fri, 17 Jan 2014 18:01:21 +0000 (+0100) Subject: Document EffectChain threading considerations. X-Git-Tag: 1.0~85 X-Git-Url: https://git.sesse.net/?p=movit;a=commitdiff_plain;h=cf1beb1c14061e754483f99a245ecfdde5cb7b79 Document EffectChain threading considerations. --- diff --git a/effect_chain.h b/effect_chain.h index 407648b..db3b870 100644 --- a/effect_chain.h +++ b/effect_chain.h @@ -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. +// +// 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 #include