Blender V4.3
draw_manager_shader.cc File Reference
#include "DNA_material_types.h"
#include "DNA_object_types.h"
#include "DNA_world_types.h"
#include "BLI_dynstr.h"
#include "BLI_listbase.h"
#include "BLI_map.hh"
#include "BLI_string_utils.hh"
#include "BLI_threads.h"
#include "BLI_time.h"
#include "BKE_context.hh"
#include "BKE_global.hh"
#include "BKE_main.hh"
#include "DEG_depsgraph_query.hh"
#include "GPU_capabilities.hh"
#include "GPU_material.hh"
#include "GPU_shader.hh"
#include "WM_api.hh"
#include "WM_types.hh"
#include "wm_window.hh"
#include "draw_manager_c.hh"
#include <atomic>
#include <condition_variable>
#include <mutex>

Go to the source code of this file.

Classes

struct  DRWShaderCompiler
 

Macros

#define USE_DEFERRED_COMPILATION   1
 

Functions

Deferred Compilation (DRW_deferred)

Since compiling shader can take a long time, we do it in a non blocking manner in another thread.

static ListBasecompilation_threadpool ()
 
static DRWShaderCompilercompiler_data ()
 
static void * drw_deferred_shader_compilation_exec (void *)
 
void DRW_shader_init ()
 
void DRW_shader_exit ()
 
static void drw_deferred_queue_append (GPUMaterial *mat, bool is_optimization_job)
 
static void drw_deferred_shader_add (GPUMaterial *mat, bool deferred)
 
static void drw_register_shader_vlattrs (GPUMaterial *mat)
 
void DRW_deferred_shader_remove (GPUMaterial *mat)
 
void DRW_deferred_shader_optimize_remove (GPUMaterial *mat)
 
GPUMaterialDRW_shader_from_world (World *wo, bNodeTree *ntree, eGPUMaterialEngine engine, const uint64_t shader_id, const bool is_volume_shader, bool deferred, GPUCodegenCallbackFn callback, void *thunk)
 
GPUMaterialDRW_shader_from_material (Material *ma, bNodeTree *ntree, eGPUMaterialEngine engine, const uint64_t shader_id, const bool is_volume_shader, bool deferred, GPUCodegenCallbackFn callback, void *thunk, GPUMaterialPassReplacementCallbackFn pass_replacement_cb)
 
void DRW_shader_queue_optimize_material (GPUMaterial *mat)
 
void DRW_shader_free (GPUShader *shader)
 

Variables

char datatoc_gpu_shader_depth_only_frag_glsl []
 
char datatoc_common_fullscreen_vert_glsl []
 

Macro Definition Documentation

◆ USE_DEFERRED_COMPILATION

#define USE_DEFERRED_COMPILATION   1

Definition at line 44 of file draw_manager_shader.cc.

Function Documentation

◆ compilation_threadpool()

static ListBase & compilation_threadpool ( )
static

NOTE: While the BLI_threads API requires a List, we only create a single thread at application startup and delete it at exit.

Definition at line 73 of file draw_manager_shader.cc.

Referenced by DRW_shader_exit(), and DRW_shader_init().

◆ compiler_data()

◆ drw_deferred_queue_append()

static void drw_deferred_queue_append ( GPUMaterial * mat,
bool is_optimization_job )
static

◆ drw_deferred_shader_add()

◆ drw_deferred_shader_compilation_exec()

◆ DRW_deferred_shader_optimize_remove()

◆ DRW_deferred_shader_remove()

void DRW_deferred_shader_remove ( GPUMaterial * mat)

Definition at line 336 of file draw_manager_shader.cc.

◆ drw_register_shader_vlattrs()

◆ DRW_shader_exit()

◆ DRW_shader_free()

void DRW_shader_free ( GPUShader * shader)

Definition at line 488 of file draw_manager_shader.cc.

References GPU_shader_free().

◆ DRW_shader_from_material()

◆ DRW_shader_from_world()

◆ DRW_shader_init()

◆ DRW_shader_queue_optimize_material()

Variable Documentation

◆ datatoc_common_fullscreen_vert_glsl

char datatoc_common_fullscreen_vert_glsl[]

Definition at line 42 of file draw_manager_shader.cc.

◆ datatoc_gpu_shader_depth_only_frag_glsl

char datatoc_gpu_shader_depth_only_frag_glsl[]

Definition at line 41 of file draw_manager_shader.cc.