Fix OpenImageIO thread pool not following -t command line option
We do this for the OpenEXR thread pool as well. Needed until OIIO fully switches over to TBB. Pull Request: https://projects.blender.org/blender/blender/pulls/110501
This commit is contained in:
committed by
Brecht Van Lommel
parent
f5e567b4a8
commit
803b541307
@@ -239,6 +239,8 @@ void imb_filetypes_init()
|
||||
{
|
||||
const ImFileType *type;
|
||||
|
||||
OIIO_init();
|
||||
|
||||
for (type = IMB_FILE_TYPES; type < IMB_FILE_TYPES_LAST; type++) {
|
||||
if (type->init) {
|
||||
type->init();
|
||||
|
||||
@@ -7,12 +7,24 @@
|
||||
*/
|
||||
|
||||
#include "openimageio_api.h"
|
||||
|
||||
#include <OpenImageIO/imageio.h>
|
||||
|
||||
#include "BLI_threads.h"
|
||||
|
||||
OIIO_NAMESPACE_USING
|
||||
|
||||
extern "C" {
|
||||
|
||||
void OIIO_init()
|
||||
{
|
||||
/* Make OIIO thread pool follow Blender number of threads override. */
|
||||
const int threads_override = BLI_system_num_threads_override_get();
|
||||
if (threads_override) {
|
||||
OIIO::attribute("threads", threads_override);
|
||||
}
|
||||
}
|
||||
|
||||
int OIIO_getVersionHex()
|
||||
{
|
||||
return openimageio_version();
|
||||
|
||||
@@ -12,6 +12,14 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Initialize OpenImageIO on startup.
|
||||
*/
|
||||
void OIIO_init(void);
|
||||
|
||||
/*
|
||||
* Get OpenImageIO version.
|
||||
*/
|
||||
int OIIO_getVersionHex(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
Reference in New Issue
Block a user