Blender V5.0
gpu_pass.cc File Reference
#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)
GPUPassGPU_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
GPUPassStatus GPU_pass_status (GPUPass *pass)
bool GPU_pass_should_optimize (GPUPass *pass)
blender::gpu::ShaderGPU_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 GPUPassCacheg_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 ()

Detailed Description

Convert material node-trees to GLSL.

Definition in file gpu_pass.cc.

Function Documentation

◆ GPU_generate_pass()

◆ GPU_pass_acquire()

void GPU_pass_acquire ( GPUPass * pass)

Definition at line 180 of file gpu_pass.cc.

References BLI_assert, GPUPass::refcount, and UNUSED_VARS_NDEBUG.

Referenced by GPU_material_from_nodetree().

◆ GPU_pass_cache_free()

void GPU_pass_cache_free ( )

Definition at line 314 of file gpu_pass.cc.

References g_cache.

Referenced by GPU_exit().

◆ GPU_pass_cache_init()

void GPU_pass_cache_init ( )

Definition at line 298 of file gpu_pass.cc.

References g_cache.

Referenced by GPU_init().

◆ GPU_pass_cache_update()

void GPU_pass_cache_update ( )

Definition at line 303 of file gpu_pass.cc.

References g_cache.

Referenced by GPU_render_step().

◆ GPU_pass_cache_wait_for_all()

void GPU_pass_cache_wait_for_all ( )

◆ GPU_pass_compilation_timestamp()

uint64_t GPU_pass_compilation_timestamp ( GPUPass * pass)

Definition at line 199 of file gpu_pass.cc.

References GPUPass::compilation_timestamp.

Referenced by GPU_material_compilation_timestamp().

◆ GPU_pass_ensure_its_ready()

void GPU_pass_ensure_its_ready ( GPUPass * pass)

◆ GPU_pass_global_compilation_count()

uint64_t GPU_pass_global_compilation_count ( )

Definition at line 194 of file gpu_pass.cc.

References GPUPass::compilation_counts.

Referenced by blender::eevee::MaterialModule::begin_sync().

◆ GPU_pass_release()

void GPU_pass_release ( GPUPass * pass)

Definition at line 187 of file gpu_pass.cc.

References BLI_assert, GPUPass::refcount, and UNUSED_VARS_NDEBUG.

Referenced by GPUMaterial::~GPUMaterial().

◆ GPU_pass_shader_get()

◆ GPU_pass_should_optimize()

bool GPU_pass_should_optimize ( GPUPass * pass)

◆ GPU_pass_status()

GPUPassStatus GPU_pass_status ( GPUPass * pass)

Definition at line 161 of file gpu_pass.cc.

References GPUPass::status.

Referenced by GPU_material_optimization_status(), and GPU_material_status().

◆ gpu_pass_validate()

Variable Documentation

◆ g_cache