18# include <OSL/llvm_util.h>
19# include <OSL/oslcomp.h>
20# include <OSL/oslexec.h>
21# include <OSL/oslquery.h>
44 : has_surface_emission(
false), has_surface_transparent(
false), has_surface_bssrdf(
false)
49 bool has_surface_emission;
50 bool has_surface_transparent;
51 bool has_surface_bssrdf;
58 OSLShaderManager(
Device *device);
80 static bool osl_compile(
const string &inputfile,
const string &outputfile);
81 static bool osl_query(OSL::OSLQuery &query,
const string &filepath);
84 const char *shader_test_loaded(
const string &
hash);
85 const char *shader_load_bytecode(
const string &
hash,
const string &bytecode);
86 const char *shader_load_filepath(
string filepath);
87 OSLShaderInfo *shader_loaded_info(
const string &
hash);
92 const std::string &filepath,
93 const std::string &bytecode_hash =
"",
94 const std::string &bytecode =
"");
97 static void osl_image_slots(
Device *device,
ImageManager *image_manager, set<int> &image_slots);
100 void texture_system_init();
101 void texture_system_free();
103 void shading_system_init();
104 void shading_system_free();
107 map<string, OSLShaderInfo> loaded_shaders;
109 static OSL::TextureSystem *ts_shared;
111 static int ts_shared_users;
113 static OSL::ErrorHandler errhandler;
114 static map<int, OSL::ShadingSystem *> ss_shared;
117 static int ss_shared_users;
127 OSLCompiler(OSLShaderManager *manager, OSL::ShadingSystem *shadingsys,
Scene *scene);
131 void add(
ShaderNode *node,
const char *name,
bool isfilepath =
false);
135 void parameter(
const char *name,
float f);
141 void parameter(
const char *name,
const char *s);
173 OSLShaderManager *manager;
175 OSL::ShadingSystem *ss;
181 static int texture_shared_unique_id;
void reset()
clear internal cached data and reset random seed
void add(ShaderNode *node, const char *name, bool isfilepath=false)
void parameter_vector(const char *name, float3 f)
void parameter_array(const char *name, const float f[], int arraylen)
void parameter_texture_ies(const char *name, int svm_slot)
void parameter_texture(const char *name, ustring filename, ustring colorspace)
void parameter(ShaderNode *node, const char *name)
void parameter_normal(const char *name, float3 f)
void parameter_color_array(const char *name, const array< float3 > &f)
void compile(OSLGlobals *og, Shader *shader)
void parameter_point(const char *name, float3 f)
void parameter_color(const char *name, float3 f)
void parameter_attribute(const char *name, ustring s)
static void free_memory()
virtual void device_free(Device *device, DeviceScene *dscene, Scene *scene)=0
virtual uint64_t get_attribute_id(ustring name)
virtual void device_update_specific(Device *device, DeviceScene *dscene, Scene *scene, Progress &progress)=0
#define CCL_NAMESPACE_END
set< ShaderNode *, ShaderNodeIDComparator > ShaderNodeSet
unsigned __int64 uint64_t
CCL_NAMESPACE_BEGIN typedef std::mutex thread_mutex