3ds Max C++ API Reference
TexmapThreadSafe Class Referenceabstract

TexmapThreadSafe interface has been deprecated. More...

#include <TexmapThreadSafe.h>

+ Inheritance diagram for TexmapThreadSafe:

Public Types

enum  TexmapFunction { FunctionEvalColor = 1 , FunctionEvalMono = 1 << 1 }
 This enum type specifies a Texmap function. More...
 
- Public Types inherited from BaseInterface
enum  LifetimeType { noRelease , immediateRelease , wantsRelease , serverControlled }
 

Public Member Functions

virtual Interface_ID GetID ()
 Gets the interface ID of TexmapThreadSafe. More...
 
virtual void SetFunctionFlag (TexmapFunction function, bool bThreadSafe)=0
 Sets a thread safe flag for a texmap function. More...
 
virtual bool GetFunctionFlag (TexmapFunction function)=0
 Returns the specified TexmapFunction's thread safe flag. More...
 
virtual void SetFunctionStrictFlag (TexmapFunction function, bool bThreadSafe)=0
 Specifies the function of the texmap with strict thread safe flag. More...
 
virtual bool GetFunctionStrictFlag (TexmapFunction function)=0
 Returns the specified Texmap function's thread safe flag. More...
 
- Public Member Functions inherited from BaseInterface
virtual UtilExport ~BaseInterface ()
 Destructor. More...
 
UtilExport BaseInterfaceGetInterface (Interface_ID id)
 
virtual LifetimeType LifetimeControl ()
 
virtual bool RegisterNotifyCallback (InterfaceNotifyCallback *incb)
 
virtual void UnRegisterNotifyCallback (InterfaceNotifyCallback *incb)
 
virtual BaseInterfaceAcquireInterface ()
 
virtual void ReleaseInterface ()
 
virtual void DeleteInterface ()
 
virtual BaseInterfaceCloneInterface (void *remapDir=NULL)
 
- Public Member Functions inherited from InterfaceServer
virtual UtilExport ~InterfaceServer ()
 Destructor. More...
 
template<class InterfaceType >
InterfaceType * GetTypedInterface ()
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary. More...
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
 

Detailed Description

TexmapThreadSafe interface has been deprecated.

Texmaps EvalColor() and EvalMono() methods should be thread-safe by definition; renderers will always access them from multiple threads, and they are not allowed to touch the scene data, only data in member variables local in the shader instance, and even those only in a read-only fashion.

For compatibility and as a safety measure, the interface does still exist, but from 3ds Max 2019, texmaps are rightly assumed to be multi-threaded by default, and only if this interface is used and explicitly set the thread safety to FALSE, will Texmap rendering revert to single-threading.

Here is the original (deprecated) documentation of the interface:

TexmapThreadSafe provides any texture plugin with thread safe support information in 3ds Max 2015. The Max system will use multiple threads to accelerate texmap render if the Texmap function is thread safe. This will improve the performance of baking textures for display in the viewport. A typical implementation would look like this, and can be added to the constructor of the plugin class:

DbgAssert(pTexmapThreadSafe != nullptr);
#define ITEXMAP_THREAD_SAFE
Interface ID of class TexmapThreadSafe.
Definition: TexmapThreadSafe.h:14
UtilExport BaseInterface * GetInterface(Interface_ID id)
TexmapThreadSafe interface has been deprecated.
Definition: TexmapThreadSafe.h:47
@ FunctionEvalColor
FunctionEvalColor EvalColor(ShadeContext& sc) of class Texmap.
Definition: TexmapThreadSafe.h:53
@ FunctionEvalMono
FunctionEvalMono EvalMono(ShadeContext& sc) of class Texmap.
Definition: TexmapThreadSafe.h:54
virtual void SetFunctionFlag(TexmapFunction function, bool bThreadSafe)=0
Sets a thread safe flag for a texmap function.
#define DbgAssert(expr)
Definition: assert1.h:82
See also
Thread Safety

Member Enumeration Documentation

◆ TexmapFunction

This enum type specifies a Texmap function.

Enumerator
FunctionEvalColor 

FunctionEvalColor EvalColor(ShadeContext& sc) of class Texmap.

FunctionEvalMono 

FunctionEvalMono EvalMono(ShadeContext& sc) of class Texmap.

52  {
53  FunctionEvalColor = 1,
54  FunctionEvalMono = 1 << 1,
55  };

Member Function Documentation

◆ GetID()

virtual Interface_ID GetID ( )
inlinevirtual

Gets the interface ID of TexmapThreadSafe.

Reimplemented from BaseInterface.

59 { return ITEXMAP_THREAD_SAFE; }

◆ SetFunctionFlag()

virtual void SetFunctionFlag ( TexmapFunction  function,
bool  bThreadSafe 
)
pure virtual

Sets a thread safe flag for a texmap function.

This requires the specified TexmapFunction to be implemented as thread safe between different instances of Texmap.

Parameters
[in]functionthe specified Texmap function.
[in]bThreadSafewhether the specific function is thread safe.

◆ GetFunctionFlag()

virtual bool GetFunctionFlag ( TexmapFunction  function)
pure virtual

Returns the specified TexmapFunction's thread safe flag.

Parameters
[in]functionthe specified TexmapFunction.
Returns
thread safe flag. The default is false.

◆ SetFunctionStrictFlag()

virtual void SetFunctionStrictFlag ( TexmapFunction  function,
bool  bThreadSafe 
)
pure virtual

Specifies the function of the texmap with strict thread safe flag.

This requires the specified Texmap function to be thread safe within one instance of Texmap. This is stricter than SetFunctionFlag().

Parameters
[in]functionTexmap function.
[in]bThreadSafewhether the specific function is thread safe.

◆ GetFunctionStrictFlag()

virtual bool GetFunctionStrictFlag ( TexmapFunction  function)
pure virtual

Returns the specified Texmap function's thread safe flag.

Parameters
[in]functionthe specified Texmap function.
Returns
thread safe flag. The default is false.