|
Blender V4.5
|
#include "MEM_guardedalloc.h"#include "BLI_map.hh"#include "BLI_span.hh"#include "BLI_time.h"#include "BLI_vector.hh"#include "GPU_capabilities.hh"#include "GPU_context.hh"#include "GPU_pass.hh"#include "GPU_vertex_format.hh"#include "gpu_codegen.hh"#include <mutex>#include <string>Go to the source code of this file.
Classes | |
| struct | GPUPass |
| class | GPUPassCache |
Functions | |
Compilation | |
| static bool | gpu_pass_validate (GPUCodegenCreateInfo *create_info) |
| GPUPass * | GPU_generate_pass (GPUMaterial *material, GPUNodeGraph *graph, const char *debug_name, eGPUMaterialEngine engine, bool deferred_compilation, GPUCodegenCallbackFn finalize_source_cb, void *thunk, bool optimize_graph) |
GPUPass | |
| eGPUPassStatus | GPU_pass_status (GPUPass *pass) |
| bool | GPU_pass_should_optimize (GPUPass *pass) |
| GPUShader * | GPU_pass_shader_get (GPUPass *pass) |
| void | GPU_pass_acquire (GPUPass *pass) |
| void | GPU_pass_release (GPUPass *pass) |
| uint64_t | GPU_pass_global_compilation_count () |
| uint64_t | GPU_pass_compilation_timestamp (GPUPass *pass) |
GPUPass Cache | |
Internal shader cache: This prevent the shader recompilation / stall when using undo/redo AND also allows for GPUPass reuse if the Shader code is the same for 2 different Materials. Unused GPUPasses are free by Garbage collection. | |
| static GPUPassCache * | g_cache = nullptr |
| void | GPU_pass_ensure_its_ready (GPUPass *pass) |
| void | GPU_pass_cache_init () |
| void | GPU_pass_cache_update () |
| void | GPU_pass_cache_wait_for_all () |
| void | GPU_pass_cache_free () |
Convert material node-trees to GLSL.
Definition in file gpu_pass.cc.
| GPUPass * GPU_generate_pass | ( | GPUMaterial * | material, |
| GPUNodeGraph * | graph, | ||
| const char * | debug_name, | ||
| eGPUMaterialEngine | engine, | ||
| bool | deferred_compilation, | ||
| GPUCodegenCallbackFn | finalize_source_cb, | ||
| void * | thunk, | ||
| bool | optimize_graph ) |
Definition at line 365 of file gpu_pass.cc.
References GPUPassCache::add(), blender::gpu::shader::GPUCodegen::create_info, blender::gpu::shader::ShaderCreateInfo::finalize(), g_cache, blender::gpu::shader::GPUCodegen::generate_attribs(), blender::gpu::shader::GPUCodegen::generate_cryptomatte(), blender::gpu::shader::GPUCodegen::generate_graphs(), blender::gpu::shader::GPUCodegen::generate_library(), blender::gpu::shader::GPUCodegen::generate_resources(), blender::gpu::shader::GPUCodegen::generate_uniform_buffer(), GPUPassCache::get(), GPU_generate_pass(), gpu_node_graph_finalize_uniform_attrs(), gpu_node_graph_optimize(), gpu_node_graph_prune_unused(), blender::gpu::shader::GPUCodegen::hash_get(), blender::gpu::shader::GPUCodegen::output, and GPUPass::refcount.
Referenced by GPU_generate_pass(), GPU_material_from_callbacks(), and GPU_material_from_nodetree().
| void GPU_pass_acquire | ( | GPUPass * | pass | ) |
Definition at line 178 of file gpu_pass.cc.
References BLI_assert, GPU_pass_acquire(), GPUPass::refcount, and UNUSED_VARS_NDEBUG.
Referenced by GPU_material_from_nodetree(), and GPU_pass_acquire().
| void GPU_pass_cache_free | ( | ) |
Definition at line 337 of file gpu_pass.cc.
References g_cache, and GPU_pass_cache_free().
Referenced by GPU_exit(), and GPU_pass_cache_free().
| void GPU_pass_cache_init | ( | ) |
Definition at line 321 of file gpu_pass.cc.
References g_cache, and GPU_pass_cache_init().
Referenced by GPU_init(), and GPU_pass_cache_init().
| void GPU_pass_cache_update | ( | ) |
Definition at line 326 of file gpu_pass.cc.
References g_cache, GPU_pass_cache_update(), and GPUPassCache::update().
Referenced by GPU_pass_cache_update(), and GPU_render_step().
| void GPU_pass_cache_wait_for_all | ( | ) |
Definition at line 331 of file gpu_pass.cc.
References g_cache, GPU_pass_cache_wait_for_all(), GPU_shader_batch_wait_for_all(), and GPUPassCache::update().
Referenced by GPU_pass_cache_wait_for_all(), and blender::eevee::Instance::light_bake_irradiance().
Definition at line 197 of file gpu_pass.cc.
References GPUPass::compilation_timestamp, and GPU_pass_compilation_timestamp().
Referenced by GPU_material_compilation_timestamp(), and GPU_pass_compilation_timestamp().
| void GPU_pass_ensure_its_ready | ( | GPUPass * | pass | ) |
Definition at line 311 of file gpu_pass.cc.
References GPUPass::finalize_compilation(), g_cache, GPUPassCache::get_mutex(), GPU_pass_ensure_its_ready(), GPU_PASS_QUEUED, lock, and GPUPass::status.
Referenced by GPU_material_from_nodetree(), and GPU_pass_ensure_its_ready().
| uint64_t GPU_pass_global_compilation_count | ( | ) |
Definition at line 192 of file gpu_pass.cc.
References GPUPass::compilation_counts, and GPU_pass_global_compilation_count().
Referenced by blender::eevee::MaterialModule::begin_sync(), and GPU_pass_global_compilation_count().
| void GPU_pass_release | ( | GPUPass * | pass | ) |
Definition at line 185 of file gpu_pass.cc.
References BLI_assert, GPU_pass_release(), GPUPass::refcount, and UNUSED_VARS_NDEBUG.
Referenced by GPU_pass_release(), and GPUMaterial::~GPUMaterial().
| GPUShader * GPU_pass_shader_get | ( | GPUPass * | pass | ) |
Definition at line 173 of file gpu_pass.cc.
References GPU_pass_shader_get(), and GPUPass::shader.
Referenced by GPU_material_get_shader(), GPU_pass_shader_get(), blender::draw::detail::PassBase< DrawCommandBufType >::material_set(), and blender::eevee::CapturePipeline::surface_material_add().
| bool GPU_pass_should_optimize | ( | GPUPass * | pass | ) |
Definition at line 159 of file gpu_pass.cc.
References GPU_backend_get_type(), GPU_BACKEND_METAL, GPU_pass_should_optimize(), and GPUPass::should_optimize.
Referenced by GPU_material_from_callbacks(), GPU_material_from_nodetree(), GPU_material_optimization_status(), and GPU_pass_should_optimize().
| eGPUPassStatus GPU_pass_status | ( | GPUPass * | pass | ) |
Definition at line 154 of file gpu_pass.cc.
References GPU_pass_status(), and GPUPass::status.
Referenced by GPU_material_optimization_status(), GPU_material_status(), and GPU_pass_status().
|
static |
Definition at line 348 of file gpu_pass.cc.
References GPU_max_textures(), GPU_max_textures_frag(), GPU_max_textures_vert(), gpu_pass_validate(), blender::gpu::shader::ShaderCreateInfo::resources_get_all_(), and blender::gpu::shader::ShaderCreateInfo::Resource::SAMPLER.
Referenced by GPUPass::finalize_compilation(), and gpu_pass_validate().
|
static |
Definition at line 309 of file gpu_pass.cc.
Referenced by GPU_generate_pass(), GPU_pass_cache_free(), GPU_pass_cache_init(), GPU_pass_cache_update(), GPU_pass_cache_wait_for_all(), and GPU_pass_ensure_its_ready().