MDL SDK API nvidia_logo_transpbg.gif Up
mi::mdl::ICall_evaluator Class Referenceabstract

A Helper interface to do renderer specific constant folding. More...

#include <mdl_generated_dag.h>

Public Member Functions

virtual bool is_evaluate_intrinsic_function_enabled (IDefinition::Semantics sema) const =0
 Check whether evaluate_intrinsic_function() should be called for an unhandled intrinsic functions with the given semantic. More...
 
virtual IValue const * evaluate_intrinsic_function (IValue_factory *value_factory, IDefinition::Semantics sema, IValue const *const arguments[], size_t n_arguments) const =0
 Evaluate an intrinsic function. More...
 

Detailed Description

A Helper interface to do renderer specific constant folding.

This interface is called by the DAG IR optimizer on functions that have a known semantics but cannot be folded in general. A renderer might have additional knowledge that allows folding.

One example is tex::width(). A renderer might already know the width of a texture, so it could replace the runtime call by a constant.

Member Function Documentation

 evaluate_intrinsic_function()

virtual IValue const * mi::mdl::ICall_evaluator::evaluate_intrinsic_function ( IValue_factory *  value_factory,
IDefinition::Semantics  sema,
IValue const *const  arguments[],
size_t  n_arguments 
) const
pure virtual

Evaluate an intrinsic function.

Parameters
value_factoryThe value factory to create values.
semaThe semantic of the intrinsic function to evaluate.
argumentsThe arguments of the function.
n_argumentsThe number of arguments.
Returns
the result of the function call or IValue_bad.

 is_evaluate_intrinsic_function_enabled()

virtual bool mi::mdl::ICall_evaluator::is_evaluate_intrinsic_function_enabled ( IDefinition::Semantics  sema) const
pure virtual

Check whether evaluate_intrinsic_function() should be called for an unhandled intrinsic functions with the given semantic.

Parameters
semathe semantic to check for