|
Blender V5.0
|
Go to the source code of this file.
Classes | |
| struct | GPUNode |
| struct | GPUNodeLink |
| struct | GPUOutput |
| struct | GPUInput |
| struct | GPUNodeGraphOutputLink |
| struct | GPUNodeGraphFunctionLink |
| struct | GPUNodeGraph |
Enumerations | |
| enum | GPUDataSource { GPU_SOURCE_OUTPUT , GPU_SOURCE_CONSTANT , GPU_SOURCE_UNIFORM , GPU_SOURCE_ATTR , GPU_SOURCE_UNIFORM_ATTR , GPU_SOURCE_LAYER_ATTR , GPU_SOURCE_STRUCT , GPU_SOURCE_TEX , GPU_SOURCE_TEX_TILED_MAPPING , GPU_SOURCE_FUNCTION_CALL , GPU_SOURCE_CRYPTOMATTE } |
| enum | GPUNodeLinkType { GPU_NODE_LINK_NONE = 0 , GPU_NODE_LINK_ATTR , GPU_NODE_LINK_UNIFORM_ATTR , GPU_NODE_LINK_LAYER_ATTR , GPU_NODE_LINK_COLORBAND , GPU_NODE_LINK_CONSTANT , GPU_NODE_LINK_IMAGE , GPU_NODE_LINK_IMAGE_TILED , GPU_NODE_LINK_IMAGE_TILED_MAPPING , GPU_NODE_LINK_IMAGE_SKY , GPU_NODE_LINK_OUTPUT , GPU_NODE_LINK_UNIFORM , GPU_NODE_LINK_DIFFERENTIATE_FLOAT_FN } |
| enum | GPUNodeTag { GPU_NODE_TAG_NONE = 0 , GPU_NODE_TAG_SURFACE = (1 << 0) , GPU_NODE_TAG_VOLUME = (1 << 1) , GPU_NODE_TAG_DISPLACEMENT = (1 << 2) , GPU_NODE_TAG_THICKNESS = (1 << 3) , GPU_NODE_TAG_AOV = (1 << 4) , GPU_NODE_TAG_FUNCTION = (1 << 5) , GPU_NODE_TAG_COMPOSITOR = (1 << 6) } |
Functions | |
| void | gpu_nodes_tag (GPUNodeGraph *graph, GPUNodeLink *link_start, GPUNodeTag tag) |
| void | gpu_node_graph_prune_unused (GPUNodeGraph *graph) |
| void | gpu_node_graph_finalize_uniform_attrs (GPUNodeGraph *graph) |
| void | gpu_node_graph_optimize (GPUNodeGraph *graph) |
| void | gpu_node_graph_free_nodes (GPUNodeGraph *graph) |
| void | gpu_node_graph_free (GPUNodeGraph *graph) |
| GPUNodeGraph * | gpu_material_node_graph (GPUMaterial *material) |
| blender::gpu::Texture ** | gpu_material_ramp_texture_row_set (GPUMaterial *mat, int size, const float *pixels, float *r_row) |
| blender::gpu::Texture ** | gpu_material_sky_texture_layer_set (GPUMaterial *mat, int width, int height, const float *pixels, float *row) |
Intermediate node graph for generating GLSL shaders.
Definition in file gpu_node_graph.hh.
| enum GPUDataSource |
Definition at line 23 of file gpu_node_graph.hh.
| enum GPUNodeLinkType |
Definition at line 37 of file gpu_node_graph.hh.
| enum GPUNodeTag |
| Enumerator | |
|---|---|
| GPU_NODE_TAG_NONE | |
| GPU_NODE_TAG_SURFACE | |
| GPU_NODE_TAG_VOLUME | |
| GPU_NODE_TAG_DISPLACEMENT | |
| GPU_NODE_TAG_THICKNESS | |
| GPU_NODE_TAG_AOV | |
| GPU_NODE_TAG_FUNCTION | |
| GPU_NODE_TAG_COMPOSITOR | |
Definition at line 53 of file gpu_node_graph.hh.
| GPUNodeGraph * gpu_material_node_graph | ( | GPUMaterial * | material | ) |
Definition at line 417 of file gpu/intern/gpu_material.cc.
References GPUMaterial::graph.
Referenced by GPU_attribute(), GPU_attribute_default_color(), GPU_attribute_hair_intercept(), GPU_attribute_hair_length(), GPU_color_band(), GPU_image(), GPU_image_sky(), GPU_image_tiled(), GPU_layer_attribute(), GPU_link(), gpu_stack_link_v(), GPU_stack_link_zone(), and GPU_uniform_attribute().
| blender::gpu::Texture ** gpu_material_ramp_texture_row_set | ( | GPUMaterial * | mat, |
| int | size, | ||
| const float * | pixels, | ||
| float * | r_row ) |
Returns the address of the future pointer to coba_tex.
Definition at line 453 of file gpu/intern/gpu_material.cc.
References BLI_assert, CM_TABLE, GPUMaterial::coba_builder, GPUMaterial::coba_tex, GPUColorBandBuilder::current_layer, float, MAX_COLOR_BAND, MEM_mallocN(), GPUColorBandBuilder::pixels, printf, size(), and UNUSED_VARS_NDEBUG.
Referenced by GPU_color_band().
| blender::gpu::Texture ** gpu_material_sky_texture_layer_set | ( | GPUMaterial * | mat, |
| int | width, | ||
| int | height, | ||
| const float * | pixels, | ||
| float * | row ) |
Returns the address of the future pointer to sky_tex
Definition at line 424 of file gpu/intern/gpu_material.cc.
References BLI_assert, GPUSkyBuilder::current_layer, float, GPU_SKY_HEIGHT, GPU_SKY_WIDTH, MAX_GPU_SKIES, MEM_mallocN(), GPUSkyBuilder::pixels, printf, GPUMaterial::sky_builder, GPUMaterial::sky_tex, and UNUSED_VARS_NDEBUG.
Referenced by GPU_image_sky().
| void gpu_node_graph_finalize_uniform_attrs | ( | GPUNodeGraph * | graph | ) |
Definition at line 333 of file gpu_node_graph.cc.
References BLI_assert, BLI_ghashutil_uinthash(), BLI_listbase_count(), BLI_listbase_sort(), GPUUniformAttrList::count, GPUUniformAttrList::hash_code, GPUUniformAttrList::list, LISTBASE_FOREACH, uniform_attr_sort_cmp(), and GPUNodeGraph::uniform_attrs.
Referenced by GPU_generate_pass().
| void gpu_node_graph_free | ( | GPUNodeGraph * | graph | ) |
Free both node graph and requested attributes and textures.
Definition at line 973 of file gpu_node_graph.cc.
References GPUNodeGraph::attributes, BLI_freelistN(), gpu_node_graph_free_nodes(), GPU_uniform_attr_list_free(), GPUNodeGraph::layer_attrs, GPUNodeGraph::material_functions, GPUNodeGraph::outlink_aovs, GPUNodeGraph::outlink_compositor, GPUNodeGraph::textures, and GPUNodeGraph::uniform_attrs.
Referenced by GPUMaterial::~GPUMaterial().
| void gpu_node_graph_free_nodes | ( | GPUNodeGraph * | graph | ) |
Free intermediate node graph.
Definition at line 961 of file gpu_node_graph.cc.
References BLI_pophead(), gpu_node_free(), GPUNodeGraph::nodes, GPUNodeGraph::outlink_displacement, GPUNodeGraph::outlink_surface, GPUNodeGraph::outlink_thickness, and GPUNodeGraph::outlink_volume.
Referenced by GPU_material_from_callbacks(), GPU_material_from_nodetree(), and gpu_node_graph_free().
| void gpu_node_graph_optimize | ( | GPUNodeGraph * | graph | ) |
Optimize node graph for optimized material shader path. Once the base material has been generated, we can modify the shader node graph to create one which will produce an optimally performing shader. This currently involves baking uniform data into constant data to enable aggressive constant folding by the compiler in order to reduce complexity and shader core memory pressure.
NOTE: Graph optimizations will produce a shader which needs to be re-compiled more frequently, however, the default material pass will always exist to fall back on.
Definition at line 1099 of file gpu_node_graph.cc.
References GPU_CLOSURE, GPU_NODE_LINK_CONSTANT, GPU_NODE_LINK_UNIFORM, GPU_SOURCE_CONSTANT, GPU_SOURCE_STRUCT, GPU_SOURCE_UNIFORM, input, LISTBASE_FOREACH, and GPUNodeGraph::nodes.
Referenced by GPU_generate_pass().
| void gpu_node_graph_prune_unused | ( | GPUNodeGraph * | graph | ) |
Definition at line 1029 of file gpu_node_graph.cc.
References GPUNodeGraph::attributes, BLI_freelinkN(), BLI_remlink(), GPUUniformAttrList::count, ListBase::first, gpu_node_free(), GPU_NODE_TAG_AOV, GPU_NODE_TAG_COMPOSITOR, GPU_NODE_TAG_DISPLACEMENT, GPU_NODE_TAG_FUNCTION, GPU_NODE_TAG_NONE, GPU_NODE_TAG_SURFACE, GPU_NODE_TAG_THICKNESS, GPU_NODE_TAG_VOLUME, gpu_nodes_tag(), GPUNodeGraph::layer_attrs, GPUUniformAttrList::list, LISTBASE_FOREACH, LISTBASE_FOREACH_MUTABLE, GPUNodeGraph::material_functions, next, GPUNodeGraph::nodes, GPUNodeGraph::outlink_aovs, GPUNodeGraph::outlink_compositor, GPUNodeGraph::outlink_displacement, GPUNodeGraph::outlink_surface, GPUNodeGraph::outlink_thickness, GPUNodeGraph::outlink_volume, GPUNodeGraph::textures, and GPUNodeGraph::uniform_attrs.
Referenced by GPU_generate_pass().
| void gpu_nodes_tag | ( | GPUNodeGraph * | graph, |
| GPUNodeLink * | link_start, | ||
| GPUNodeTag | tag ) |
Definition at line 988 of file gpu_node_graph.cc.
References input, GPUNode::inputs, blender::Stack< T, InlineBufferCapacity, Allocator >::is_empty(), GPUNode::is_zone_end, LISTBASE_FOREACH, GPUOutput::node, GPUNodeGraph::nodes, GPUNodeLink::output, blender::Stack< T, InlineBufferCapacity, Allocator >::pop(), blender::Stack< T, InlineBufferCapacity, Allocator >::push(), GPUNode::tag, and GPUNode::zone_index.
Referenced by blender::gpu::shader::GPUCodegen::generate_graphs(), and gpu_node_graph_prune_unused().