|
Blender V4.3
|
Go to the source code of this file.
Functions | |
| GPUPass * | GPU_generate_pass (GPUMaterial *material, GPUNodeGraph *graph, eGPUMaterialEngine engine, GPUCodegenCallbackFn finalize_source_cb, void *thunk, bool optimize_graph) |
| GPUShader * | GPU_pass_shader_get (GPUPass *pass) |
| bool | GPU_pass_compile (GPUPass *pass, const char *shname) |
| void | GPU_pass_acquire (GPUPass *pass) |
| void | GPU_pass_release (GPUPass *pass) |
| bool | GPU_pass_should_optimize (GPUPass *pass) |
| GPUShaderCreateInfo * | GPU_pass_begin_compilation (GPUPass *pass, const char *shname) |
| bool | GPU_pass_finalize_compilation (GPUPass *pass, GPUShader *shader) |
| void | GPU_pass_begin_async_compilation (GPUPass *pass, const char *shname) |
| bool | GPU_pass_async_compilation_try_finalize (GPUPass *pass) |
| void | gpu_codegen_init () |
| void | gpu_codegen_exit () |
Generate shader code from the intermediate node graph.
Definition in file gpu_codegen.hh.
| void gpu_codegen_exit | ( | ) |
Definition at line 1045 of file gpu_codegen.cc.
References BKE_material_defaults_free_gpu(), and GPU_shader_free_builtin_shaders().
Referenced by GPU_exit().
| void gpu_codegen_init | ( | ) |
Definition at line 1043 of file gpu_codegen.cc.
Referenced by GPU_init().
| GPUPass * GPU_generate_pass | ( | GPUMaterial * | material, |
| GPUNodeGraph * | graph, | ||
| eGPUMaterialEngine | engine, | ||
| GPUCodegenCallbackFn | finalize_source_cb, | ||
| void * | thunk, | ||
| bool | optimize_graph ) |
Cache lookup: Reuse shaders already compiled. NOTE: We only perform cache look-up for non-optimized shader graphs, as baked constant data among other optimizations will generate too many shader source permutations, with minimal re-usability.
Definition at line 705 of file gpu_codegen.cc.
References BLI_mutex_init(), BLI_spin_lock(), BLI_spin_unlock(), GPUCodegen::create_info, GPUCodegenOutput::create_info, blender::gpu::shader::ShaderCreateInfo::finalize(), GPUCodegen::generate_attribs(), GPUCodegen::generate_cryptomatte(), GPUCodegen::generate_graphs(), GPUCodegen::generate_library(), GPUCodegen::generate_resources(), GPUCodegen::generate_uniform_buffer(), gpu_node_graph_finalize_uniform_attrs(), gpu_node_graph_optimize(), gpu_node_graph_prune_unused(), gpu_pass_cache_insert_after(), gpu_pass_cache_lookup(), gpu_pass_cache_resolve_collision(), gpu_pass_is_valid(), GPUPass::hash, GPUCodegen::hash_get(), MEM_callocN, GPUPass::next, GPUCodegen::output, pass_cache_spin, GPUPass::refcount, and GPUCodegen::should_optimize_heuristic().
Referenced by GPU_material_from_callbacks(), GPU_material_from_nodetree(), and GPU_material_optimize().
| void GPU_pass_acquire | ( | GPUPass * | pass | ) |
Definition at line 976 of file gpu_codegen.cc.
References BLI_assert, BLI_spin_lock(), BLI_spin_unlock(), and pass_cache_spin.
Referenced by GPU_material_from_nodetree().
| bool GPU_pass_async_compilation_try_finalize | ( | GPUPass * | pass | ) |
NOTE: Unlike the non-async version, this one returns true when compilation has finalized, regardless if it succeeded or not. To check for success, see if GPU_pass_shader_get() != nullptr.
Definition at line 923 of file gpu_codegen.cc.
References BLI_assert, BLI_mutex_lock(), BLI_mutex_unlock(), GPU_pass_finalize_compilation(), GPU_shader_batch_finalize(), and GPU_shader_batch_is_ready().
Referenced by GPU_material_async_try_finalize().
| void GPU_pass_begin_async_compilation | ( | GPUPass * | pass, |
| const char * | shname ) |
Definition at line 905 of file gpu_codegen.cc.
References BLI_assert, BLI_mutex_lock(), BLI_mutex_unlock(), GPU_pass_begin_compilation(), and GPU_shader_batch_create_from_infos().
Referenced by GPU_material_async_compile().
| GPUShaderCreateInfo * GPU_pass_begin_compilation | ( | GPUPass * | pass, |
| const char * | shname ) |
Definition at line 873 of file gpu_codegen.cc.
Referenced by GPU_pass_begin_async_compilation(), and GPU_pass_compile().
| bool GPU_pass_compile | ( | GPUPass * | pass, |
| const char * | shname ) |
Definition at line 940 of file gpu_codegen.cc.
References BLI_mutex_lock(), BLI_mutex_unlock(), GPU_pass_begin_compilation(), GPU_pass_finalize_compilation(), GPU_shader_batch_finalize(), and GPU_shader_create_from_info().
Referenced by GPU_material_compile(), and GPU_material_optimize().
Definition at line 885 of file gpu_codegen.cc.
References gpu_pass_shader_validate(), and GPU_shader_free().
Referenced by GPU_pass_async_compilation_try_finalize(), and GPU_pass_compile().
| void GPU_pass_release | ( | GPUPass * | pass | ) |
Definition at line 984 of file gpu_codegen.cc.
References BLI_assert, BLI_spin_lock(), BLI_spin_unlock(), gpu_pass_free(), and pass_cache_spin.
Referenced by gpu_material_finalize(), GPU_material_free_single(), and GPU_material_optimize().
Definition at line 960 of file gpu_codegen.cc.
Referenced by DRW_shgroup_material_create(), drw_shgroup_material_create_ex(), GPU_material_async_try_finalize(), gpu_material_finalize(), GPU_material_from_callbacks(), GPU_material_from_nodetree(), GPU_material_get_shader(), GPU_material_get_shader_base(), GPU_material_optimize(), blender::draw::detail::PassBase< DrawCommandBufType >::material_set(), and blender::eevee::CapturePipeline::surface_material_add().
| bool GPU_pass_should_optimize | ( | GPUPass * | pass | ) |
Definition at line 816 of file gpu_codegen.cc.
References GPU_backend_get_type(), and GPU_BACKEND_METAL.
Referenced by GPU_material_from_nodetree().