Blender V2.61 - r43446
|
#include <svm.h>
Definition at line 54 of file render/svm.h.
SVMCompiler::SVMCompiler | ( | ShaderManager * | shader_manager, |
ImageManager * | image_manager, | ||
bool | use_multi_closure_ | ||
) |
Definition at line 105 of file svm.cpp.
References background, current_shader, current_type, image_manager, max_stack_use, mix_weight_offset, NULL, shader_manager, SHADER_TYPE_SURFACE, sunsky, SVM_STACK_INVALID, and use_multi_closure.
void SVMCompiler::add_node | ( | NodeType | type, |
int | a = 0 , |
||
int | b = 0 , |
||
int | c = 0 |
||
) |
Definition at line 307 of file svm.cpp.
References make_int4(), and svm_nodes.
Referenced by VolumeNode::compile(), BsdfNode::compile(), TextureMapping::compile(), compile_type(), generate_closure(), generate_multi_closure(), and stack_assign().
void SVMCompiler::add_node | ( | const float4 & | f | ) |
Definition at line 320 of file svm.cpp.
References __float_as_int(), make_int4(), svm_nodes, float4::w, float4::x, float4::y, and float4::z.
void SVMCompiler::add_node | ( | int | a = 0 , |
int | b = 0 , |
||
int | c = 0 , |
||
int | d = 0 |
||
) |
Definition at line 302 of file svm.cpp.
References make_int4(), and svm_nodes.
Definition at line 312 of file svm.cpp.
References __float_as_int(), make_int4(), svm_nodes, float3::x, float3::y, and float3::z.
uint SVMCompiler::attribute | ( | ustring | name | ) |
Definition at line 329 of file svm.cpp.
References ShaderManager::get_attribute_id(), and shader_manager.
uint SVMCompiler::attribute | ( | Attribute::Standard | std | ) |
Definition at line 334 of file svm.cpp.
References ShaderManager::get_attribute_id(), and shader_manager.
uint SVMCompiler::closure_mix_weight_offset | ( | ) | [inline] |
Definition at line 70 of file render/svm.h.
References mix_weight_offset.
Referenced by VolumeNode::compile(), and BsdfNode::compile().
Definition at line 977 of file nodes.cpp.
References BsdfNode::compile(), and NULL.
Referenced by SVMShaderManager::device_update().
void SVMCompiler::compile_type | ( | Shader * | shader, |
ShaderGraph * | graph, | ||
ShaderType | type | ||
) | [protected] |
Definition at line 556 of file svm.cpp.
References active_stack, add_node(), assert, ShaderNode::compile(), current_graph, current_type, generate_closure(), generate_multi_closure(), Shader::has_displacement, Shader::has_surface, Shader::has_volume, ShaderNode::input(), ShaderNode::inputs, ShaderInput::link, NODE_END, ShaderGraph::nodes, NULL, ShaderGraph::output(), ShaderNode::outputs, ShaderOutput::parent, SHADER_TYPE_DISPLACEMENT, SHADER_TYPE_SURFACE, SHADER_TYPE_VOLUME, ShaderInput::stack_offset, ShaderOutput::stack_offset, svm_nodes, SVM_STACK_INVALID, and use_multi_closure.
Definition at line 292 of file svm.cpp.
References assert.
Referenced by VolumeNode::compile(), BsdfNode::compile(), and generate_multi_closure().
void SVMCompiler::find_dependencies | ( | set< ShaderNode * > & | dependencies, |
const set< ShaderNode * > & | done, | ||
ShaderInput * | input | ||
) | [protected] |
Definition at line 348 of file svm.cpp.
References ShaderNode::inputs, ShaderInput::link, node_skip_input(), NULL, and ShaderOutput::parent.
Referenced by generate_closure(), and generate_multi_closure().
void SVMCompiler::generate_closure | ( | ShaderNode * | node, |
set< ShaderNode * > & | done | ||
) | [protected] |
Definition at line 390 of file svm.cpp.
References add_node(), ShaderNode::compile(), current_shader, find_dependencies(), generate_svm_nodes(), Shader::has_surface_emission, Shader::has_surface_transparent, ShaderNode::input(), ShaderNode::inputs, ShaderInput::link, ShaderNode::name, NODE_ADD_CLOSURE, NODE_END, NODE_MIX_CLOSURE, node_skip_input(), ShaderOutput::parent, stack_assign(), stack_backup(), stack_clear_temporary(), stack_clear_users(), ShaderInput::stack_offset, stack_restore(), and svm_nodes.
Referenced by compile_type().
void SVMCompiler::generate_multi_closure | ( | ShaderNode * | node, |
set< ShaderNode * > & | done, | ||
uint | in_offset | ||
) | [protected] |
Definition at line 476 of file svm.cpp.
References active_stack, add_node(), ShaderNode::compile(), current_shader, encode_uchar4(), find_dependencies(), generate_svm_nodes(), Shader::has_surface_emission, Shader::has_surface_transparent, ShaderNode::input(), ShaderNode::inputs, ShaderInput::link, mix_weight_offset, ShaderNode::name, NODE_MIX_CLOSURE, node_skip_input(), ShaderOutput::parent, SHADER_SOCKET_FLOAT, stack_assign(), stack_clear_temporary(), stack_clear_users(), stack_find_offset(), ShaderInput::stack_offset, SVM_STACK_INVALID, and SVMCompiler::Stack::users.
Referenced by compile_type().
void SVMCompiler::generate_svm_nodes | ( | const set< ShaderNode * > & | nodes, |
set< ShaderNode * > & | done | ||
) | [protected] |
Definition at line 361 of file svm.cpp.
References ShaderNode::compile(), ShaderNode::inputs, ShaderInput::link, node_skip_input(), ShaderOutput::parent, stack_clear_temporary(), and stack_clear_users().
Referenced by generate_closure(), and generate_multi_closure().
bool SVMCompiler::node_skip_input | ( | ShaderNode * | node, |
ShaderInput * | input | ||
) | [protected] |
Definition at line 339 of file svm.cpp.
References current_type, ShaderInput::link, ShaderNode::name, ShaderOutput::parent, and SHADER_TYPE_DISPLACEMENT.
Referenced by find_dependencies(), generate_closure(), generate_multi_closure(), and generate_svm_nodes().
ShaderType SVMCompiler::output_type | ( | ) | [inline] |
Definition at line 72 of file render/svm.h.
References current_type.
void SVMCompiler::stack_assign | ( | ShaderOutput * | output | ) |
Definition at line 221 of file svm.cpp.
References stack_find_offset(), ShaderOutput::stack_offset, SVM_STACK_INVALID, and ShaderOutput::type.
Referenced by VolumeNode::compile(), BsdfNode::compile(), generate_closure(), and generate_multi_closure().
void SVMCompiler::stack_assign | ( | ShaderInput * | input | ) |
Definition at line 192 of file svm.cpp.
References __float_as_int(), add_node(), assert, ShaderInput::link, NODE_VALUE_F, NODE_VALUE_V, SHADER_SOCKET_COLOR, SHADER_SOCKET_FLOAT, SHADER_SOCKET_NORMAL, SHADER_SOCKET_POINT, SHADER_SOCKET_VECTOR, stack_find_offset(), ShaderInput::stack_offset, ShaderOutput::stack_offset, SVM_STACK_INVALID, ShaderInput::type, ShaderInput::value, and float3::x.
void SVMCompiler::stack_backup | ( | StackBackup & | backup, |
set< ShaderNode * > & | done | ||
) | [protected] |
Definition at line 164 of file svm.cpp.
References active_stack, current_graph, SVMCompiler::StackBackup::done, ShaderNode::inputs, ShaderGraph::nodes, SVMCompiler::StackBackup::offsets, ShaderNode::outputs, SVMCompiler::StackBackup::stack, ShaderInput::stack_offset, and ShaderOutput::stack_offset.
Referenced by generate_closure().
void SVMCompiler::stack_clear_temporary | ( | ShaderNode * | node | ) | [protected] |
Definition at line 278 of file svm.cpp.
References active_stack, i, ShaderNode::inputs, ShaderInput::link, size(), ShaderInput::stack_offset, stack_size(), SVM_STACK_INVALID, ShaderInput::type, and SVMCompiler::Stack::users.
Referenced by generate_closure(), generate_multi_closure(), and generate_svm_nodes().
void SVMCompiler::stack_clear_users | ( | ShaderNode * | node, |
set< ShaderNode * > & | done | ||
) | [protected] |
Definition at line 243 of file svm.cpp.
References active_stack, i, ShaderNode::inputs, ShaderInput::link, ShaderOutput::links, size(), ShaderInput::stack_offset, ShaderOutput::stack_offset, stack_size(), SVM_STACK_INVALID, ShaderOutput::type, and SVMCompiler::Stack::users.
Referenced by generate_closure(), generate_multi_closure(), and generate_svm_nodes().
int SVMCompiler::stack_find_offset | ( | ShaderSocketType | type | ) | [protected] |
Definition at line 137 of file svm.cpp.
References active_stack, assert, i, max, max_stack_use, size(), stack_size(), SVM_STACK_SIZE, and SVMCompiler::Stack::users.
Referenced by generate_multi_closure(), and stack_assign().
void SVMCompiler::stack_link | ( | ShaderInput * | input, |
ShaderOutput * | output | ||
) |
Definition at line 228 of file svm.cpp.
References active_stack, assert, i, ShaderInput::link, size(), ShaderOutput::stack_offset, stack_size(), SVM_STACK_INVALID, ShaderOutput::type, and SVMCompiler::Stack::users.
void SVMCompiler::stack_restore | ( | StackBackup & | backup, |
set< ShaderNode * > & | done | ||
) | [protected] |
Definition at line 177 of file svm.cpp.
References active_stack, current_graph, SVMCompiler::StackBackup::done, i, ShaderNode::inputs, ShaderGraph::nodes, SVMCompiler::StackBackup::offsets, ShaderNode::outputs, SVMCompiler::StackBackup::stack, ShaderInput::stack_offset, and ShaderOutput::stack_offset.
Referenced by generate_closure().
int SVMCompiler::stack_size | ( | ShaderSocketType | type | ) | [protected] |
Definition at line 118 of file svm.cpp.
References assert, SHADER_SOCKET_CLOSURE, SHADER_SOCKET_COLOR, SHADER_SOCKET_FLOAT, SHADER_SOCKET_NORMAL, SHADER_SOCKET_POINT, and SHADER_SOCKET_VECTOR.
Referenced by stack_clear_temporary(), stack_clear_users(), stack_find_offset(), and stack_link().
Stack SVMCompiler::active_stack [protected] |
Definition at line 134 of file render/svm.h.
Referenced by compile_type(), generate_multi_closure(), stack_backup(), stack_clear_temporary(), stack_clear_users(), stack_find_offset(), stack_link(), and stack_restore().
Definition at line 77 of file render/svm.h.
Referenced by SVMShaderManager::device_update(), and SVMCompiler().
ShaderGraph* SVMCompiler::current_graph [protected] |
Definition at line 133 of file render/svm.h.
Referenced by compile_type(), stack_backup(), and stack_restore().
Shader* SVMCompiler::current_shader [protected] |
Definition at line 132 of file render/svm.h.
Referenced by generate_closure(), generate_multi_closure(), and SVMCompiler().
ShaderType SVMCompiler::current_type [protected] |
Definition at line 131 of file render/svm.h.
Referenced by compile_type(), node_skip_input(), output_type(), and SVMCompiler().
Definition at line 74 of file render/svm.h.
Referenced by SVMCompiler().
int SVMCompiler::max_stack_use [protected] |
Definition at line 135 of file render/svm.h.
Referenced by stack_find_offset(), and SVMCompiler().
uint SVMCompiler::mix_weight_offset [protected] |
Definition at line 136 of file render/svm.h.
Referenced by closure_mix_weight_offset(), generate_multi_closure(), and SVMCompiler().
Definition at line 75 of file render/svm.h.
Referenced by attribute(), and SVMCompiler().
Definition at line 76 of file render/svm.h.
Referenced by SVMShaderManager::device_update(), and SVMCompiler().
vector<int4> SVMCompiler::svm_nodes [protected] |
Definition at line 130 of file render/svm.h.
Referenced by add_node(), compile_type(), and generate_closure().
bool SVMCompiler::use_multi_closure [protected] |
Definition at line 137 of file render/svm.h.
Referenced by compile_type(), and SVMCompiler().