2 * Copyright 2011, Blender Foundation.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
29 #include "osl_globals.h"
30 #include "osl_services.h"
31 #include "osl_shader.h"
33 #include "util_foreach.h"
35 #include "util_path.h"
36 #include "util_progress.h"
44 /* Shared Texture and Shading System */
46 OSL::TextureSystem *OSLShaderManager::ts_shared = NULL;
47 int OSLShaderManager::ts_shared_users = 0;
48 thread_mutex OSLShaderManager::ts_shared_mutex;
50 OSL::ShadingSystem *OSLShaderManager::ss_shared = NULL;
51 OSLRenderServices *OSLShaderManager::services_shared = NULL;
52 int OSLShaderManager::ss_shared_users = 0;
53 thread_mutex OSLShaderManager::ss_shared_mutex;
54 thread_mutex OSLShaderManager::ss_mutex;
58 OSLShaderManager::OSLShaderManager()
60 texture_system_init();
61 shading_system_init();
64 OSLShaderManager::~OSLShaderManager()
66 shading_system_free();
67 texture_system_free();
70 void OSLShaderManager::reset(Scene *scene)
72 shading_system_free();
73 shading_system_init();
76 void OSLShaderManager::device_update(Device *device, DeviceScene *dscene, Scene *scene, Progress& progress)
81 device_free(device, dscene, scene);
83 /* determine which shaders are in use */
84 device_update_shaders_used(scene);
87 OSLGlobals *og = (OSLGlobals*)device->osl_memory();
89 foreach(Shader *shader, scene->shaders) {
90 assert(shader->graph);
92 if(progress.get_cancel()) return;
94 /* we can only compile one shader at the time as the OSL ShadingSytem
95 * has a single state, but we put the lock here so different renders can
96 * compile shaders alternating */
97 thread_scoped_lock lock(ss_mutex);
99 OSLCompiler compiler((void*)this, (void*)ss, scene->image_manager);
100 compiler.background = (shader == scene->shaders[scene->default_background]);
101 compiler.compile(og, shader);
103 if(shader->use_mis && shader->has_surface_emission)
104 scene->light_manager->need_update = true;
107 /* setup shader engine */
110 og->services = services;
112 int background_id = scene->shader_manager->get_shader_id(scene->default_background);
113 og->background_state = og->surface_state[background_id & SHADER_MASK];
116 foreach(Shader *shader, scene->shaders)
117 shader->need_update = false;
121 /* set texture system */
122 scene->image_manager->set_osl_texture_system((void*)ts);
124 device_update_common(device, dscene, scene, progress);
128 thread_scoped_lock lock(ss_shared_mutex);
129 ss->optimize_all_groups();
133 void OSLShaderManager::device_free(Device *device, DeviceScene *dscene, Scene *scene)
135 OSLGlobals *og = (OSLGlobals*)device->osl_memory();
137 device_free_common(device, dscene, scene);
139 /* clear shader engine */
144 og->surface_state.clear();
145 og->volume_state.clear();
146 og->displacement_state.clear();
147 og->background_state.reset();
150 void OSLShaderManager::texture_system_init()
152 /* create texture system, shared between different renders to reduce memory usage */
153 thread_scoped_lock lock(ts_shared_mutex);
155 if(ts_shared_users == 0) {
156 ts_shared = TextureSystem::create(true);
158 ts_shared->attribute("automip", 1);
159 ts_shared->attribute("autotile", 64);
160 ts_shared->attribute("gray_to_rgb", 1);
162 /* effectively unlimited for now, until we support proper mipmap lookups */
163 ts_shared->attribute("max_memory_MB", 16384);
170 void OSLShaderManager::texture_system_free()
172 /* shared texture system decrease users and destroy if no longer used */
173 thread_scoped_lock lock(ts_shared_mutex);
176 if(ts_shared_users == 0) {
177 OSL::TextureSystem::destroy(ts_shared);
184 void OSLShaderManager::shading_system_init()
186 /* create shading system, shared between different renders to reduce memory usage */
187 thread_scoped_lock lock(ss_shared_mutex);
189 if(ss_shared_users == 0) {
190 services_shared = new OSLRenderServices();
192 ss_shared = OSL::ShadingSystem::create(services_shared, ts_shared, &errhandler);
193 ss_shared->attribute("lockgeom", 1);
194 ss_shared->attribute("commonspace", "world");
195 ss_shared->attribute("searchpath:shader", path_get("shader"));
196 //ss_shared->attribute("greedyjit", 1);
198 /* our own ray types */
199 static const char *raytypes[] = {
200 "camera", /* PATH_RAY_CAMERA */
201 "reflection", /* PATH_RAY_REFLECT */
202 "refraction", /* PATH_RAY_TRANSMIT */
203 "diffuse", /* PATH_RAY_DIFFUSE */
204 "gloss_sharedy", /* PATH_RAY_GLOSSY */
205 "singular", /* PATH_RAY_SINGULAR */
206 "transparent", /* PATH_RAY_TRANSPARENT */
207 "shadow", /* PATH_RAY_SHADOW_OPAQUE */
208 "shadow", /* PATH_RAY_SHADOW_TRANSPARENT */
211 const int nraytypes = sizeof(raytypes)/sizeof(raytypes[0]);
212 ss_shared->attribute("raytypes", TypeDesc(TypeDesc::STRING, nraytypes), raytypes);
214 OSLShader::register_closures((OSLShadingSystem*)ss_shared);
216 loaded_shaders.clear();
220 services = services_shared;
224 void OSLShaderManager::shading_system_free()
226 /* shared shading system decrease users and destroy if no longer used */
227 thread_scoped_lock lock(ss_shared_mutex);
230 if(ss_shared_users == 0) {
231 OSL::ShadingSystem::destroy(ss_shared);
234 delete services_shared;
235 services_shared = NULL;
242 bool OSLShaderManager::osl_compile(const string& inputfile, const string& outputfile)
244 vector<string> options;
247 /* specify output file name */
248 options.push_back("-o");
249 options.push_back(outputfile);
251 /* specify standard include path */
252 options.push_back("-I" + path_get("shader"));
253 stdosl_path = path_get("shader/stdosl.h");
256 OSL::OSLCompiler *compiler = OSL::OSLCompiler::create();
257 bool ok = compiler->compile(inputfile, options, stdosl_path);
263 bool OSLShaderManager::osl_query(OSL::OSLQuery& query, const string& filepath)
265 string searchpath = path_user_get("shaders");
266 return query.open(filepath, searchpath);
269 static string shader_filepath_hash(const string& filepath, uint64_t modified_time)
271 /* compute a hash from filepath and modified time to detect changes */
273 md5.append((const uint8_t*)filepath.c_str(), filepath.size());
274 md5.append((const uint8_t*)&modified_time, sizeof(modified_time));
276 return md5.get_hex();
279 const char *OSLShaderManager::shader_test_loaded(const string& hash)
281 map<string, OSLShaderInfo>::iterator it = loaded_shaders.find(hash);
282 return (it == loaded_shaders.end())? NULL: it->first.c_str();
285 OSLShaderInfo *OSLShaderManager::shader_loaded_info(const string& hash)
287 map<string, OSLShaderInfo>::iterator it = loaded_shaders.find(hash);
288 return (it == loaded_shaders.end())? NULL: &it->second;
291 const char *OSLShaderManager::shader_load_filepath(string filepath)
293 size_t len = filepath.size();
294 string extension = filepath.substr(len - 4);
295 uint64_t modified_time = path_modified_time(filepath);
297 if(extension == ".osl") {
299 string osopath = filepath.substr(0, len - 4) + ".oso";
300 uint64_t oso_modified_time = path_modified_time(osopath);
302 /* test if we have loaded the corresponding .OSO already */
303 if(oso_modified_time != 0) {
304 const char *hash = shader_test_loaded(shader_filepath_hash(osopath, oso_modified_time));
310 /* autocompile .OSL to .OSO if needed */
311 if(oso_modified_time == 0 || (oso_modified_time < modified_time)) {
312 OSLShaderManager::osl_compile(filepath, osopath);
313 modified_time = path_modified_time(osopath);
316 modified_time = oso_modified_time;
321 if(extension == ".oso") {
322 /* .OSO File, nothing to do */
324 else if(path_dirname(filepath) == "") {
325 /* .OSO File in search path */
326 filepath = path_join(path_user_get("shaders"), filepath + ".oso");
333 /* test if we have loaded this .OSO already */
334 const char *hash = shader_test_loaded(shader_filepath_hash(filepath, modified_time));
340 /* read oso bytecode from file */
341 string bytecode_hash = shader_filepath_hash(filepath, modified_time);
344 if(!path_read_text(filepath, bytecode)) {
345 fprintf(stderr, "Cycles shader graph: failed to read file %s\n", filepath.c_str());
347 loaded_shaders[bytecode_hash] = info; /* to avoid repeat tries */
351 return shader_load_bytecode(bytecode_hash, bytecode);
354 const char *OSLShaderManager::shader_load_bytecode(const string& hash, const string& bytecode)
356 ss->LoadMemoryCompiledShader(hash.c_str(), bytecode.c_str());
358 /* this is a bit weak, but works */
360 info.has_surface_emission = (bytecode.find("\"emission\"") != string::npos);
361 info.has_surface_transparent = (bytecode.find("\"transparent\"") != string::npos);
362 info.has_surface_bssrdf = (bytecode.find("\"bssrdf\"") != string::npos);
363 loaded_shaders[hash] = info;
365 return loaded_shaders.find(hash)->first.c_str();
370 OSLCompiler::OSLCompiler(void *manager_, void *shadingsys_, ImageManager *image_manager_)
373 shadingsys = shadingsys_;
374 image_manager = image_manager_;
375 current_type = SHADER_TYPE_SURFACE;
376 current_shader = NULL;
380 string OSLCompiler::id(ShaderNode *node)
382 /* assign layer unique name based on pointer address + bump mode */
384 stream << "node_" << node->name << "_" << node;
389 string OSLCompiler::compatible_name(ShaderNode *node, ShaderInput *input)
391 string sname(input->name);
394 /* strip whitespace */
395 while((i = sname.find(" ")) != string::npos)
396 sname.replace(i, 1, "");
398 /* if output exists with the same name, add "In" suffix */
399 foreach(ShaderOutput *output, node->outputs) {
400 if (strcmp(input->name, output->name)==0) {
409 string OSLCompiler::compatible_name(ShaderNode *node, ShaderOutput *output)
411 string sname(output->name);
414 /* strip whitespace */
415 while((i = sname.find(" ")) != string::npos)
416 sname.replace(i, 1, "");
418 /* if input exists with the same name, add "Out" suffix */
419 foreach(ShaderInput *input, node->inputs) {
420 if (strcmp(input->name, output->name)==0) {
429 bool OSLCompiler::node_skip_input(ShaderNode *node, ShaderInput *input)
431 /* exception for output node, only one input is actually used
432 * depending on the current shader type */
434 if(!(input->usage & ShaderInput::USE_OSL))
437 if(node->name == ustring("output")) {
438 if(strcmp(input->name, "Surface") == 0 && current_type != SHADER_TYPE_SURFACE)
440 if(strcmp(input->name, "Volume") == 0 && current_type != SHADER_TYPE_VOLUME)
442 if(strcmp(input->name, "Displacement") == 0 && current_type != SHADER_TYPE_DISPLACEMENT)
444 if(strcmp(input->name, "Normal") == 0)
447 else if(node->name == ustring("bump")) {
448 if(strcmp(input->name, "Height") == 0)
451 else if(current_type == SHADER_TYPE_DISPLACEMENT && input->link && input->link->parent->name == ustring("bump"))
457 void OSLCompiler::add(ShaderNode *node, const char *name, bool isfilepath)
459 OSL::ShadingSystem *ss = (OSL::ShadingSystem*)shadingsys;
463 name = ((OSLShaderManager*)manager)->shader_load_filepath(name);
469 /* pass in fixed parameter values */
470 foreach(ShaderInput *input, node->inputs) {
472 /* checks to untangle graphs */
473 if(node_skip_input(node, input))
475 /* already has default value assigned */
476 else if(input->default_value != ShaderInput::NONE)
479 string param_name = compatible_name(node, input);
480 switch(input->type) {
481 case SHADER_SOCKET_COLOR:
482 parameter_color(param_name.c_str(), input->value);
484 case SHADER_SOCKET_POINT:
485 parameter_point(param_name.c_str(), input->value);
487 case SHADER_SOCKET_VECTOR:
488 parameter_vector(param_name.c_str(), input->value);
490 case SHADER_SOCKET_NORMAL:
491 parameter_normal(param_name.c_str(), input->value);
493 case SHADER_SOCKET_FLOAT:
494 parameter(param_name.c_str(), input->value.x);
496 case SHADER_SOCKET_INT:
497 parameter(param_name.c_str(), (int)input->value.x);
499 case SHADER_SOCKET_STRING:
500 parameter(param_name.c_str(), input->value_string);
502 case SHADER_SOCKET_CLOSURE:
503 case SHADER_SOCKET_UNDEFINED:
509 /* create shader of the appropriate type. we pass "surface" to all shaders,
510 * because "volume" and "displacement" don't work yet in OSL. the shaders
511 * work fine, but presumably these values would be used for more strict
512 * checking, so when that is fixed, we should update the code here too. */
513 if(current_type == SHADER_TYPE_SURFACE)
514 ss->Shader("surface", name, id(node).c_str());
515 else if(current_type == SHADER_TYPE_VOLUME)
516 ss->Shader("surface", name, id(node).c_str());
517 else if(current_type == SHADER_TYPE_DISPLACEMENT)
518 ss->Shader("surface", name, id(node).c_str());
522 /* link inputs to other nodes */
523 foreach(ShaderInput *input, node->inputs) {
525 if(node_skip_input(node, input))
528 /* connect shaders */
529 string id_from = id(input->link->parent);
530 string id_to = id(node);
531 string param_from = compatible_name(input->link->parent, input->link);
532 string param_to = compatible_name(node, input);
534 ss->ConnectShaders(id_from.c_str(), param_from.c_str(), id_to.c_str(), param_to.c_str());
538 /* test if we shader contains specific closures */
539 OSLShaderInfo *info = ((OSLShaderManager*)manager)->shader_loaded_info(name);
542 if(info->has_surface_emission)
543 current_shader->has_surface_emission = true;
544 if(info->has_surface_transparent)
545 current_shader->has_surface_transparent = true;
546 if(info->has_surface_bssrdf)
547 current_shader->has_surface_bssrdf = true;
551 void OSLCompiler::parameter(const char *name, float f)
553 OSL::ShadingSystem *ss = (OSL::ShadingSystem*)shadingsys;
554 ss->Parameter(name, TypeDesc::TypeFloat, &f);
557 void OSLCompiler::parameter_color(const char *name, float3 f)
559 OSL::ShadingSystem *ss = (OSL::ShadingSystem*)shadingsys;
560 ss->Parameter(name, TypeDesc::TypeColor, &f);
563 void OSLCompiler::parameter_point(const char *name, float3 f)
565 OSL::ShadingSystem *ss = (OSL::ShadingSystem*)shadingsys;
566 ss->Parameter(name, TypeDesc::TypePoint, &f);
569 void OSLCompiler::parameter_normal(const char *name, float3 f)
571 OSL::ShadingSystem *ss = (OSL::ShadingSystem*)shadingsys;
572 ss->Parameter(name, TypeDesc::TypeNormal, &f);
575 void OSLCompiler::parameter_vector(const char *name, float3 f)
577 OSL::ShadingSystem *ss = (OSL::ShadingSystem*)shadingsys;
578 ss->Parameter(name, TypeDesc::TypeVector, &f);
581 void OSLCompiler::parameter(const char *name, int f)
583 OSL::ShadingSystem *ss = (OSL::ShadingSystem*)shadingsys;
584 ss->Parameter(name, TypeDesc::TypeInt, &f);
587 void OSLCompiler::parameter(const char *name, const char *s)
589 OSL::ShadingSystem *ss = (OSL::ShadingSystem*)shadingsys;
590 ss->Parameter(name, TypeDesc::TypeString, &s);
593 void OSLCompiler::parameter(const char *name, ustring s)
595 OSL::ShadingSystem *ss = (OSL::ShadingSystem*)shadingsys;
596 const char *str = s.c_str();
597 ss->Parameter(name, TypeDesc::TypeString, &str);
600 void OSLCompiler::parameter(const char *name, const Transform& tfm)
602 OSL::ShadingSystem *ss = (OSL::ShadingSystem*)shadingsys;
603 ss->Parameter(name, TypeDesc::TypeMatrix, (float*)&tfm);
606 void OSLCompiler::parameter_array(const char *name, const float f[], int arraylen)
608 OSL::ShadingSystem *ss = (OSL::ShadingSystem*)shadingsys;
609 TypeDesc type = TypeDesc::TypeFloat;
610 type.arraylen = arraylen;
611 ss->Parameter(name, type, f);
614 void OSLCompiler::parameter_color_array(const char *name, const float f[][3], int arraylen)
616 OSL::ShadingSystem *ss = (OSL::ShadingSystem*)shadingsys;
617 TypeDesc type = TypeDesc::TypeColor;
618 type.arraylen = arraylen;
619 ss->Parameter(name, type, f);
622 void OSLCompiler::parameter_vector_array(const char *name, const float f[][3], int arraylen)
624 OSL::ShadingSystem *ss = (OSL::ShadingSystem*)shadingsys;
625 TypeDesc type = TypeDesc::TypeVector;
626 type.arraylen = arraylen;
627 ss->Parameter(name, type, f);
630 void OSLCompiler::parameter_normal_array(const char *name, const float f[][3], int arraylen)
632 OSL::ShadingSystem *ss = (OSL::ShadingSystem*)shadingsys;
633 TypeDesc type = TypeDesc::TypeNormal;
634 type.arraylen = arraylen;
635 ss->Parameter(name, type, f);
638 void OSLCompiler::parameter_point_array(const char *name, const float f[][3], int arraylen)
640 OSL::ShadingSystem *ss = (OSL::ShadingSystem*)shadingsys;
641 TypeDesc type = TypeDesc::TypePoint;
642 type.arraylen = arraylen;
643 ss->Parameter(name, type, f);
646 void OSLCompiler::parameter_array(const char *name, const int f[], int arraylen)
648 OSL::ShadingSystem *ss = (OSL::ShadingSystem*)shadingsys;
649 TypeDesc type = TypeDesc::TypeInt;
650 type.arraylen = arraylen;
651 ss->Parameter(name, type, f);
654 void OSLCompiler::parameter_array(const char *name, const char * const s[], int arraylen)
656 OSL::ShadingSystem *ss = (OSL::ShadingSystem*)shadingsys;
657 TypeDesc type = TypeDesc::TypeString;
658 type.arraylen = arraylen;
659 ss->Parameter(name, type, s);
662 void OSLCompiler::parameter_array(const char *name, const Transform tfm[], int arraylen)
664 OSL::ShadingSystem *ss = (OSL::ShadingSystem*)shadingsys;
665 TypeDesc type = TypeDesc::TypeMatrix;
666 type.arraylen = arraylen;
667 ss->Parameter(name, type, (const float *)tfm);
670 void OSLCompiler::find_dependencies(set<ShaderNode*>& dependencies, ShaderInput *input)
672 ShaderNode *node = (input->link)? input->link->parent: NULL;
675 foreach(ShaderInput *in, node->inputs)
676 if(!node_skip_input(node, in))
677 find_dependencies(dependencies, in);
679 dependencies.insert(node);
683 void OSLCompiler::generate_nodes(const set<ShaderNode*>& nodes)
685 set<ShaderNode*> done;
691 foreach(ShaderNode *node, nodes) {
692 if(done.find(node) == done.end()) {
693 bool inputs_done = true;
695 foreach(ShaderInput *input, node->inputs)
696 if(!node_skip_input(node, input))
697 if(input->link && done.find(input->link->parent) == done.end())
701 node->compile(*this);
704 if(node->has_surface_emission())
705 current_shader->has_surface_emission = true;
706 if(node->has_surface_transparent())
707 current_shader->has_surface_transparent = true;
708 if(node->has_surface_bssrdf())
709 current_shader->has_surface_bssrdf = true;
715 } while(!nodes_done);
718 void OSLCompiler::compile_type(Shader *shader, ShaderGraph *graph, ShaderType type)
720 OSL::ShadingSystem *ss = (OSL::ShadingSystem*)shadingsys;
724 ss->ShaderGroupBegin(shader->name.c_str());
726 ShaderNode *output = graph->output();
727 set<ShaderNode*> dependencies;
729 if(type == SHADER_TYPE_SURFACE) {
730 /* generate surface shader */
731 find_dependencies(dependencies, output->input("Surface"));
732 generate_nodes(dependencies);
733 output->compile(*this);
735 else if(type == SHADER_TYPE_VOLUME) {
736 /* generate volume shader */
737 find_dependencies(dependencies, output->input("Volume"));
738 generate_nodes(dependencies);
739 output->compile(*this);
741 else if(type == SHADER_TYPE_DISPLACEMENT) {
742 /* generate displacement shader */
743 find_dependencies(dependencies, output->input("Displacement"));
744 generate_nodes(dependencies);
745 output->compile(*this);
750 ss->ShaderGroupEnd();
753 void OSLCompiler::compile(OSLGlobals *og, Shader *shader)
755 if(shader->need_update) {
756 OSL::ShadingSystem *ss = (OSL::ShadingSystem*)shadingsys;
757 ShaderGraph *graph = shader->graph;
758 ShaderNode *output = (graph)? graph->output(): NULL;
760 /* copy graph for shader with bump mapping */
761 if(output->input("Surface")->link && output->input("Displacement")->link)
762 if(!shader->graph_bump)
763 shader->graph_bump = shader->graph->copy();
766 shader->graph->finalize(false, true);
767 if(shader->graph_bump)
768 shader->graph_bump->finalize(true, true);
770 current_shader = shader;
772 shader->has_surface = false;
773 shader->has_surface_emission = false;
774 shader->has_surface_transparent = false;
775 shader->has_surface_bssrdf = false;
776 shader->has_volume = false;
777 shader->has_displacement = false;
779 /* generate surface shader */
780 if(shader->used && graph && output->input("Surface")->link) {
781 compile_type(shader, shader->graph, SHADER_TYPE_SURFACE);
782 shader->osl_surface_ref = ss->state();
784 if(shader->graph_bump) {
786 compile_type(shader, shader->graph_bump, SHADER_TYPE_SURFACE);
787 shader->osl_surface_bump_ref = ss->state();
790 shader->osl_surface_bump_ref = shader->osl_surface_ref;
794 shader->has_surface = true;
797 shader->osl_surface_ref = OSL::ShadingAttribStateRef();
798 shader->osl_surface_bump_ref = OSL::ShadingAttribStateRef();
801 /* generate volume shader */
802 if(shader->used && graph && output->input("Volume")->link) {
803 compile_type(shader, shader->graph, SHADER_TYPE_VOLUME);
804 shader->has_volume = true;
806 shader->osl_volume_ref = ss->state();
810 shader->osl_volume_ref = OSL::ShadingAttribStateRef();
812 /* generate displacement shader */
813 if(shader->used && graph && output->input("Displacement")->link) {
814 compile_type(shader, shader->graph, SHADER_TYPE_DISPLACEMENT);
815 shader->has_displacement = true;
816 shader->osl_displacement_ref = ss->state();
820 shader->osl_displacement_ref = OSL::ShadingAttribStateRef();
823 /* push state to array for lookup */
824 og->surface_state.push_back(shader->osl_surface_ref);
825 og->surface_state.push_back(shader->osl_surface_bump_ref);
827 og->volume_state.push_back(shader->osl_volume_ref);
828 og->volume_state.push_back(shader->osl_volume_ref);
830 og->displacement_state.push_back(shader->osl_displacement_ref);
831 og->displacement_state.push_back(shader->osl_displacement_ref);
836 void OSLCompiler::add(ShaderNode *node, const char *name, bool isfilepath)
840 void OSLCompiler::parameter(const char *name, float f)
844 void OSLCompiler::parameter_color(const char *name, float3 f)
848 void OSLCompiler::parameter_vector(const char *name, float3 f)
852 void OSLCompiler::parameter_point(const char *name, float3 f)
856 void OSLCompiler::parameter_normal(const char *name, float3 f)
860 void OSLCompiler::parameter(const char *name, int f)
864 void OSLCompiler::parameter(const char *name, const char *s)
868 void OSLCompiler::parameter(const char *name, ustring s)
872 void OSLCompiler::parameter(const char *name, const Transform& tfm)
876 void OSLCompiler::parameter_array(const char *name, const float f[], int arraylen)
880 void OSLCompiler::parameter_color_array(const char *name, const float f[][3], int arraylen)
884 void OSLCompiler::parameter_vector_array(const char *name, const float f[][3], int arraylen)
888 void OSLCompiler::parameter_normal_array(const char *name, const float f[][3], int arraylen)
892 void OSLCompiler::parameter_point_array(const char *name, const float f[][3], int arraylen)
896 void OSLCompiler::parameter_array(const char *name, const int f[], int arraylen)
900 void OSLCompiler::parameter_array(const char *name, const char * const s[], int arraylen)
904 void OSLCompiler::parameter_array(const char *name, const Transform tfm[], int arraylen)
908 #endif /* WITH_OSL */