Blender V4.3
gpu_node_graph.cc File Reference
#include <cstdio>
#include <cstring>
#include "MEM_guardedalloc.h"
#include "DNA_node_types.h"
#include "BLI_ghash.h"
#include "BLI_listbase.h"
#include "BLI_string.h"
#include "BLI_utildefines.h"
#include "GPU_texture.hh"
#include "GPU_vertex_format.hh"
#include "gpu_material_library.hh"
#include "gpu_node_graph.hh"

Go to the source code of this file.

Functions

static GPUNodeLinkgpu_node_link_create ()
 
static void gpu_node_link_free (GPUNodeLink *link)
 
static GPUNodegpu_node_create (const char *name)
 
static void gpu_node_input_link (GPUNode *node, GPUNodeLink *link, const eGPUType type)
 
static const char * gpu_uniform_set_function_from_type (eNodeSocketDatatype type)
 
static GPUNodeLinkgpu_uniformbuffer_link (GPUMaterial *mat, const bNode *node, GPUNodeStack *stack, const int index, const eNodeSocketInOut in_out)
 
static void gpu_node_input_socket (GPUMaterial *material, const bNode *bnode, GPUNode *node, GPUNodeStack *sock, const int index)
 
static void gpu_node_output (GPUNode *node, const eGPUType type, GPUNodeLink **link)
 
static int uniform_attr_sort_cmp (const void *a, const void *b)
 
static uint uniform_attr_list_hash (const void *key)
 
static bool uniform_attr_list_cmp (const void *a, const void *b)
 
GHashGPU_uniform_attr_list_hash_new (const char *info)
 
void GPU_uniform_attr_list_copy (GPUUniformAttrList *dest, const GPUUniformAttrList *src)
 
void GPU_uniform_attr_list_free (GPUUniformAttrList *set)
 
void gpu_node_graph_finalize_uniform_attrs (GPUNodeGraph *graph)
 
static char attr_prefix_get (const GPUMaterialAttribute *attr)
 
static void attr_input_name (GPUMaterialAttribute *attr)
 
static GPUMaterialAttributegpu_node_graph_add_attribute (GPUNodeGraph *graph, eCustomDataType type, const char *name, const bool is_default_color, const bool is_hair_length)
 
static GPUUniformAttrgpu_node_graph_add_uniform_attribute (GPUNodeGraph *graph, const char *name, bool use_dupli)
 
static GPULayerAttrgpu_node_graph_add_layer_attribute (GPUNodeGraph *graph, const char *name)
 
static GPUMaterialTexturegpu_node_graph_add_texture (GPUNodeGraph *graph, Image *ima, ImageUser *iuser, GPUTexture **colorband, GPUTexture **sky, bool is_tiled, GPUSamplerState sampler_state)
 
GPUNodeLinkGPU_attribute (GPUMaterial *mat, const eCustomDataType type, const char *name)
 
GPUNodeLinkGPU_attribute_default_color (GPUMaterial *mat)
 
GPUNodeLinkGPU_attribute_hair_length (GPUMaterial *mat)
 
GPUNodeLinkGPU_attribute_with_default (GPUMaterial *mat, const eCustomDataType type, const char *name, eGPUDefaultValue default_value)
 
GPUNodeLinkGPU_uniform_attribute (GPUMaterial *mat, const char *name, bool use_dupli, uint32_t *r_hash)
 
GPUNodeLinkGPU_layer_attribute (GPUMaterial *mat, const char *name)
 
GPUNodeLinkGPU_constant (const float *num)
 
GPUNodeLinkGPU_uniform (const float *num)
 
GPUNodeLinkGPU_differentiate_float_function (const char *function_name)
 
GPUNodeLinkGPU_image (GPUMaterial *mat, Image *ima, ImageUser *iuser, GPUSamplerState sampler_state)
 
GPUNodeLinkGPU_image_sky (GPUMaterial *mat, int width, int height, const float *pixels, float *layer, GPUSamplerState sampler_state)
 
void GPU_image_tiled (GPUMaterial *mat, Image *ima, ImageUser *iuser, GPUSamplerState sampler_state, GPUNodeLink **r_image_tiled_link, GPUNodeLink **r_image_tiled_mapping_link)
 
GPUNodeLinkGPU_color_band (GPUMaterial *mat, int size, float *pixels, float *r_row)
 
bool GPU_link (GPUMaterial *mat, const char *name,...)
 
static bool gpu_stack_link_v (GPUMaterial *material, const bNode *bnode, const char *name, GPUNodeStack *in, GPUNodeStack *out, va_list params)
 
bool GPU_stack_link (GPUMaterial *material, const bNode *bnode, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
 
static void gpu_inputs_free (ListBase *inputs)
 
static void gpu_node_free (GPUNode *node)
 
void gpu_node_graph_free_nodes (GPUNodeGraph *graph)
 
void gpu_node_graph_free (GPUNodeGraph *graph)
 
void gpu_nodes_tag (GPUNodeLink *link, eGPUNodeTag tag)
 
void gpu_node_graph_prune_unused (GPUNodeGraph *graph)
 
void gpu_node_graph_optimize (GPUNodeGraph *graph)
 

Detailed Description

Intermediate node graph for generating GLSL shaders.

Definition in file gpu_node_graph.cc.

Function Documentation

◆ attr_input_name()

◆ attr_prefix_get()

◆ GPU_attribute()

◆ GPU_attribute_default_color()

GPUNodeLink * GPU_attribute_default_color ( GPUMaterial * mat)

Add a GPU attribute that refers to the default color attribute on a geometry. The name, type, and domain are unknown and do not depend on the material.

Definition at line 549 of file gpu_node_graph.cc.

References GPUNodeLink::attr, CD_AUTO_FROM_NAME, GPU_constant(), gpu_material_node_graph(), GPU_MAX_CONSTANT_DATA, gpu_node_graph_add_attribute(), GPU_NODE_LINK_ATTR, gpu_node_link_create(), GPUMaterialAttribute::is_default_color, and GPUNodeLink::link_type.

Referenced by blender::nodes::node_shader_vertex_color_cc::node_shader_gpu_vertex_color().

◆ GPU_attribute_hair_length()

◆ GPU_attribute_with_default()

◆ GPU_color_band()

◆ GPU_constant()

GPUNodeLink * GPU_constant ( const float * num)

Definition at line 625 of file gpu_node_graph.cc.

References GPUNodeLink::data, GPU_NODE_LINK_CONSTANT, gpu_node_link_create(), and GPUNodeLink::link_type.

Referenced by blender::nodes::node_composite_brightness_cc::BrightContrastShaderNode::compile(), blender::nodes::node_composite_channel_matte_cc::ChannelMatteShaderNode::compile(), blender::nodes::node_composite_color_ramp_cc::ColorRampShaderNode::compile(), blender::nodes::node_composite_color_spill_cc::ColorSpillShaderNode::compile(), blender::nodes::node_composite_colorcorrection_cc::ColorCorrectionShaderNode::compile(), blender::nodes::node_composite_huecorrect_cc::HueCorrectShaderNode::compile(), blender::nodes::node_composite_invert_cc::InvertShaderNode::compile(), blender::nodes::node_composite_luma_matte_cc::LuminanceMatteShaderNode::compile(), blender::nodes::node_composite_map_range_cc::MapRangeShaderNode::compile(), blender::nodes::node_composite_map_value_cc::MapValueShaderNode::compile(), blender::nodes::node_composite_math_cc::MathShaderNode::compile(), blender::nodes::node_composite_mixrgb_cc::MixRGBShaderNode::compile(), blender::nodes::node_composite_rgb_curves_cc::RGBCurvesShaderNode::compile(), blender::nodes::node_composite_rgb_to_bw_cc::RGBToBWShaderNode::compile(), blender::nodes::node_composite_vector_curves_cc::VectorCurvesShaderNode::compile(), GPU_attribute(), GPU_attribute_default_color(), GPU_attribute_hair_length(), gpu_node_input_socket(), blender::nodes::node_shader_bump_cc::gpu_shader_bump(), blender::nodes::node_shader_curves_cc::flt::gpu_shader_curve_float(), blender::nodes::node_shader_curves_cc::rgb::gpu_shader_curve_rgb(), blender::nodes::node_shader_curves_cc::vec::gpu_shader_curve_vec(), blender::nodes::node_shader_map_range_cc::gpu_shader_map_range(), blender::nodes::node_shader_math_cc::gpu_shader_math(), blender::nodes::node_sh_mix_cc::gpu_shader_mix(), blender::nodes::node_shader_mix_rgb_cc::gpu_shader_mix_rgb(), blender::nodes::node_shader_normal_map_cc::gpu_shader_normal_map(), blender::nodes::node_shader_color_ramp_cc::gpu_shader_valtorgb(), blender::nodes::node_shader_vector_transform_cc::gpu_shader_vect_transform(), blender::nodes::node_shader_vector_rotate_cc::gpu_shader_vector_rotate(), GPU_uniform_attribute(), blender::nodes::node_shader_ambient_occlusion_cc::node_shader_gpu_ambient_occlusion(), blender::nodes::node_shader_attribute_cc::node_shader_gpu_attribute(), blender::nodes::node_shader_blackbody_cc::node_shader_gpu_blackbody(), blender::nodes::node_shader_bsdf_glass_cc::node_shader_gpu_bsdf_glass(), blender::nodes::node_shader_bsdf_glossy_cc::node_shader_gpu_bsdf_glossy(), blender::nodes::node_shader_bsdf_metallic_cc::node_shader_gpu_bsdf_metallic(), blender::nodes::node_shader_bsdf_principled_cc::node_shader_gpu_bsdf_principled(), blender::nodes::node_shader_eevee_specular_cc::node_shader_gpu_eevee_specular(), blender::nodes::node_shader_geometry_cc::node_shader_gpu_geometry(), blender::nodes::node_shader_hair_info_cc::node_shader_gpu_hair_info(), blender::nodes::node_shader_object_info_cc::node_shader_gpu_object_info(), blender::nodes::node_shader_output_aov_cc::node_shader_gpu_output_aov(), blender::nodes::node_shader_subsurface_scattering_cc::node_shader_gpu_subsurface_scattering(), blender::nodes::node_shader_tex_brick_cc::node_shader_gpu_tex_brick(), blender::nodes::node_shader_tex_coord_cc::node_shader_gpu_tex_coord(), blender::nodes::node_shader_tex_gabor_cc::node_shader_gpu_tex_gabor(), blender::nodes::node_shader_tex_gradient_cc::node_shader_gpu_tex_gradient(), blender::nodes::node_shader_tex_magic_cc::node_shader_gpu_tex_magic(), blender::nodes::node_shader_tex_noise_cc::node_shader_gpu_tex_noise(), blender::nodes::node_shader_tex_sky_cc::node_shader_gpu_tex_sky(), blender::nodes::node_shader_tex_voronoi_cc::node_shader_gpu_tex_voronoi(), blender::nodes::node_shader_tex_wave_cc::node_shader_gpu_tex_wave(), blender::nodes::node_shader_volume_principled_cc::node_shader_gpu_volume_principled(), and blender::nodes::node_shader_wavelength_cc::node_shader_gpu_wavelength().

◆ GPU_differentiate_float_function()

GPUNodeLink * GPU_differentiate_float_function ( const char * function_name)

Create an implementation defined differential calculation of a float function. The given function should return a float. The result will be a vec2 containing dFdx and dFdy result of that function.

Definition at line 641 of file gpu_node_graph.cc.

References GPUNodeLink::function_name, gpu_node_link_create(), GPU_NODE_LINK_DIFFERENTIATE_FLOAT_FN, and GPUNodeLink::link_type.

Referenced by blender::nodes::node_shader_bump_cc::gpu_shader_bump().

◆ GPU_image()

◆ GPU_image_sky()

◆ GPU_image_tiled()

void GPU_image_tiled ( GPUMaterial * mat,
Image * ima,
ImageUser * iuser,
GPUSamplerState sampler_state,
GPUNodeLink ** r_image_tiled_link,
GPUNodeLink ** r_image_tiled_mapping_link )

◆ gpu_inputs_free()

◆ GPU_layer_attribute()

◆ GPU_link()

bool GPU_link ( GPUMaterial * mat,
const char * name,
... )

Definition at line 714 of file gpu_node_graph.cc.

References BLI_addtail(), FUNCTION_QUAL_OUT, gpu_material_library_use_function(), gpu_material_node_graph(), gpu_node_create(), gpu_node_input_link(), gpu_node_output(), node, and params.

Referenced by blender::nodes::node_shader_volume_principled_cc::attribute_post_process(), blender::nodes::node_composite_math_cc::MathShaderNode::compile(), blender::nodes::node_composite_mixrgb_cc::MixRGBShaderNode::compile(), blender::nodes::node_composite_rgb_curves_cc::RGBCurvesShaderNode::compile(), GPU_material_split_sub_function(), blender::nodes::node_shader_bevel_cc::gpu_shader_bevel(), blender::nodes::node_shader_bump_cc::gpu_shader_bump(), blender::nodes::node_shader_displacement_cc::gpu_shader_displacement(), blender::nodes::node_shader_map_range_cc::gpu_shader_map_range(), blender::nodes::node_shader_math_cc::gpu_shader_math(), blender::nodes::node_sh_mix_cc::gpu_shader_mix(), blender::nodes::node_shader_mix_rgb_cc::gpu_shader_mix_rgb(), blender::nodes::node_shader_normal_map_cc::gpu_shader_normal_map(), blender::nodes::node_shader_rgb_cc::gpu_shader_rgb(), blender::nodes::node_shader_value_cc::gpu_shader_value(), blender::nodes::node_shader_vector_transform_cc::gpu_shader_vect_transform(), gpu_uniformbuffer_link(), blender::nodes::node_shader_ambient_occlusion_cc::node_shader_gpu_ambient_occlusion(), blender::nodes::node_shader_attribute_cc::node_shader_gpu_attribute(), blender::nodes::node_shader_bsdf_diffuse_cc::node_shader_gpu_bsdf_diffuse(), blender::nodes::node_shader_bsdf_glass_cc::node_shader_gpu_bsdf_glass(), blender::nodes::node_shader_bsdf_glossy_cc::node_shader_gpu_bsdf_glossy(), blender::nodes::node_shader_bsdf_metallic_cc::node_shader_gpu_bsdf_metallic(), blender::nodes::node_shader_bsdf_principled_cc::node_shader_gpu_bsdf_principled(), blender::nodes::node_shader_bsdf_refraction_cc::node_shader_gpu_bsdf_refraction(), blender::nodes::node_shader_bsdf_sheen_cc::node_shader_gpu_bsdf_sheen(), blender::nodes::node_shader_bsdf_toon_cc::node_shader_gpu_bsdf_toon(), blender::nodes::node_shader_bsdf_translucent_cc::node_shader_gpu_bsdf_translucent(), node_shader_gpu_bump_tex_coord(), blender::nodes::node_shader_eevee_specular_cc::node_shader_gpu_eevee_specular(), blender::nodes::node_shader_fresnel_cc::node_shader_gpu_fresnel(), blender::nodes::node_shader_geometry_cc::node_shader_gpu_geometry(), blender::nodes::node_shader_layer_weight_cc::node_shader_gpu_layer_weight(), blender::nodes::node_shader_output_light_cc::node_shader_gpu_output_light(), blender::nodes::node_shader_output_material_cc::node_shader_gpu_output_material(), blender::nodes::node_shader_output_world_cc::node_shader_gpu_output_world(), blender::nodes::node_shader_subsurface_scattering_cc::node_shader_gpu_subsurface_scattering(), blender::nodes::node_shader_tangent_cc::node_shader_gpu_tangent(), blender::nodes::node_shader_tex_coord_cc::node_shader_gpu_tex_coord(), blender::nodes::node_shader_tex_environment_cc::node_shader_gpu_tex_environment(), blender::nodes::node_shader_tex_image_cc::node_shader_gpu_tex_image(), node_shader_gpu_tex_mapping(), and blender::nodes::node_shader_volume_info_cc::node_shader_gpu_volume_info().

◆ gpu_node_create()

static GPUNode * gpu_node_create ( const char * name)
static

Definition at line 57 of file gpu_node_graph.cc.

References node.

Referenced by GPU_link(), and gpu_stack_link_v().

◆ gpu_node_free()

static void gpu_node_free ( GPUNode * node)
static

◆ gpu_node_graph_add_attribute()

static GPUMaterialAttribute * gpu_node_graph_add_attribute ( GPUNodeGraph * graph,
eCustomDataType type,
const char * name,
const bool is_default_color,
const bool is_hair_length )
static

◆ gpu_node_graph_add_layer_attribute()

static GPULayerAttr * gpu_node_graph_add_layer_attribute ( GPUNodeGraph * graph,
const char * name )
static

Add a new uniform attribute of given type and name. Returns nullptr if out of slots.

Definition at line 455 of file gpu_node_graph.cc.

References BLI_addtail(), BLI_ghashutil_strhash_p(), ListBase::first, GPULayerAttr::hash_code, GPULayerAttr::name, GPULayerAttr::next, STREQ, STRNCPY, and GPULayerAttr::users.

Referenced by GPU_layer_attribute().

◆ gpu_node_graph_add_texture()

static GPUMaterialTexture * gpu_node_graph_add_texture ( GPUNodeGraph * graph,
Image * ima,
ImageUser * iuser,
GPUTexture ** colorband,
GPUTexture ** sky,
bool is_tiled,
GPUSamplerState sampler_state )
static

Definition at line 482 of file gpu_node_graph.cc.

References BLI_addtail(), Tex::ima, Tex::iuser, SNPRINTF, and tex.

Referenced by GPU_color_band(), GPU_image(), GPU_image_sky(), and GPU_image_tiled().

◆ gpu_node_graph_add_uniform_attribute()

static GPUUniformAttr * gpu_node_graph_add_uniform_attribute ( GPUNodeGraph * graph,
const char * name,
bool use_dupli )
static

◆ gpu_node_graph_finalize_uniform_attrs()

◆ gpu_node_graph_free()

void gpu_node_graph_free ( GPUNodeGraph * graph)

◆ gpu_node_graph_free_nodes()

void gpu_node_graph_free_nodes ( GPUNodeGraph * graph)

◆ gpu_node_graph_optimize()

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 1006 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, and LISTBASE_FOREACH.

Referenced by GPU_generate_pass().

◆ gpu_node_graph_prune_unused()

◆ gpu_node_input_link()

◆ gpu_node_input_socket()

static void gpu_node_input_socket ( GPUMaterial * material,
const bNode * bnode,
GPUNode * node,
GPUNodeStack * sock,
const int index )
static

◆ gpu_node_link_create()

◆ gpu_node_link_free()

static void gpu_node_link_free ( GPUNodeLink * link)
static

Definition at line 39 of file gpu_node_graph.cc.

References GPUOutput::link, MEM_freeN(), GPUNodeLink::output, and GPUNodeLink::users.

Referenced by gpu_inputs_free(), and gpu_node_free().

◆ gpu_node_output()

static void gpu_node_output ( GPUNode * node,
const eGPUType type,
GPUNodeLink ** link )
static

Definition at line 246 of file gpu_node_graph.cc.

References BLI_addtail(), gpu_node_link_create(), GPU_NODE_LINK_OUTPUT, node, and output.

Referenced by GPU_link(), and gpu_stack_link_v().

◆ gpu_nodes_tag()

◆ GPU_stack_link()

bool GPU_stack_link ( GPUMaterial * material,
const bNode * bnode,
const char * name,
GPUNodeStack * in,
GPUNodeStack * out,
... )

Definition at line 821 of file gpu_node_graph.cc.

References gpu_stack_link_v(), and params.

Referenced by blender::nodes::node_composite_alpha_over_cc::AlphaOverShaderNode::compile(), blender::nodes::node_composite_brightness_cc::BrightContrastShaderNode::compile(), blender::nodes::node_composite_channel_matte_cc::ChannelMatteShaderNode::compile(), blender::nodes::node_composite_chroma_matte_cc::ChromaMatteShaderNode::compile(), blender::nodes::node_composite_color_matte_cc::ColorMatteShaderNode::compile(), blender::nodes::node_composite_color_ramp_cc::ColorRampShaderNode::compile(), blender::nodes::node_composite_color_spill_cc::ColorSpillShaderNode::compile(), blender::nodes::node_composite_colorbalance_cc::ColorBalanceShaderNode::compile(), blender::nodes::node_composite_colorcorrection_cc::ColorCorrectionShaderNode::compile(), blender::nodes::node_composite_combine_color_cc::CombineColorShaderNode::compile(), blender::nodes::node_composite_combine_hsva_cc::CombineHSVAShaderNode::compile(), blender::nodes::node_composite_combine_rgba_cc::CombineRGBAShaderNode::compile(), blender::nodes::node_composite_combine_xyz_cc::CombineXYZShaderNode::compile(), blender::nodes::node_composite_combine_ycca_cc::CombineYCCAShaderNode::compile(), blender::nodes::node_composite_combine_yuva_cc::CombineYUVAShaderNode::compile(), blender::nodes::node_composite_diff_matte_cc::DifferenceMatteShaderNode::compile(), blender::nodes::node_composite_distance_matte_cc::DistanceMatteShaderNode::compile(), blender::nodes::node_composite_exposure_cc::ExposureShaderNode::compile(), blender::nodes::node_composite_gamma_cc::GammaShaderNode::compile(), blender::nodes::node_composite_hue_sat_val_cc::HueSaturationValueShaderNode::compile(), blender::nodes::node_composite_huecorrect_cc::HueCorrectShaderNode::compile(), blender::nodes::node_composite_invert_cc::InvertShaderNode::compile(), blender::nodes::node_composite_luma_matte_cc::LuminanceMatteShaderNode::compile(), blender::nodes::node_composite_map_range_cc::MapRangeShaderNode::compile(), blender::nodes::node_composite_map_value_cc::MapValueShaderNode::compile(), blender::nodes::node_composite_math_cc::MathShaderNode::compile(), blender::nodes::node_composite_mixrgb_cc::MixRGBShaderNode::compile(), blender::nodes::node_composite_normal_cc::NormalShaderNode::compile(), blender::nodes::node_composite_posterize_cc::PosterizeShaderNode::compile(), blender::nodes::node_composite_premulkey_cc::AlphaConvertShaderNode::compile(), blender::nodes::node_composite_rgb_curves_cc::RGBCurvesShaderNode::compile(), blender::nodes::node_composite_rgb_to_bw_cc::RGBToBWShaderNode::compile(), blender::nodes::node_composite_separate_color_cc::SeparateColorShaderNode::compile(), blender::nodes::node_composite_separate_hsva_cc::SeparateHSVAShaderNode::compile(), blender::nodes::node_composite_separate_rgba_cc::SeparateRGBAShaderNode::compile(), blender::nodes::node_composite_separate_xyz_cc::SeparateXYZShaderNode::compile(), blender::nodes::node_composite_separate_ycca_cc::SeparateYCCAShaderNode::compile(), blender::nodes::node_composite_separate_yuva_cc::SeparateYUVAShaderNode::compile(), blender::nodes::node_composite_setalpha_cc::SetAlphaShaderNode::compile(), blender::nodes::node_composite_vector_curves_cc::VectorCurvesShaderNode::compile(), blender::nodes::node_shader_bevel_cc::gpu_shader_bevel(), blender::nodes::node_shader_brightness_cc::gpu_shader_brightcontrast(), blender::nodes::node_shader_bump_cc::gpu_shader_bump(), blender::nodes::node_shader_camera_cc::gpu_shader_camera(), blender::nodes::node_shader_clamp_cc::gpu_shader_clamp(), blender::nodes::node_shader_combine_color_cc::gpu_shader_combcolor(), blender::nodes::node_shader_sepcomb_hsv_cc::gpu_shader_combhsv(), blender::nodes::node_shader_sepcomb_rgb_cc::gpu_shader_combrgb(), blender::nodes::node_shader_sepcomb_xyz_cc::comb::gpu_shader_combxyz(), blender::nodes::node_shader_curves_cc::flt::gpu_shader_curve_float(), blender::nodes::node_shader_curves_cc::rgb::gpu_shader_curve_rgb(), blender::nodes::node_shader_curves_cc::vec::gpu_shader_curve_vec(), blender::nodes::node_shader_displacement_cc::gpu_shader_displacement(), blender::nodes::node_shader_hueSatVal_cc::gpu_shader_hue_sat(), blender::nodes::node_shader_invert_cc::gpu_shader_invert(), blender::nodes::node_shader_map_range_cc::gpu_shader_map_range(), blender::nodes::node_shader_mapping_cc::gpu_shader_mapping(), blender::nodes::node_shader_math_cc::gpu_shader_math(), blender::nodes::node_sh_mix_cc::gpu_shader_mix(), blender::nodes::node_shader_mix_rgb_cc::gpu_shader_mix_rgb(), blender::nodes::node_shader_normal_cc::gpu_shader_normal(), blender::nodes::node_shader_particle_info_cc::gpu_shader_particle_info(), blender::nodes::node_shader_holdout_cc::gpu_shader_rgb(), blender::nodes::node_shader_rgb_to_bw_cc::gpu_shader_rgbtobw(), blender::nodes::node_shader_separate_color_cc::gpu_shader_sepcolor(), blender::nodes::node_shader_sepcomb_hsv_cc::gpu_shader_sephsv(), blender::nodes::node_shader_sepcomb_rgb_cc::gpu_shader_seprgb(), blender::nodes::node_shader_sepcomb_xyz_cc::sep::gpu_shader_sepxyz(), blender::nodes::node_shader_squeeze_cc::gpu_shader_squeeze(), blender::nodes::node_shader_tex_white_noise_cc::gpu_shader_tex_white_noise(), blender::nodes::node_shader_color_ramp_cc::gpu_shader_valtorgb(), blender::nodes::node_shader_vector_displacement_cc::gpu_shader_vector_displacement(), blender::nodes::node_shader_vector_math_cc::gpu_shader_vector_math(), blender::nodes::node_shader_vector_rotate_cc::gpu_shader_vector_rotate(), blender::nodes::node_shader_add_shader_cc::node_shader_gpu_add_shader(), blender::nodes::node_shader_ambient_occlusion_cc::node_shader_gpu_ambient_occlusion(), blender::nodes::node_shader_attribute_cc::node_shader_gpu_attribute(), blender::nodes::node_shader_background_cc::node_shader_gpu_background(), blender::nodes::node_shader_blackbody_cc::node_shader_gpu_blackbody(), blender::nodes::node_shader_bsdf_diffuse_cc::node_shader_gpu_bsdf_diffuse(), blender::nodes::node_shader_bsdf_glass_cc::node_shader_gpu_bsdf_glass(), blender::nodes::node_shader_bsdf_glossy_cc::node_shader_gpu_bsdf_glossy(), blender::nodes::node_shader_bsdf_hair_cc::node_shader_gpu_bsdf_hair(), blender::nodes::node_shader_bsdf_metallic_cc::node_shader_gpu_bsdf_metallic(), blender::nodes::node_shader_bsdf_principled_cc::node_shader_gpu_bsdf_principled(), blender::nodes::node_shader_bsdf_ray_portal_cc::node_shader_gpu_bsdf_ray_portal(), blender::nodes::node_shader_bsdf_refraction_cc::node_shader_gpu_bsdf_refraction(), blender::nodes::node_shader_bsdf_sheen_cc::node_shader_gpu_bsdf_sheen(), blender::nodes::node_shader_bsdf_toon_cc::node_shader_gpu_bsdf_toon(), blender::nodes::node_shader_bsdf_translucent_cc::node_shader_gpu_bsdf_translucent(), blender::nodes::node_shader_bsdf_transparent_cc::node_shader_gpu_bsdf_transparent(), blender::nodes::node_shader_eevee_specular_cc::node_shader_gpu_eevee_specular(), blender::nodes::node_shader_emission_cc::node_shader_gpu_emission(), blender::nodes::node_shader_fresnel_cc::node_shader_gpu_fresnel(), blender::nodes::node_shader_gamma_cc::node_shader_gpu_gamma(), blender::nodes::node_shader_geometry_cc::node_shader_gpu_geometry(), blender::nodes::node_shader_hair_info_cc::node_shader_gpu_hair_info(), blender::nodes::node_shader_bsdf_hair_principled_cc::node_shader_gpu_hair_principled(), blender::nodes::node_shader_layer_weight_cc::node_shader_gpu_layer_weight(), blender::nodes::node_shader_light_falloff_cc::node_shader_gpu_light_falloff(), blender::nodes::node_shader_light_path_cc::node_shader_gpu_light_path(), blender::nodes::node_shader_mix_shader_cc::node_shader_gpu_mix_shader(), blender::nodes::node_shader_object_info_cc::node_shader_gpu_object_info(), blender::nodes::node_shader_output_aov_cc::node_shader_gpu_output_aov(), blender::nodes::node_shader_point_info_cc::node_shader_gpu_point_info(), blender::nodes::node_shader_shader_to_rgb_cc::node_shader_gpu_shadertorgb(), blender::nodes::node_shader_subsurface_scattering_cc::node_shader_gpu_subsurface_scattering(), blender::nodes::node_shader_tangent_cc::node_shader_gpu_tangent(), blender::nodes::node_shader_tex_brick_cc::node_shader_gpu_tex_brick(), blender::nodes::node_shader_tex_checker_cc::node_shader_gpu_tex_checker(), blender::nodes::node_shader_tex_coord_cc::node_shader_gpu_tex_coord(), blender::nodes::node_shader_tex_environment_cc::node_shader_gpu_tex_environment(), blender::nodes::node_shader_tex_gabor_cc::node_shader_gpu_tex_gabor(), blender::nodes::node_shader_tex_gradient_cc::node_shader_gpu_tex_gradient(), blender::nodes::node_shader_tex_image_cc::node_shader_gpu_tex_image(), blender::nodes::node_shader_tex_magic_cc::node_shader_gpu_tex_magic(), blender::nodes::node_shader_tex_noise_cc::node_shader_gpu_tex_noise(), blender::nodes::node_shader_tex_sky_cc::node_shader_gpu_tex_sky(), blender::nodes::node_shader_tex_voronoi_cc::node_shader_gpu_tex_voronoi(), blender::nodes::node_shader_tex_wave_cc::node_shader_gpu_tex_wave(), blender::nodes::node_shader_uvmap_cc::node_shader_gpu_uvmap(), blender::nodes::node_shader_vertex_color_cc::node_shader_gpu_vertex_color(), blender::nodes::node_shader_volume_absorption_cc::node_shader_gpu_volume_absorption(), blender::nodes::node_shader_volume_principled_cc::node_shader_gpu_volume_principled(), blender::nodes::node_shader_volume_scatter_cc::node_shader_gpu_volume_scatter(), blender::nodes::node_shader_wavelength_cc::node_shader_gpu_wavelength(), and blender::nodes::node_shader_wireframe_cc::node_shader_gpu_wireframe().

◆ gpu_stack_link_v()

static bool gpu_stack_link_v ( GPUMaterial * material,
const bNode * bnode,
const char * name,
GPUNodeStack * in,
GPUNodeStack * out,
va_list params )
static

◆ GPU_uniform()

GPUNodeLink * GPU_uniform ( const float * num)

Definition at line 633 of file gpu_node_graph.cc.

References GPUNodeLink::data, gpu_node_link_create(), GPU_NODE_LINK_UNIFORM, and GPUNodeLink::link_type.

Referenced by blender::nodes::node_composite_alpha_over_cc::AlphaOverShaderNode::compile(), blender::nodes::node_composite_channel_matte_cc::ChannelMatteShaderNode::compile(), blender::nodes::node_composite_chroma_matte_cc::ChromaMatteShaderNode::compile(), blender::nodes::node_composite_color_matte_cc::ColorMatteShaderNode::compile(), blender::nodes::node_composite_color_ramp_cc::ColorRampShaderNode::compile(), blender::nodes::node_composite_color_spill_cc::ColorSpillShaderNode::compile(), blender::nodes::node_composite_colorbalance_cc::ColorBalanceShaderNode::compile(), blender::nodes::node_composite_colorcorrection_cc::ColorCorrectionShaderNode::compile(), blender::nodes::node_composite_diff_matte_cc::DifferenceMatteShaderNode::compile(), blender::nodes::node_composite_distance_matte_cc::DistanceMatteShaderNode::compile(), blender::nodes::node_composite_huecorrect_cc::HueCorrectShaderNode::compile(), blender::nodes::node_composite_luma_matte_cc::LuminanceMatteShaderNode::compile(), blender::nodes::node_composite_map_value_cc::MapValueShaderNode::compile(), blender::nodes::node_composite_normal_cc::NormalShaderNode::compile(), blender::nodes::node_composite_rgb_curves_cc::RGBCurvesShaderNode::compile(), blender::nodes::node_composite_vector_curves_cc::VectorCurvesShaderNode::compile(), blender::realtime_compositor::ShaderNode::get_input_link(), blender::nodes::node_shader_curves_cc::flt::gpu_shader_curve_float(), blender::nodes::node_shader_curves_cc::rgb::gpu_shader_curve_rgb(), blender::nodes::node_shader_curves_cc::vec::gpu_shader_curve_vec(), blender::nodes::node_sh_mix_cc::gpu_shader_mix(), blender::nodes::node_shader_mix_rgb_cc::gpu_shader_mix_rgb(), blender::nodes::node_shader_normal_cc::gpu_shader_normal(), blender::nodes::node_shader_normal_map_cc::gpu_shader_normal_map(), blender::nodes::node_shader_rgb_cc::gpu_shader_rgb(), blender::nodes::node_shader_color_ramp_cc::gpu_shader_valtorgb(), blender::nodes::node_shader_value_cc::gpu_shader_value(), gpu_uniformbuffer_link(), blender::nodes::node_shader_tex_brick_cc::node_shader_gpu_tex_brick(), blender::nodes::node_shader_tex_coord_cc::node_shader_gpu_tex_coord(), blender::nodes::node_shader_tex_image_cc::node_shader_gpu_tex_image(), node_shader_gpu_tex_mapping(), and blender::nodes::node_shader_tex_sky_cc::node_shader_gpu_tex_sky().

◆ GPU_uniform_attr_list_copy()

void GPU_uniform_attr_list_copy ( GPUUniformAttrList * dest,
const GPUUniformAttrList * src )

◆ GPU_uniform_attr_list_free()

void GPU_uniform_attr_list_free ( GPUUniformAttrList * set)

Definition at line 320 of file gpu_node_graph.cc.

References BLI_freelistN().

Referenced by drw_uniform_attrs_pool_free_cb(), and gpu_node_graph_free().

◆ GPU_uniform_attr_list_hash_new()

GHash * GPU_uniform_attr_list_hash_new ( const char * info)

◆ GPU_uniform_attribute()

◆ gpu_uniform_set_function_from_type()

static const char * gpu_uniform_set_function_from_type ( eNodeSocketDatatype type)
static

Definition at line 170 of file gpu_node_graph.cc.

References BLI_assert_msg, SOCK_BOOLEAN, SOCK_FLOAT, SOCK_INT, SOCK_RGBA, and SOCK_VECTOR.

Referenced by gpu_uniformbuffer_link().

◆ gpu_uniformbuffer_link()

static GPUNodeLink * gpu_uniformbuffer_link ( GPUMaterial * mat,
const bNode * node,
GPUNodeStack * stack,
const int index,
const eNodeSocketInOut in_out )
static

Link stack uniform buffer. This is called for the input/output sockets that are not connected.

Definition at line 192 of file gpu_node_graph.cc.

References BLI_assert, BLI_findlink(), ELEM, bNodeSocket::flag, GPU_link(), GPU_uniform(), gpu_uniform_set_function_from_type(), bNodeSocket::in_out, GPUNodeStack::link, SOCK_FLOAT, SOCK_HIDE_VALUE, SOCK_IN, SOCK_RGBA, SOCK_VECTOR, bNodeSocket::type, and GPUNodeStack::vec.

Referenced by gpu_node_input_socket().

◆ uniform_attr_list_cmp()

static bool uniform_attr_list_cmp ( const void * a,
const void * b )
static

◆ uniform_attr_list_hash()

static uint uniform_attr_list_hash ( const void * key)
static

Definition at line 281 of file gpu_node_graph.cc.

References GPUUniformAttrList::hash_code.

Referenced by GPU_uniform_attr_list_hash_new().

◆ uniform_attr_sort_cmp()

static int uniform_attr_sort_cmp ( const void * a,
const void * b )
static