diff --git a/src/liboslexec/builtindecl.h b/src/liboslexec/builtindecl.h index f620d4020..1b58ba836 100644 --- a/src/liboslexec/builtindecl.h +++ b/src/liboslexec/builtindecl.h @@ -126,6 +126,12 @@ DECL(osl_gen_warningfmt, "xXhiXiX") DECL(osl_split, "isXsii") DECL(osl_incr_layers_executed, "xX") +// For legacy printf support +DECL(osl_printf, "xXs*") +DECL(osl_fprintf, "xXss*") +DECL(osl_error, "xXs*") +DECL(osl_warning, "xXs*") + NOISE_IMPL(cellnoise) //NOISE_DERIV_IMPL(cellnoise) NOISE_IMPL(hashnoise) diff --git a/src/liboslexec/opstring.cpp b/src/liboslexec/opstring.cpp index a68586f8a..50c7fa206 100644 --- a/src/liboslexec/opstring.cpp +++ b/src/liboslexec/opstring.cpp @@ -12,6 +12,7 @@ #include +#include #include #include @@ -161,6 +162,8 @@ osl_format(const char* format_str, ...) return ustring(s).c_str(); } + + OSL_SHADEOP int osl_split(const char* str, ustring* results, const char* sep, int maxsplit, int resultslen) @@ -175,5 +178,37 @@ osl_split(const char* str, ustring* results, const char* sep, int maxsplit, } + +//////// +// The osl_printf, osl_error, osl_warning, and osl_fprintf are deprecated but +// the stubs are needed for now to prevent breaking OptiX-based renderers who +// aren't quite ready to refactor around the journaling print family of +// functions. They eventually can be removed when we're happy that all the +// compliant renderers have adapted. + +OSL_SHADEOP void +osl_printf(ShaderGlobals* sg, const char* format_str, ...) +{ +} + +OSL_SHADEOP void +osl_error(ShaderGlobals* sg, const char* format_str, ...) +{ +} + +OSL_SHADEOP void +osl_warning(ShaderGlobals* sg, const char* format_str, ...) +{ +} + +OSL_SHADEOP void +osl_fprintf(ShaderGlobals* /*sg*/, const char* filename, const char* format_str, + ...) +{ +} + +//////// + + } // end namespace pvt OSL_NAMESPACE_EXIT