diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-03-03 13:59:20 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-03-03 14:02:31 +0300 |
commit | 8c113a95e3536dfa0be37c9e2e924ea8172bb613 (patch) | |
tree | fc71fffa34bc552168f79efccd5bd02b14700556 /source/blender/render | |
parent | ba7eb0c7b9d93987173780d5b819c7f2ec79b96e (diff) |
Make texture node threaded
Quite trivial idea -- just pass tread ID to the texture sampling function.
Implemented as a TLS to avoid passing huge amount of extra contexts around.
Should be working on all platforms, but compilation test is required.
Reviewers: juicyfruit, campbellbarton
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D1831
Diffstat (limited to 'source/blender/render')
-rw-r--r-- | source/blender/render/extern/include/RE_shader_ext.h | 10 | ||||
-rw-r--r-- | source/blender/render/intern/source/render_texture.c | 23 |
2 files changed, 30 insertions, 3 deletions
diff --git a/source/blender/render/extern/include/RE_shader_ext.h b/source/blender/render/extern/include/RE_shader_ext.h index 2b07ace26db..12b97aedbd3 100644 --- a/source/blender/render/extern/include/RE_shader_ext.h +++ b/source/blender/render/extern/include/RE_shader_ext.h @@ -198,7 +198,15 @@ struct ImagePool; struct Object; /* this one uses nodes */ -int multitex_ext(struct Tex *tex, float texvec[3], float dxt[3], float dyt[3], int osatex, struct TexResult *texres, struct ImagePool *pool, bool scene_color_manage, const bool skip_load_image); +int multitex_ext(struct Tex *tex, + float texvec[3], + float dxt[3], float dyt[3], + int osatex, + struct TexResult *texres, + const short thread, + struct ImagePool *pool, + bool scene_color_manage, + const bool skip_load_image); /* nodes disabled */ int multitex_ext_safe(struct Tex *tex, float texvec[3], struct TexResult *texres, struct ImagePool *pool, bool scene_color_manage, const bool skip_load_image); /* only for internal node usage */ diff --git a/source/blender/render/intern/source/render_texture.c b/source/blender/render/intern/source/render_texture.c index 172fc999897..193f619c09c 100644 --- a/source/blender/render/intern/source/render_texture.c +++ b/source/blender/render/intern/source/render_texture.c @@ -1377,9 +1377,28 @@ static int multitex_mtex(ShadeInput *shi, MTex *mtex, float texvec[3], float dxt * * Use it for stuff which is out of render pipeline. */ -int multitex_ext(Tex *tex, float texvec[3], float dxt[3], float dyt[3], int osatex, TexResult *texres, struct ImagePool *pool, bool scene_color_manage, const bool skip_load_image) +int multitex_ext(Tex *tex, + float texvec[3], + float dxt[3], float dyt[3], + int osatex, + TexResult *texres, + const short thread, + struct ImagePool *pool, + bool scene_color_manage, + const bool skip_load_image) { - return multitex_nodes_intern(tex, texvec, dxt, dyt, osatex, texres, 0, 0, NULL, NULL, pool, scene_color_manage, skip_load_image, false); + return multitex_nodes_intern(tex, + texvec, + dxt, dyt, + osatex, + texres, + thread, + 0, + NULL, NULL, + pool, + scene_color_manage, + skip_load_image, + false); } /* extern-tex doesn't support nodes (ntreeBeginExec() can't be called when rendering is going on)\ |