Blender V2.61 - r43446
Classes | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes

SVMCompiler Class Reference

#include <svm.h>

List of all members.

Classes

struct  Stack
struct  StackBackup

Public Member Functions

 SVMCompiler (ShaderManager *shader_manager, ImageManager *image_manager, bool use_multi_closure_)
void compile (Shader *shader, vector< int4 > &svm_nodes, int index)
void stack_assign (ShaderOutput *output)
void stack_assign (ShaderInput *input)
void stack_link (ShaderInput *input, ShaderOutput *output)
void add_node (NodeType type, int a=0, int b=0, int c=0)
void add_node (int a=0, int b=0, int c=0, int d=0)
void add_node (NodeType type, const float3 &f)
void add_node (const float4 &f)
uint attribute (ustring name)
uint attribute (Attribute::Standard std)
uint encode_uchar4 (uint x, uint y=0, uint z=0, uint w=0)
uint closure_mix_weight_offset ()
ShaderType output_type ()

Public Attributes

ImageManagerimage_manager
ShaderManagershader_manager
KernelSunSkysunsky
bool background

Protected Member Functions

void stack_backup (StackBackup &backup, set< ShaderNode * > &done)
void stack_restore (StackBackup &backup, set< ShaderNode * > &done)
void stack_clear_temporary (ShaderNode *node)
int stack_size (ShaderSocketType type)
int stack_find_offset (ShaderSocketType type)
void stack_clear_users (ShaderNode *node, set< ShaderNode * > &done)
bool node_skip_input (ShaderNode *node, ShaderInput *input)
void find_dependencies (set< ShaderNode * > &dependencies, const set< ShaderNode * > &done, ShaderInput *input)
void generate_svm_nodes (const set< ShaderNode * > &nodes, set< ShaderNode * > &done)
void generate_closure (ShaderNode *node, set< ShaderNode * > &done)
void generate_multi_closure (ShaderNode *node, set< ShaderNode * > &done, uint in_offset)
void compile_type (Shader *shader, ShaderGraph *graph, ShaderType type)

Protected Attributes

vector< int4svm_nodes
ShaderType current_type
Shadercurrent_shader
ShaderGraphcurrent_graph
Stack active_stack
int max_stack_use
uint mix_weight_offset
bool use_multi_closure

Detailed Description

Definition at line 54 of file render/svm.h.


Constructor & Destructor Documentation

SVMCompiler::SVMCompiler ( ShaderManager shader_manager,
ImageManager image_manager,
bool  use_multi_closure_ 
)

Member Function Documentation

void SVMCompiler::add_node ( NodeType  type,
int  a = 0,
int  b = 0,
int  c = 0 
)
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.

void SVMCompiler::add_node ( NodeType  type,
const float3 f 
)

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().

void SVMCompiler::compile ( Shader shader,
vector< int4 > &  svm_nodes,
int  index 
)

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]
uint SVMCompiler::encode_uchar4 ( uint  x,
uint  y = 0,
uint  z = 0,
uint  w = 0 
)

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]
void SVMCompiler::generate_closure ( ShaderNode node,
set< ShaderNode * > &  done 
) [protected]
void SVMCompiler::generate_multi_closure ( ShaderNode node,
set< ShaderNode * > &  done,
uint  in_offset 
) [protected]
void SVMCompiler::generate_svm_nodes ( const set< ShaderNode * > &  nodes,
set< ShaderNode * > &  done 
) [protected]
bool SVMCompiler::node_skip_input ( ShaderNode node,
ShaderInput input 
) [protected]
ShaderType SVMCompiler::output_type ( ) [inline]

Definition at line 72 of file render/svm.h.

References current_type.

void SVMCompiler::stack_assign ( ShaderOutput output)
void SVMCompiler::stack_assign ( ShaderInput input)
void SVMCompiler::stack_backup ( StackBackup backup,
set< ShaderNode * > &  done 
) [protected]
void SVMCompiler::stack_clear_temporary ( ShaderNode node) [protected]
void SVMCompiler::stack_clear_users ( ShaderNode node,
set< ShaderNode * > &  done 
) [protected]
int SVMCompiler::stack_find_offset ( ShaderSocketType  type) [protected]
void SVMCompiler::stack_link ( ShaderInput input,
ShaderOutput output 
)
void SVMCompiler::stack_restore ( StackBackup backup,
set< ShaderNode * > &  done 
) [protected]
int SVMCompiler::stack_size ( ShaderSocketType  type) [protected]

Member Data Documentation

Definition at line 77 of file render/svm.h.

Referenced by SVMShaderManager::device_update(), and SVMCompiler().

Definition at line 133 of file render/svm.h.

Referenced by compile_type(), stack_backup(), and stack_restore().

Definition at line 132 of file render/svm.h.

Referenced by generate_closure(), generate_multi_closure(), and SVMCompiler().

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().

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().

Definition at line 137 of file render/svm.h.

Referenced by compile_type(), and SVMCompiler().


The documentation for this class was generated from the following files: