38#include <condition_variable>
44#define USE_DEFERRED_COMPILATION 1
75 static ListBase compilation_threadpool_ = {};
76 return compilation_threadpool_;
82 return compiler_data_;
119 if (use_parallel_compilation) {
256 if (is_optimization_job) {
323 while (link && link->
hash_code <= attr->hash_code) {
327 new_link->
prev = new_link->
next =
nullptr;
384 const bool is_volume_shader,
418 const bool is_volume_shader,
436 pass_replacement_cb);
#define BLI_assert_unreachable()
A dynamically sized string ADT.
bool BLI_ghash_ensure_p(GHash *gh, void *key, void ***r_val) ATTR_WARN_UNUSED_RESULT
#define LISTBASE_FOREACH(type, var, list)
void BLI_insertlinkbefore(struct ListBase *listbase, void *vnextlink, void *vnewlink) ATTR_NONNULL(1)
void BLI_threadpool_init(struct ListBase *threadbase, void *(*do_thread)(void *), int tot)
void BLI_threadpool_end(struct ListBase *threadbase)
void BLI_threadpool_insert(struct ListBase *threadbase, void *callerdata)
Platform independent time functions.
void BLI_time_sleep_ms(int ms)
#define POINTER_FROM_UINT(i)
ID * DEG_get_original_id(ID *id)
Object is a sort of wrapper for general info.
bool GPU_use_parallel_compilation()
bool GPU_use_main_context_workaround()
GPUContext * GPU_context_create(void *ghost_window, void *ghost_context)
void GPU_context_discard(GPUContext *)
void GPU_context_active_set(GPUContext *)
bool GPU_material_async_try_finalize(GPUMaterial *mat)
void GPU_material_acquire(GPUMaterial *mat)
void GPU_material_compile(GPUMaterial *mat)
void GPU_material_async_compile(GPUMaterial *mat)
void GPU_material_status_set(GPUMaterial *mat, eGPUMaterialStatus status)
const ListBase * GPU_material_layer_attributes(const GPUMaterial *material)
void GPU_material_optimize(GPUMaterial *mat)
bool GPU_material_optimization_ready(GPUMaterial *mat)
void GPU_material_release(GPUMaterial *mat)
eGPUMaterialStatus GPU_material_status(GPUMaterial *mat)
GPUMaterial * GPU_material_from_nodetree(Scene *scene, Material *ma, bNodeTree *ntree, ListBase *gpumaterials, const char *name, eGPUMaterialEngine engine, uint64_t shader_uuid, bool is_volume_shader, bool is_lookdev, GPUCodegenCallbackFn callback, void *thunk, GPUMaterialPassReplacementCallbackFn pass_replacement_cb=nullptr)
void(*)(void *thunk, GPUMaterial *mat, GPUCodegenOutput *codegen) GPUCodegenCallbackFn
@ GPU_MAT_OPTIMIZATION_READY
@ GPU_MAT_OPTIMIZATION_QUEUED
@ GPU_MAT_OPTIMIZATION_SUCCESS
@ GPU_MAT_OPTIMIZATION_SKIP
GPUPass *(*)(void *thunk, GPUMaterial *mat) GPUMaterialPassReplacementCallbackFn
void GPU_material_optimization_status_set(GPUMaterial *mat, eGPUMaterialOptimizationStatus status)
eGPUMaterialOptimizationStatus GPU_material_optimization_status(GPUMaterial *mat)
void GPU_shader_free(GPUShader *shader)
struct GPUContext GPUContext
struct GPUShader GPUShader
int64_t remove_if(Predicate &&predicate)
void append(const T &value)
void remove_first_occurrence_and_reorder(const T &value)
DEGForeachIDComponentCallback callback
bool DRW_state_is_image_render()
char datatoc_gpu_shader_depth_only_frag_glsl[]
GPUMaterial * DRW_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)
void DRW_shader_free(GPUShader *shader)
void DRW_shader_queue_optimize_material(GPUMaterial *mat)
static void drw_deferred_queue_append(GPUMaterial *mat, bool is_optimization_job)
void DRW_deferred_shader_optimize_remove(GPUMaterial *mat)
char datatoc_common_fullscreen_vert_glsl[]
static void * drw_deferred_shader_compilation_exec(void *)
GPUMaterial * DRW_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)
static ListBase & compilation_threadpool()
static DRWShaderCompiler & compiler_data()
static void drw_deferred_shader_add(GPUMaterial *mat, bool deferred)
static void drw_register_shader_vlattrs(GPUMaterial *mat)
void *(* MEM_dupallocN)(const void *vmemh)
unsigned __int64 uint64_t
GHash * vlattrs_name_cache
ListBase vlattrs_name_list
GPUContext * blender_gpu_context
void * system_gpu_context
Vector< GPUMaterial * > queue
GPUContext * blender_gpu_context
std::condition_variable queue_cv
void * system_gpu_context
Vector< GPUMaterial * > optimize_queue
void * DRW_deferred_shader_remove
void * WM_system_gpu_context_create()
void WM_system_gpu_context_dispose(void *context)
void WM_system_gpu_context_activate(void *context)
void WM_system_gpu_context_release(void *context)