Blender V4.3
gpu_codegen.hh File Reference
#include "GPU_material.hh"
#include "GPU_shader.hh"

Go to the source code of this file.

Functions

GPUPassGPU_generate_pass (GPUMaterial *material, GPUNodeGraph *graph, eGPUMaterialEngine engine, GPUCodegenCallbackFn finalize_source_cb, void *thunk, bool optimize_graph)
 
GPUShaderGPU_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 ()
 

Detailed Description

Generate shader code from the intermediate node graph.

Definition in file gpu_codegen.hh.

Function Documentation

◆ gpu_codegen_exit()

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().

◆ gpu_codegen_init()

void gpu_codegen_init ( )

Definition at line 1043 of file gpu_codegen.cc.

Referenced by GPU_init().

◆ GPU_generate_pass()

◆ GPU_pass_acquire()

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().

◆ GPU_pass_async_compilation_try_finalize()

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().

◆ GPU_pass_begin_async_compilation()

void GPU_pass_begin_async_compilation ( GPUPass * pass,
const char * shname )

◆ GPU_pass_begin_compilation()

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().

◆ GPU_pass_compile()

◆ GPU_pass_finalize_compilation()

bool GPU_pass_finalize_compilation ( GPUPass * pass,
GPUShader * shader )

◆ GPU_pass_release()

void GPU_pass_release ( GPUPass * pass)

◆ GPU_pass_shader_get()

◆ GPU_pass_should_optimize()

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().