Blender
V3.3
|
#include "DNA_customdata_types.h"
#include "DNA_image_types.h"
#include "DNA_listBase.h"
#include "BLI_sys_types.h"
#include "GPU_shader.h"
#include "GPU_texture.h"
Go to the source code of this file.
Classes | |
struct | GPUNodeStack |
struct | GPUCodegenOutput |
struct | GPUMaterialAttribute |
struct | GPUMaterialTexture |
struct | GPUUniformAttr |
struct | GPUUniformAttrList |
Typedefs | |
typedef struct GPUMaterial | GPUMaterial |
typedef struct GPUNode | GPUNode |
typedef struct GPUNodeLink | GPUNodeLink |
typedef enum eGPUType | eGPUType |
typedef enum eGPUMaterialFlag | eGPUMaterialFlag |
typedef struct GPUNodeStack | GPUNodeStack |
typedef enum eGPUMaterialStatus | eGPUMaterialStatus |
typedef enum eGPUDefaultValue | eGPUDefaultValue |
typedef struct GPUCodegenOutput | GPUCodegenOutput |
typedef void(* | GPUCodegenCallbackFn) (void *thunk, GPUMaterial *mat, GPUCodegenOutput *codegen) |
typedef struct GPUMaterialAttribute | GPUMaterialAttribute |
typedef struct GPUMaterialTexture | GPUMaterialTexture |
typedef struct GPUUniformAttr | GPUUniformAttr |
typedef struct GPUUniformAttrList | GPUUniformAttrList |
typedef enum eGPUDefaultValue eGPUDefaultValue |
typedef enum eGPUMaterialFlag eGPUMaterialFlag |
typedef enum eGPUMaterialStatus eGPUMaterialStatus |
typedef void(* GPUCodegenCallbackFn) (void *thunk, GPUMaterial *mat, GPUCodegenOutput *codegen) |
Definition at line 137 of file GPU_material.h.
typedef struct GPUCodegenOutput GPUCodegenOutput |
typedef struct GPUMaterial GPUMaterial |
Definition at line 1 of file GPU_material.h.
typedef struct GPUMaterialAttribute GPUMaterialAttribute |
typedef struct GPUMaterialTexture GPUMaterialTexture |
Definition at line 1 of file GPU_material.h.
typedef struct GPUNodeLink GPUNodeLink |
Definition at line 1 of file GPU_material.h.
typedef struct GPUNodeStack GPUNodeStack |
typedef struct GPUUniformAttr GPUUniformAttr |
typedef struct GPUUniformAttrList GPUUniformAttrList |
enum eGPUDefaultValue |
Enumerator | |
---|---|
GPU_DEFAULT_0 | |
GPU_DEFAULT_1 |
Definition at line 120 of file GPU_material.h.
enum eGPUMaterialFlag |
Definition at line 70 of file GPU_material.h.
enum eGPUMaterialStatus |
Enumerator | |
---|---|
GPU_MAT_FAILED | |
GPU_MAT_CREATED | |
GPU_MAT_QUEUED | |
GPU_MAT_SUCCESS |
Definition at line 113 of file GPU_material.h.
enum eGPUType |
Enumerator | |
---|---|
GPU_NONE | |
GPU_FLOAT | |
GPU_VEC2 | |
GPU_VEC3 | |
GPU_VEC4 | |
GPU_MAT3 | |
GPU_MAT4 | |
GPU_MAX_CONSTANT_DATA | |
GPU_TEX1D_ARRAY | |
GPU_TEX2D | |
GPU_TEX2D_ARRAY | |
GPU_TEX3D | |
GPU_CLOSURE | |
GPU_ATTR |
Definition at line 45 of file GPU_material.h.
ENUM_OPERATORS | ( | eGPUMaterialFlag | , |
GPU_MATFLAG_LOOKDEV_HACK | |||
) |
GPUNodeLink* GPU_attribute | ( | GPUMaterial * | mat, |
eCustomDataType | type, | ||
const char * | name | ||
) |
Definition at line 475 of file gpu_node_graph.c.
References GPUNodeLink::attr, CD_ORCO, GPU_constant(), GPU_material_flag_set(), gpu_material_node_graph(), GPU_MATFLAG_OBJECT_INFO, GPU_MAX_CONSTANT_DATA, gpu_node_graph_add_attribute(), GPU_NODE_LINK_ATTR, gpu_node_link_create(), graph, GPUNodeLink::link_type, NULL, and type.
Referenced by GPU_attribute_with_default(), blender::nodes::node_shader_normal_map_cc::gpu_shader_normal_map(), blender::nodes::node_shader_vector_displacement_cc::gpu_shader_vector_displacement(), blender::nodes::node_shader_attribute_cc::node_shader_gpu_attribute(), blender::nodes::node_shader_bsdf_principled_cc::node_shader_gpu_bsdf_principled(), node_shader_gpu_default_tex_coord(), 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_tangent_cc::node_shader_gpu_tangent(), blender::nodes::node_shader_tex_coord_cc::node_shader_gpu_tex_coord(), blender::nodes::node_shader_tex_image_cc::node_shader_gpu_tex_image(), 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_info_cc::node_shader_gpu_volume_info(), and blender::nodes::node_shader_volume_principled_cc::node_shader_gpu_volume_principled().
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 497 of file gpu_node_graph.c.
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(), graph, GPUMaterialAttribute::is_default_color, GPUNodeLink::link_type, and NULL.
Referenced by blender::nodes::node_shader_vertex_color_cc::node_shader_gpu_vertex_color().
GPUNodeLink* GPU_attribute_with_default | ( | GPUMaterial * | mat, |
eCustomDataType | type, | ||
const char * | name, | ||
eGPUDefaultValue | default_value | ||
) |
Definition at line 512 of file gpu_node_graph.c.
References GPUNodeLink::attr, GPUMaterialAttribute::default_value, GPU_attribute(), GPU_NODE_LINK_ATTR, GPUNodeLink::link_type, and type.
Referenced by blender::nodes::node_shader_volume_principled_cc::node_shader_gpu_volume_principled().
GPUNodeLink* GPU_color_band | ( | GPUMaterial * | mat, |
int | size, | ||
float * | pixels, | ||
float * | row | ||
) |
Definition at line 601 of file gpu_node_graph.c.
References gpu_material_node_graph(), gpu_material_ramp_texture_row_set(), gpu_node_graph_add_texture(), GPU_NODE_LINK_COLORBAND, gpu_node_link_create(), GPU_SAMPLER_MAX, graph, GPUNodeLink::link_type, MEM_freeN, NULL, size(), and GPUNodeLink::texture.
Referenced by blender::nodes::node_shader_curves_cc::gpu_shader_curve_float(), blender::nodes::node_shader_curves_cc::gpu_shader_curve_rgb(), blender::nodes::node_shader_curves_cc::gpu_shader_curve_vec(), blender::nodes::node_shader_color_ramp_cc::gpu_shader_valtorgb(), blender::nodes::node_shader_blackbody_cc::node_shader_gpu_blackbody(), blender::nodes::node_shader_volume_principled_cc::node_shader_gpu_volume_principled(), and blender::nodes::node_shader_wavelength_cc::node_shader_gpu_wavelength().
GPUNodeLink* GPU_constant | ( | const float * | num | ) |
Definition at line 541 of file gpu_node_graph.c.
References GPUNodeLink::data, GPU_NODE_LINK_CONSTANT, gpu_node_link_create(), and GPUNodeLink::link_type.
Referenced by GPU_attribute(), GPU_attribute_default_color(), gpu_node_input_socket(), blender::nodes::node_shader_bump_cc::gpu_shader_bump(), blender::nodes::node_shader_curves_cc::gpu_shader_curve_float(), blender::nodes::node_shader_curves_cc::gpu_shader_curve_rgb(), blender::nodes::node_shader_curves_cc::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_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_blackbody_cc::node_shader_gpu_blackbody(), blender::nodes::node_shader_bsdf_anisotropic_cc::node_shader_gpu_bsdf_anisotropic(), 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_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_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_gradient_cc::node_shader_gpu_tex_gradient(), blender::nodes::node_shader_tex_magic_cc::node_shader_gpu_tex_magic(), 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().
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 557 of file gpu_node_graph.c.
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().
GPUNodeLink* GPU_image | ( | GPUMaterial * | mat, |
struct Image * | ima, | ||
struct ImageUser * | iuser, | ||
eGPUSamplerState | sampler_state | ||
) |
Definition at line 565 of file gpu_node_graph.c.
References gpu_material_node_graph(), gpu_node_graph_add_texture(), gpu_node_link_create(), GPU_NODE_LINK_IMAGE, graph, GPUNodeLink::link_type, NULL, and GPUNodeLink::texture.
Referenced by blender::nodes::node_shader_tex_environment_cc::node_shader_gpu_tex_environment(), and blender::nodes::node_shader_tex_image_cc::node_shader_gpu_tex_image().
GPUNodeLink* GPU_image_tiled | ( | GPUMaterial * | mat, |
struct Image * | ima, | ||
struct ImageUser * | iuser, | ||
eGPUSamplerState | sampler_state | ||
) |
Definition at line 578 of file gpu_node_graph.c.
References gpu_material_node_graph(), gpu_node_graph_add_texture(), gpu_node_link_create(), GPU_NODE_LINK_IMAGE_TILED, graph, GPUNodeLink::link_type, NULL, and GPUNodeLink::texture.
Referenced by blender::nodes::node_shader_tex_image_cc::node_shader_gpu_tex_image().
GPUNodeLink* GPU_image_tiled_mapping | ( | GPUMaterial * | mat, |
struct Image * | ima, | ||
struct ImageUser * | iuser | ||
) |
Definition at line 591 of file gpu_node_graph.c.
References gpu_material_node_graph(), gpu_node_graph_add_texture(), gpu_node_link_create(), GPU_NODE_LINK_IMAGE_TILED_MAPPING, GPU_SAMPLER_MAX, graph, GPUNodeLink::link_type, NULL, and GPUNodeLink::texture.
Referenced by blender::nodes::node_shader_tex_image_cc::node_shader_gpu_tex_image().
bool GPU_link | ( | GPUMaterial * | mat, |
const char * | name, | ||
... | |||
) |
Definition at line 616 of file gpu_node_graph.c.
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(), graph, node, and params.
Referenced by blender::nodes::node_shader_volume_principled_cc::attribute_post_process(), 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_shader_mix_rgb_cc::gpu_shader_mix_rgb(), blender::nodes::node_shader_normal_map_cc::gpu_shader_normal_map(), 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_anisotropic_cc::node_shader_gpu_bsdf_anisotropic(), 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_principled_cc::node_shader_gpu_bsdf_principled(), blender::nodes::node_shader_bsdf_refraction_cc::node_shader_gpu_bsdf_refraction(), 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_velvet_cc::node_shader_gpu_bsdf_velvet(), 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().
void GPU_material_acquire | ( | GPUMaterial * | mat | ) |
Definition at line 702 of file gpu_material.c.
References atomic_add_and_fetch_uint32(), and GPUMaterial::refcount.
Referenced by drw_deferred_shader_compilation_exec().
void GPU_material_add_output_link_aov | ( | GPUMaterial * | material, |
GPUNodeLink * | link, | ||
int | hash | ||
) |
Definition at line 533 of file gpu_material.c.
References BLI_addtail(), hash, GPUNodeGraphOutputLink::hash, material, MEM_callocN, and GPUNodeGraphOutputLink::outlink.
Referenced by blender::nodes::node_shader_output_aov_cc::node_shader_gpu_output_aov().
ListBase GPU_material_attributes | ( | GPUMaterial * | material | ) |
Definition at line 216 of file gpu_material.c.
References material.
Referenced by attribute_index_in_material(), curves_batch_cache_ensure_procedural_pos(), curves_ensure_attributes(), DRW_shgroup_volume_create_sub(), mesh_cd_calc_used_gpu_layers(), and particle_batch_cache_ensure_procedural_pos().
void GPU_material_compile | ( | GPUMaterial * | mat | ) |
Definition at line 712 of file gpu_material.c.
References BLI_assert, ELEM, GPUMaterial::flag, GPU_MAT_CREATED, GPU_MAT_FAILED, GPU_MAT_QUEUED, GPU_MAT_SUCCESS, GPU_MATFLAG_UPDATED, gpu_node_graph_free(), gpu_node_graph_free_nodes(), GPU_pass_compile(), GPU_pass_release(), GPU_pass_shader_get(), GPUMaterial::graph, GPUMaterial::name, NULL, GPUMaterial::pass, sh, and GPUMaterial::status.
Referenced by drw_deferred_shader_add(), drw_deferred_shader_compilation_exec(), and blender::eevee::ShaderModule::material_shader_get().
struct GPUUniformBuf* GPU_material_create_sss_profile_ubo | ( | void | ) |
Definition at line 494 of file gpu_material.c.
References GPU_uniformbuf_create.
eGPUMaterialFlag GPU_material_flag | ( | const GPUMaterial * | mat | ) |
Definition at line 606 of file gpu_material.c.
References GPUMaterial::flag.
Referenced by GPUCodegen::GPUCodegen().
bool GPU_material_flag_get | ( | const GPUMaterial * | mat, |
eGPUMaterialFlag | flag | ||
) |
Definition at line 601 of file gpu_material.c.
References GPUMaterial::flag.
Referenced by EEVEE_material_bind_resources(), eevee_shader_material_create_info_amend(), GPUCodegen::generate_resources(), GPUCodegen::GPUCodegen(), blender::eevee::ForwardPipeline::material_add(), blender::eevee::ShaderModule::material_create_info_ammend(), material_opaque(), blender::nodes::node_shader_tex_environment_cc::node_shader_gpu_tex_environment(), blender::eevee::ForwardPipeline::prepass_add(), and blender::eevee::shader_closure_bits_from_flag().
void GPU_material_flag_set | ( | GPUMaterial * | mat, |
eGPUMaterialFlag | flag | ||
) |
Definition at line 596 of file gpu_material.c.
References GPUMaterial::flag.
Referenced by GPU_attribute(), blender::nodes::node_shader_normal_map_cc::gpu_shader_normal_map(), blender::nodes::node_shader_particle_info_cc::gpu_shader_particle_info(), blender::nodes::node_shader_ambient_occlusion_cc::node_shader_gpu_ambient_occlusion(), blender::nodes::node_shader_bsdf_anisotropic_cc::node_shader_gpu_bsdf_anisotropic(), 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_principled_cc::node_shader_gpu_bsdf_principled(), blender::nodes::node_shader_bsdf_refraction_cc::node_shader_gpu_bsdf_refraction(), 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_bsdf_velvet_cc::node_shader_gpu_bsdf_velvet(), 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_geometry_cc::node_shader_gpu_geometry(), 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_shader_to_rgb_cc::node_shader_gpu_shadertorgb(), blender::nodes::node_shader_subsurface_scattering_cc::node_shader_gpu_subsurface_scattering(), and blender::nodes::node_shader_wireframe_cc::node_shader_gpu_wireframe().
Definition at line 171 of file gpu_material.c.
References BLI_freelistN(), DRW_deferred_shader_remove, gpu_material_free_single(), LISTBASE_FOREACH, and material.
Referenced by BKE_material_copybuf_paste(), BKE_material_defaults_free_gpu(), BKE_material_eval(), BKE_world_eval(), ED_node_set_active(), GPU_materials_free(), material_free_data(), and world_free_data().
GPUMaterial* GPU_material_from_nodetree | ( | struct Scene * | scene, |
struct Material * | ma, | ||
struct bNodeTree * | ntree, | ||
struct ListBase * | gpumaterials, | ||
const char * | name, | ||
uint64_t | shader_uuid, | ||
bool | is_volume_shader, | ||
bool | is_lookdev, | ||
GPUCodegenCallbackFn | callback, | ||
void * | thunk | ||
) |
Definition at line 624 of file gpu_material.c.
References BLI_addtail(), BLI_assert, BLI_ghashutil_ptrcmp(), BLI_ghashutil_ptrhash(), BLI_gset_new(), callback, LinkData::data, GPUMaterial::flag, GPU_generate_pass(), GPU_MAT_CREATED, GPU_MAT_FAILED, GPU_MAT_SUCCESS, gpu_material_ramp_texture_build(), GPU_MATFLAG_LOOKDEV_HACK, GPU_MATFLAG_UPDATED, gpu_node_graph_free(), gpu_node_graph_free_nodes(), GPU_pass_shader_get(), GPUMaterial::graph, bNodeTree::id, if(), GPUMaterial::is_volume_shader, LISTBASE_FOREACH, GPUMaterial::ma, MEM_callocN, MEM_freeN, GPUMaterial::name, ntree, ntreeFreeLocalTree, ntreeGPUMaterialNodes, ntreeLocalize, NULL, GPUMaterial::pass, ID::py_instance, GPUMaterial::refcount, scene, GPUMaterial::scene, sh, GPUMaterial::status, STRNCPY, UNUSED_VARS, GPUNodeGraph::used_libraries, and GPUMaterial::uuid.
Referenced by DRW_shader_from_material(), DRW_shader_from_world(), and blender::eevee::ShaderModule::material_shader_get().
GPUMaterial* GPU_material_from_nodetree_find | ( | struct ListBase * | gpumaterials, |
const void * | engine_type, | ||
int | options | ||
) |
High level functions to create and use GPU materials.
struct Material* GPU_material_get_material | ( | GPUMaterial * | material | ) |
Return can be NULL if it's a world material.
Definition at line 196 of file gpu_material.c.
References material.
Referenced by blender::nodes::node_shader_object_info_cc::node_shader_gpu_object_info().
struct GPUPass* GPU_material_get_pass | ( | GPUMaterial * | material | ) |
Definition at line 186 of file gpu_material.c.
References material.
Referenced by DRW_shgroup_material_create().
struct GPUShader* GPU_material_get_shader | ( | GPUMaterial * | material | ) |
Definition at line 191 of file gpu_material.c.
References GPU_pass_shader_get(), material, and NULL.
Referenced by eevee_lookdev_hdri_preview_init(), EEVEE_volumes_cache_object_add(), material_opaque(), material_shadow(), material_transparent(), and blender::eevee::ShaderKey::ShaderKey().
bool GPU_material_has_surface_output | ( | GPUMaterial * | mat | ) |
Definition at line 586 of file gpu_material.c.
References GPUMaterial::has_surface_output.
Referenced by EEVEE_materials_cache_populate().
bool GPU_material_has_volume_output | ( | GPUMaterial * | mat | ) |
Definition at line 591 of file gpu_material.c.
References GPUMaterial::has_volume_output.
Referenced by EEVEE_materials_cache_populate(), and EEVEE_volumes_cache_init().
void GPU_material_output_displacement | ( | GPUMaterial * | material, |
GPUNodeLink * | link | ||
) |
Definition at line 519 of file gpu_material.c.
References material.
Referenced by blender::nodes::node_shader_output_material_cc::node_shader_gpu_output_material().
void GPU_material_output_surface | ( | GPUMaterial * | material, |
GPUNodeLink * | link | ||
) |
Definition at line 503 of file gpu_material.c.
References material.
Referenced by blender::nodes::node_shader_output_light_cc::node_shader_gpu_output_light(), blender::nodes::node_shader_output_material_cc::node_shader_gpu_output_material(), and blender::nodes::node_shader_output_world_cc::node_shader_gpu_output_world().
void GPU_material_output_thickness | ( | GPUMaterial * | material, |
GPUNodeLink * | link | ||
) |
Definition at line 526 of file gpu_material.c.
References material.
Referenced by blender::nodes::node_shader_output_material_cc::node_shader_gpu_output_material().
void GPU_material_output_volume | ( | GPUMaterial * | material, |
GPUNodeLink * | link | ||
) |
Definition at line 511 of file gpu_material.c.
References material.
Referenced by blender::nodes::node_shader_output_material_cc::node_shader_gpu_output_material(), and blender::nodes::node_shader_output_world_cc::node_shader_gpu_output_world().
bool GPU_material_recalc_flag_get | ( | GPUMaterial * | mat | ) |
Definition at line 612 of file gpu_material.c.
References GPUMaterial::flag, and GPU_MATFLAG_UPDATED.
void GPU_material_release | ( | GPUMaterial * | mat | ) |
Definition at line 707 of file gpu_material.c.
References gpu_material_free_single().
Referenced by drw_deferred_shader_compilation_exec().
struct Scene* GPU_material_scene | ( | GPUMaterial * | material | ) |
Definition at line 181 of file gpu_material.c.
References material.
char* GPU_material_split_sub_function | ( | GPUMaterial * | material, |
eGPUType | return_type, | ||
GPUNodeLink ** | link | ||
) |
Wrap a part of the material graph into a function. You need then need to call the function by using something like GPU_differentiate_float_function.
return_type | sub function return type. Output is cast to this type. |
link | link to use as the sub function output. |
Definition at line 541 of file gpu_material.c.
References BLI_addtail(), BLI_assert, GPU_FLOAT, GPU_link(), GPU_VEC3, GPU_VEC4, material, MEM_callocN, GPUNodeGraphFunctionLink::name, GPUNodeGraphFunctionLink::outlink, and SNPRINTF.
Referenced by blender::nodes::node_shader_bump_cc::gpu_shader_bump().
bool GPU_material_sss_profile_create | ( | GPUMaterial * | material, |
float | radii[3] | ||
) |
Definition at line 438 of file gpu_material.c.
References copy_v3_v3(), GPU_uniformbuf_create, material, NULL, and radii.
Referenced by blender::nodes::node_shader_bsdf_principled_cc::node_shader_gpu_bsdf_principled(), and blender::nodes::node_shader_subsurface_scattering_cc::node_shader_gpu_subsurface_scattering().
struct GPUUniformBuf* GPU_material_sss_profile_get | ( | GPUMaterial * | material, |
int | sample_len, | ||
struct GPUTexture ** | tex_profile | ||
) |
Definition at line 455 of file gpu_material.c.
References compute_sss_kernel(), compute_sss_translucence_kernel(), GPU_RGBA16F, GPU_texture_create_1d(), GPU_texture_free(), GPU_uniformbuf_update(), material, MEM_freeN, and NULL.
Referenced by EEVEE_subsurface_add_pass().
eGPUMaterialStatus GPU_material_status | ( | GPUMaterial * | mat | ) |
Return true if the material compilation has not yet begin or begin.
Definition at line 574 of file gpu_material.c.
References GPUMaterial::status.
Referenced by drw_deferred_shader_add(), and EEVEE_material_get().
void GPU_material_status_set | ( | GPUMaterial * | mat, |
eGPUMaterialStatus | status | ||
) |
Definition at line 579 of file gpu_material.c.
References GPUMaterial::status.
Referenced by drw_deferred_shader_add(), DRW_deferred_shader_remove(), and blender::eevee::ShaderModule::material_shader_get().
ListBase GPU_material_textures | ( | GPUMaterial * | material | ) |
Definition at line 221 of file gpu_material.c.
References material.
Referenced by DRW_shgroup_add_material_resources(), and image_walk_gpu_materials().
GPUUniformAttrList* GPU_material_uniform_attributes | ( | GPUMaterial * | material | ) |
Definition at line 226 of file gpu_material.c.
References GPUUniformAttrList::count, material, and NULL.
Referenced by DRW_shgroup_add_material_resources().
void GPU_material_uniform_buffer_create | ( | GPUMaterial * | material, |
ListBase * | inputs | ||
) |
Create dynamic UBO from parameters
Definition at line 206 of file gpu_material.c.
References GPU_uniformbuf_create_from_list(), inputs, and material.
Referenced by GPUCodegen::generate_uniform_buffer().
struct GPUUniformBuf* GPU_material_uniform_buffer_get | ( | GPUMaterial * | material | ) |
Definition at line 201 of file gpu_material.c.
References material.
Referenced by DRW_shgroup_add_material_resources().
uint64_t GPU_material_uuid_get | ( | GPUMaterial * | mat | ) |
Definition at line 619 of file gpu_material.c.
References GPUMaterial::uuid.
Referenced by eevee_material_post_eval(), eevee_shader_material_create_info_amend(), GPUCodegen::GPUCodegen(), and blender::eevee::ShaderModule::material_create_info_ammend().
Definition at line 747 of file gpu_material.c.
References BKE_material_defaults_free_gpu(), GPU_material_free(), LISTBASE_FOREACH, Main::materials, and Main::worlds.
Referenced by outliner_id_remap_exec().
Definition at line 789 of file gpu_codegen.cc.
References BLI_spin_end(), BLI_spin_lock(), BLI_spin_unlock(), gpu_pass_free(), GPUPass::next, next, pass_cache, and pass_cache_spin.
Referenced by WM_exit_ex().
Definition at line 756 of file gpu_codegen.cc.
References BLI_spin_lock(), BLI_spin_unlock(), gpu_pass_free(), GPUPass::next, next, pass_cache, pass_cache_spin, and PIL_check_seconds_timer().
Referenced by view3d_main_region_draw().
Definition at line 784 of file gpu_codegen.cc.
References BLI_spin_init(), and pass_cache_spin.
Referenced by WM_init_opengl().
bool GPU_stack_link | ( | GPUMaterial * | mat, |
struct bNode * | node, | ||
const char * | name, | ||
GPUNodeStack * | in, | ||
GPUNodeStack * | out, | ||
... | |||
) |
Definition at line 723 of file gpu_node_graph.c.
References gpu_stack_link_v(), material, usdtokens::out(), and params.
Referenced by 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::gpu_shader_combxyz(), blender::nodes::node_shader_curves_cc::gpu_shader_curve_float(), blender::nodes::node_shader_curves_cc::gpu_shader_curve_rgb(), blender::nodes::node_shader_curves_cc::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_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_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::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_value_cc::gpu_shader_value(), 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_anisotropic_cc::node_shader_gpu_bsdf_anisotropic(), 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_principled_cc::node_shader_gpu_bsdf_principled(), blender::nodes::node_shader_bsdf_refraction_cc::node_shader_gpu_bsdf_refraction(), 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_bsdf_velvet_cc::node_shader_gpu_bsdf_velvet(), 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_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_musgrave_cc::node_shader_gpu_tex_musgrave(), 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().
GPUNodeLink* GPU_uniform | ( | const float * | num | ) |
Definition at line 549 of file gpu_node_graph.c.
References GPUNodeLink::data, gpu_node_link_create(), GPU_NODE_LINK_UNIFORM, and GPUNodeLink::link_type.
Referenced by blender::nodes::node_shader_curves_cc::gpu_shader_curve_float(), blender::nodes::node_shader_curves_cc::gpu_shader_curve_rgb(), blender::nodes::node_shader_curves_cc::gpu_shader_curve_vec(), blender::nodes::node_shader_normal_cc::gpu_shader_normal(), blender::nodes::node_shader_normal_map_cc::gpu_shader_normal_map(), blender::nodes::node_shader_color_ramp_cc::gpu_shader_valtorgb(), gpu_uniformbuffer_link(), blender::nodes::node_shader_bsdf_principled_cc::node_shader_gpu_bsdf_principled(), 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_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().
void GPU_uniform_attr_list_copy | ( | GPUUniformAttrList * | dest, |
GPUUniformAttrList * | src | ||
) |
Definition at line 292 of file gpu_node_graph.c.
References BLI_duplicatelist(), dest, and src.
Referenced by drw_uniform_attrs_pool_ensure().
void GPU_uniform_attr_list_free | ( | GPUUniformAttrList * | set | ) |
Definition at line 299 of file gpu_node_graph.c.
References BLI_freelistN(), GPUUniformAttrList::count, GPUUniformAttrList::hash_code, and GPUUniformAttrList::list.
Referenced by drw_uniform_attrs_pool_free_cb(), and gpu_node_graph_free().
struct GHash* GPU_uniform_attr_list_hash_new | ( | const char * | info | ) |
Definition at line 287 of file gpu_node_graph.c.
References BLI_ghash_new(), uniform_attr_list_cmp(), and uniform_attr_list_hash().
Referenced by DRW_uniform_attrs_pool_new().
GPUNodeLink* GPU_uniform_attribute | ( | GPUMaterial * | mat, |
const char * | name, | ||
bool | use_dupli | ||
) |
Definition at line 524 of file gpu_node_graph.c.
References GPU_constant(), gpu_material_node_graph(), GPU_MAX_CONSTANT_DATA, gpu_node_graph_add_uniform_attribute(), gpu_node_link_create(), GPU_NODE_LINK_UNIFORM_ATTR, graph, GPUNodeLink::link_type, NULL, and GPUNodeLink::uniform_attr.
Referenced by blender::nodes::node_shader_attribute_cc::node_shader_gpu_attribute().
GPUNodeLink* GPU_uniformbuf_link_out | ( | struct GPUMaterial * | mat, |
struct bNode * | node, | ||
struct GPUNodeStack * | stack, | ||
int | index | ||
) |
Definition at line 738 of file gpu_node_graph.c.
References gpu_uniformbuffer_link(), node, and SOCK_OUT.
Referenced by blender::nodes::node_shader_rgb_cc::gpu_shader_rgb(), and blender::nodes::node_shader_value_cc::gpu_shader_value().