Blender
V3.3
|
Contains procedural GPU hair drawing methods. More...
#include "BLI_string_utils.h"
#include "BLI_utildefines.h"
#include "DNA_curves_types.h"
#include "DNA_customdata_types.h"
#include "BKE_curves.hh"
#include "BKE_geometry_set.hh"
#include "GPU_batch.h"
#include "GPU_capabilities.h"
#include "GPU_compute.h"
#include "GPU_material.h"
#include "GPU_shader.h"
#include "GPU_texture.h"
#include "GPU_vertex_buffer.h"
#include "DRW_gpu_wrapper.hh"
#include "DRW_render.h"
#include "draw_cache_impl.h"
#include "draw_curves_private.h"
#include "draw_hair_private.h"
#include "draw_manager.h"
#include "draw_shader.h"
Go to the source code of this file.
Classes | |
struct | CurvesUniformBufPool |
Macros | |
#define | USE_TRANSFORM_FEEDBACK |
#define | USE_COMPUTE_SHADERS |
Typedefs | |
using | CurvesInfosBuf = blender::draw::UniformBuffer< CurvesInfos > |
Variables | |
static GPUVertBuf * | g_dummy_vbo = nullptr |
static GPUTexture * | g_dummy_texture = nullptr |
static DRWPass * | g_tf_pass |
Contains procedural GPU hair drawing methods.
Definition in file draw_curves.cc.
#define USE_COMPUTE_SHADERS |
Definition at line 38 of file draw_curves.cc.
#define USE_TRANSFORM_FEEDBACK |
Definition at line 37 of file draw_curves.cc.
Definition at line 72 of file draw_curves.cc.
|
static |
Definition at line 283 of file draw_curves.cc.
References GPU_material_attributes(), LISTBASE_FOREACH, and STREQ.
Referenced by DRW_shgroup_curves_create_sub().
|
static |
Definition at line 93 of file draw_curves.cc.
References drw_curves_shader_type_get(), DRW_shader_curves_refine_get(), and type.
Referenced by drw_curves_cache_update_compute(), and drw_curves_cache_update_transform_feedback().
|
static |
Definition at line 249 of file draw_curves.cc.
References curves, curves_ensure_procedural_data(), drw_curves_cache_update_compute(), drw_curves_cache_update_transform_feedback(), drw_curves_shader_type_get(), PART_REFINE_SHADER_COMPUTE, and update().
Referenced by DRW_curves_pos_buffer_get(), and DRW_shgroup_curves_create_sub().
|
static |
Definition at line 137 of file draw_curves.cc.
References DRW_shgroup_uniform_int(), DRW_shgroup_uniform_texture(), CurvesEvalCache::final, CurvesEvalCache::strand_seg_tex, CurvesEvalCache::strand_tex, CurvesEvalFinalCache::strands_res, and tex.
Referenced by drw_curves_cache_update_compute(), and drw_curves_cache_update_transform_feedback().
|
static |
Definition at line 170 of file draw_curves.cc.
References ATTR_DOMAIN_CURVE, CurvesEvalFinalCache::attr_used, CurvesEvalFinalCache::attributes_buf, DRW_AttributeRequest::domain, drw_curves_cache_update_compute(), CurvesEvalCache::final, DRW_Attributes::num_requests, CurvesEvalCache::point_tex, CurvesEvalCache::proc_attributes_tex, CurvesEvalFinalCache::proc_buf, DRW_Attributes::requests, CurvesEvalCache::strands_len, and CurvesEvalFinalCache::strands_res.
|
static |
Definition at line 148 of file draw_curves.cc.
References buffer, CURVES_EVAL_CATMULL_ROM, curves_eval_shader_get(), drw_curves_cache_shgrp_attach_resources(), DRW_shgroup_call_compute(), DRW_shgroup_create(), DRW_shgroup_create_sub(), DRW_shgroup_uniform_int_copy(), DRW_shgroup_vertex_buffer, CurvesEvalCache::final, g_tf_pass, GPU_max_work_group_count(), MIN2, CurvesEvalFinalCache::strands_res, and tex.
Referenced by drw_curves_cache_get(), and drw_curves_cache_update_compute().
|
static |
Definition at line 224 of file draw_curves.cc.
References ATTR_DOMAIN_CURVE, CurvesEvalFinalCache::attr_used, CurvesEvalFinalCache::attributes_buf, DRW_AttributeRequest::domain, drw_curves_cache_update_transform_feedback(), CurvesEvalCache::final, DRW_Attributes::num_requests, CurvesEvalCache::point_tex, CurvesEvalCache::proc_attributes_tex, CurvesEvalFinalCache::proc_buf, DRW_Attributes::requests, CurvesEvalCache::strands_len, and CurvesEvalFinalCache::strands_res.
|
static |
Definition at line 196 of file draw_curves.cc.
References CURVES_EVAL_CATMULL_ROM, curves_eval_shader_get(), drw_curves_cache_shgrp_attach_resources(), DRW_shgroup_call_procedural_points(), DRW_shgroup_create(), DRW_shgroup_transform_feedback_create(), DRW_shgroup_uniform_int(), g_tf_pass, and tex.
Referenced by drw_curves_cache_get(), and drw_curves_cache_update_transform_feedback().
Definition at line 497 of file draw_curves.cc.
References DRW_hair_free(), DRW_TEXTURE_FREE_SAFE, g_dummy_texture, g_dummy_vbo, and GPU_VERTBUF_DISCARD_SAFE.
Referenced by DRW_engines_free().
Definition at line 98 of file draw_curves.cc.
References DRWData::curves_ubos, DRW_hair_init(), DRW_pass_create(), DRW_STATE_WRITE_COLOR, g_dummy_texture, g_dummy_vbo, g_tf_pass, GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_texture_create_from_vertbuf(), GPU_vertbuf_attr_fill(), GPU_vertbuf_create_with_format, GPU_vertbuf_data_alloc(), GPU_vertbuf_use(), GPU_vertformat_attr_add(), and blender::compositor::pool.
Referenced by DRW_cache_restart(), DRW_custom_pipeline(), DRW_draw_depth_loop(), DRW_draw_render_loop_ex(), DRW_draw_select_loop(), and DRW_render_object_iter().
GPUVertBuf* DRW_curves_pos_buffer_get | ( | struct Object * | object | ) |
Definition at line 269 of file draw_curves.cc.
References curves, DRW_context_state_get(), drw_curves_cache_get(), CurvesEvalCache::final, RenderData::hair_subdiv, RenderData::hair_type, CurvesEvalFinalCache::proc_buf, Scene::r, SCE_HAIR_SHAPE_STRAND, scene, and DRWContextState::scene.
Referenced by EEVEE_motion_blur_curves_cache_populate(), and blender::eevee::VelocityModule::step_object_sync().
BLI_INLINE eParticleRefineShaderType drw_curves_shader_type_get | ( | ) |
Definition at line 41 of file draw_curves.cc.
References GPU_compute_shader_support(), GPU_shader_storage_buffer_objects_support(), PART_REFINE_SHADER_COMPUTE, PART_REFINE_SHADER_TRANSFORM_FEEDBACK, and PART_REFINE_SHADER_TRANSFORM_FEEDBACK_WORKAROUND.
Referenced by curves_eval_shader_get(), drw_curves_cache_get(), and DRW_curves_update().
void DRW_curves_ubos_pool_free | ( | CurvesUniformBufPool * | pool | ) |
Definition at line 132 of file draw_curves.cc.
References blender::compositor::pool.
Referenced by DRW_viewport_data_free().
Definition at line 414 of file draw_curves.cc.
References data, drw_curves_shader_type_get(), DRW_curves_update(), DRW_draw_pass(), DRW_draw_pass_subset(), DRW_hair_update(), DRW_texture_pool_query_2d(), fb(), g_tf_pass, GPU_BARRIER_SHADER_STORAGE, GPU_DATA_FLOAT, GPU_framebuffer_bind(), GPU_framebuffer_free(), GPU_framebuffer_read_color(), GPU_memory_barrier(), GPU_RGBA32F, GPU_vertbuf_update_sub(), GPU_vertbuf_use(), height, max_ii(), MEM_freeN, MEM_mallocN, min_ii(), PART_REFINE_SHADER_COMPUTE, tex, and width.
Referenced by DRW_curves_update(), DRW_draw_depth_loop(), DRW_draw_render_loop_ex(), DRW_draw_select_loop(), eevee_lightbake_cache_create(), EEVEE_motion_blur_cache_finish(), EEVEE_render_draw(), and workbench_render().
DRWShadingGroup* DRW_shgroup_curves_create_sub | ( | Object * | object, |
DRWShadingGroup * | shgrp_parent, | ||
GPUMaterial * | gpu_material | ||
) |
Definition at line 303 of file draw_curves.cc.
References ATTR_DOMAIN_CURVE, ATTR_DOMAIN_POINT, CurvesEvalFinalCache::attr_used, attribute_index_in_material(), DRW_AttributeRequest::attribute_name, CurvesEvalFinalCache::attributes_tex, blender::math::clamp(), curves, DRWData::curves_ubos, DRW_AttributeRequest::domain, DRW_context_state_get(), drw_curves_cache_get(), drw_curves_get_attribute_sampler_name(), DRW_shgroup_add_material_resources(), DRW_shgroup_call_no_cull, DRW_shgroup_create_sub(), DRW_shgroup_uniform_block, DRW_shgroup_uniform_bool_copy(), DRW_shgroup_uniform_float_copy(), DRW_shgroup_uniform_int(), DRW_shgroup_uniform_int_copy(), DRW_shgroup_uniform_mat4_copy(), DRW_shgroup_uniform_texture(), DST, CurvesEvalCache::final, blender::IndexRange::first(), g_dummy_texture, Curves::geometry, GPUBatch, RenderData::hair_subdiv, RenderData::hair_type, blender::IndexRange::last(), CurvesEvalCache::length_tex, DRW_Attributes::num_requests, Object::obmat, blender::compositor::pool, CurvesEvalCache::proc_attributes_tex, CurvesEvalFinalCache::proc_hairs, CurvesEvalFinalCache::proc_tex, blender::draw::detail::UniformCommon< T, len, device_only >::push_update(), Scene::r, radii, DRW_Attributes::requests, blender::math::safe_divide(), SCE_HAIR_SHAPE_STRAND, scene, DRWContextState::scene, blender::IndexRange::size(), CurvesEvalFinalCache::strands_res, DRWManager::vmempool, and blender::bke::CurvesGeometry::wrap().
Referenced by basic_cache_populate(), EEVEE_cryptomatte_object_curves_cache_populate(), EEVEE_motion_blur_curves_cache_populate(), EEVEE_object_curves_cache_populate(), OVERLAY_outline_curves(), OVERLAY_sculpt_curves_cache_populate(), blender::eevee::shgroup_curves_call(), and workbench_cache_populate().
|
static |
Definition at line 69 of file draw_curves.cc.
Referenced by DRW_curves_free(), DRW_curves_init(), and DRW_shgroup_curves_create_sub().
|
static |
Definition at line 68 of file draw_curves.cc.
Referenced by DRW_curves_free(), and DRW_curves_init().
|
static |
Definition at line 70 of file draw_curves.cc.
Referenced by drw_curves_cache_update_compute(), drw_curves_cache_update_transform_feedback(), DRW_curves_init(), and DRW_curves_update().