Blender Git Loki

Git Commits -> Revision 6dc49ec

May 20, 2021, 21:51 (GMT)
GPU/EEVEE: Refactor codegen and nodetree support

This is the first step towards the new evaluation scheme of EEVEE
closures.

This commit contains:
- Removal of GPU_SOURCE_BUILTIN type, prefering global instead. This
avoid many boilerplate code since most of the old builtins are now
datas that are always present (i.e: view matrices, normals).
- Rewritting of codegen in C++ to use `std::stringstream`.
- Added a callback to let engine decide what to do with codegen code.
This remove a lot of needs for defines because of code order
dependency. The engine can insert the nodetree code in custom ways
to create advance effects (i.e: add displacement or vertex lighting).
Engine now returns final shader strings.
- Closure nodes evaluation replacment is a placeholder for now.

Commit Details:

Full Hash: 6dc49ec9924b21af4e67f30150394138cb17754b
Parent Commit: 0c71240
Lines Changed: +1952, -2669

4 Added Paths:

/source/blender/draw/intern/shaders/common_attribute_lib.glsl (+9, -0) (View)
/source/blender/draw/intern/shaders/common_obinfos_lib.glsl (+20, -0) (View)
/source/blender/draw/intern/shaders/common_uniform_attribute_lib.glsl (+12, -0) (View)
/source/blender/gpu/intern/gpu_codegen.cc (+794, -0) (View)

2 Deleted Paths:

/source/blender/gpu/intern/gpu_codegen.c (+0, -1127)
/source/blender/gpu/shaders/gpu_shader_common_obinfos_lib.glsl (+0, -20)

100 Modified Paths:

/source/blender/blenkernel/BKE_node.h (+1, -4) (Diff)
/source/blender/draw/CMakeLists.txt (+3, -0) (Diff)
/source/blender/draw/engines/eevee/eevee_id_map.hh (+24, -2) (Diff)
/source/blender/draw/engines/eevee/eevee_instance.cc (+1, -1) (Diff)
/source/blender/draw/engines/eevee/eevee_material.cc (+33, -20) (Diff)
/source/blender/draw/engines/eevee/eevee_material.hh (+2, -2) (Diff)
/source/blender/draw/engines/eevee/eevee_shader.cc (+186, -61) (Diff)
/source/blender/draw/engines/eevee/eevee_shader.hh (+15, -5) (Diff)
/source/blender/draw/engines/eevee/eevee_shading.cc (+7, -3) (Diff)
/source/blender/draw/engines/eevee/eevee_shading.hh (+2, -0) (Diff)
/source/blender/draw/engines/eevee/eevee_shadow.hh (+4, -3) (Diff)
/source/blender/draw/engines/eevee/shaders/eevee_deferred_direct_frag.glsl (+3, -1) (Diff)
/source/blender/draw/engines/eevee/shaders/eevee_nodetree_eval_lib.glsl (+30, -26) (Diff)
/source/blender/draw/engines/eevee/shaders/eevee_surface_deferred_frag.glsl (+4, -4) (Diff)
/source/blender/draw/engines/eevee/shaders/eevee_surface_forward_frag.glsl (+4, -4) (Diff)
/source/blender/draw/engines/eevee/shaders/eevee_surface_lib.glsl (+41, -3) (Diff)
/source/blender/draw/engines/eevee/shaders/eevee_surface_mesh_vert.glsl (+46, -0) (Diff)
/source/blender/draw/engines/eevee/shaders/eevee_volume_deferred_frag.glsl (+1, -1) (Diff)
/source/blender/draw/engines/eevee/shaders/eevee_volume_eval_lib.glsl (+1, -1) (Diff)
/source/blender/draw/engines/eevee/shaders/eevee_volume_lib.glsl (+2, -2) (Diff)
/source/blender/draw/engines/overlay/overlay_shader.c (+8, -8) (Diff)
/source/blender/draw/engines/workbench/shaders/workbench_volume_frag.glsl (+1, -1) (Diff)
/source/blender/draw/engines/workbench/shaders/workbench_volume_vert.glsl (+1, -1) (Diff)
/source/blender/draw/engines/workbench/workbench_shader.c (+2, -2) (Diff)
/source/blender/draw/intern/draw_manager_shader.c (+45, -100) (Diff)
/source/blender/draw/intern/DRW_render.h (+15, -42) (Diff)
/source/blender/gpu/CMakeLists.txt (+1, -4) (Diff)
/source/blender/gpu/GPU_material.h (+45, -52) (Diff)
/source/blender/gpu/GPU_shader.h (+8, -0) (Diff)
/source/blender/gpu/intern/gpu_codegen.h (+9, -13) (Diff)
/source/blender/gpu/intern/gpu_material.c (+67, -461) (Diff)
/source/blender/gpu/intern/gpu_material_library.c (+2, -6) (Diff)
/source/blender/gpu/intern/gpu_material_library.h (+9, -1) (Diff)
/source/blender/gpu/intern/gpu_node_graph.c (+26, -31) (Diff)
/source/blender/gpu/intern/gpu_node_graph.h (+25, -10) (Diff)
/source/blender/gpu/shaders/gpu_shader_codegen_lib.glsl (+26, -85) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_add_shader.glsl (+1, -1) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_ambient_occlusion.glsl (+2, -7) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_anisotropic.glsl (+0, -5) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_background.glsl (+1, -8) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_bump.glsl (+3, -6) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_camera.glsl (+4, -4) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_diffuse.glsl (+2, -0) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_displacement.glsl (+3, -4) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_eevee_specular.glsl (+8, -0) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_emission.glsl (+2, -8) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_fresnel.glsl (+3, -4) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_geometry.glsl (+10, -16) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_glass.glsl (+7, -0) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_glossy.glsl (+3, -0) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_holdout.glsl (+1, -5) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_layer_weight.glsl (+4, -4) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_light_path.glsl (+8, -8) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_math_util.glsl (+63, -6) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_mix_shader.glsl (+1, -1) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_normal_map.glsl (+7, -7) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_object_info.glsl (+5, -8) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_output_material.glsl (+13, -18) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_output_world.glsl (+7, -11) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_particle_info.glsl (+10, -13) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_principled.glsl (+90, -3) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_refraction.glsl (+3, -0) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_shader_to_rgba.glsl (+1, -18) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_subsurface_scattering.glsl (+3, -22) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_tangent.glsl (+3, -3) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_texture_coordinates.glsl (+15, -56) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_tex_environment.glsl (+5, -7) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_toon.glsl (+0, -5) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_translucent.glsl (+5, -9) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_transparent.glsl (+1, -8) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_vector_displacement.glsl (+12, -13) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_velvet.glsl (+0, -5) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_wireframe.glsl (+9, -14) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_world_normals.glsl (+1, -22) (Diff)
/source/blender/nodes/shader/nodes/node_shader_bevel.c (+1, -5) (Diff)
/source/blender/nodes/shader/nodes/node_shader_bsdf_principled.c (+3, -27) (Diff)
/source/blender/nodes/shader/nodes/node_shader_bump.c (+1, -2) (Diff)
/source/blender/nodes/shader/nodes/node_shader_camera.c (+1, -5) (Diff)
/source/blender/nodes/shader/nodes/node_shader_displacement.c (+2, -7) (Diff)
/source/blender/nodes/shader/nodes/node_shader_emission.c (+2, -1) (Diff)
/source/blender/nodes/shader/nodes/node_shader_fresnel.c (+2, -6) (Diff)
/source/blender/nodes/shader/nodes/node_shader_geometry.c (+2, -14) (Diff)
/source/blender/nodes/shader/nodes/node_shader_holdout.c (+1, -0) (Diff)
/source/blender/nodes/shader/nodes/node_shader_layer_weight.c (+2, -6) (Diff)
/source/blender/nodes/shader/nodes/node_shader_normal_map.c (+3, -6) (Diff)
/source/blender/nodes/shader/nodes/node_shader_object_info.c (+2, -9) (Diff)
/source/blender/nodes/shader/nodes/node_shader_output_aov.c (+2, -5) (Diff)
/source/blender/nodes/shader/nodes/node_shader_output_material.c (+14, -25) (Diff)
/source/blender/nodes/shader/nodes/node_shader_output_world.c (+11, -7) (Diff)
/source/blender/nodes/shader/nodes/node_shader_particle_info.c (+3, -10) (Diff)
/source/blender/nodes/shader/nodes/node_shader_subsurface_scattering.c (+2, -15) (Diff)
/source/blender/nodes/shader/nodes/node_shader_tangent.c (+1, -8) (Diff)
/source/blender/nodes/shader/nodes/node_shader_tex_coord.c (+5, -6) (Diff)
/source/blender/nodes/shader/nodes/node_shader_tex_environment.c (+1, -1) (Diff)
/source/blender/nodes/shader/nodes/node_shader_tex_image.c (+3, -5) (Diff)
/source/blender/nodes/shader/nodes/node_shader_vector_displacement.c (+13, -16) (Diff)
/source/blender/nodes/shader/nodes/node_shader_vectTransform.c (+18, -15) (Diff)
/source/blender/nodes/shader/nodes/node_shader_wireframe.c (+4, -10) (Diff)
/source/blender/nodes/shader/node_shader_tree.c (+1, -21) (Diff)
/source/blender/nodes/shader/node_shader_util.c (+1, -1) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021