Blender V4.3
eevee_lightcache.cc File Reference
#include <mutex>
#include "DRW_render.hh"
#include "BKE_global.hh"
#include "BKE_lightprobe.h"
#include "DNA_lightprobe_types.h"
#include "BLI_threads.h"
#include "BLI_time.h"
#include "DEG_depsgraph_build.hh"
#include "DEG_depsgraph_query.hh"
#include "GPU_capabilities.hh"
#include "GPU_context.hh"
#include "WM_api.hh"
#include "WM_types.hh"
#include "wm_window.hh"
#include "eevee_engine.h"
#include "eevee_instance.hh"
#include "eevee_lightcache.hh"

Go to the source code of this file.

Classes

class  blender::eevee::LightBake
 

Namespaces

namespace  blender
 
namespace  blender::eevee
 

Functions

Light Bake Job
wmJobEEVEE_NEXT_lightbake_job_create (wmWindowManager *wm, wmWindow *win, Main *bmain, ViewLayer *view_layer, Scene *scene, blender::Vector< Object * > original_probes, std::string &report, int delay_ms, int frame)
 
void * EEVEE_NEXT_lightbake_job_data_alloc (Main *bmain, ViewLayer *view_layer, Scene *scene, blender::Vector< Object * > original_probes, std::string &report, int frame)
 
void EEVEE_NEXT_lightbake_job_data_free (void *job_data)
 
void EEVEE_NEXT_lightbake_update (void *job_data)
 
void EEVEE_NEXT_lightbake_job (void *job_data, wmJobWorkerStatus *worker_status)
 

Detailed Description

Contains everything about light baking.

Definition in file eevee_lightcache.cc.

Function Documentation

◆ EEVEE_NEXT_lightbake_job()

void EEVEE_NEXT_lightbake_job ( void * job_data,
wmJobWorkerStatus * worker_status )

Do the full light baking for all samples. Will call EEVEE_NEXT_lightbake_update() on finish.

Definition at line 361 of file eevee_lightcache.cc.

References wmJobWorkerStatus::do_update, wmJobWorkerStatus::progress, and wmJobWorkerStatus::stop.

Referenced by EEVEE_NEXT_lightbake_job_create(), and lightprobe_cache_bake_exec().

◆ EEVEE_NEXT_lightbake_job_create()

wmJob * EEVEE_NEXT_lightbake_job_create ( wmWindowManager * wm,
wmWindow * win,
Main * bmain,
ViewLayer * view_layer,
Scene * scene,
blender::Vector< Object * > original_probes,
std::string & report,
int delay_ms,
int frame )

Create the job description. This is called for asynchronous (modal) bake operator. The actual work will be done by EEVEE_NEXT_lightbake_job(). IMPORTANT: Must run on the main thread because of potential GPUContext creation.

Definition at line 297 of file eevee_lightcache.cc.

References EEVEE_NEXT_lightbake_job(), EEVEE_NEXT_lightbake_job_data_free(), EEVEE_NEXT_lightbake_update(), G, NA_EDITED, NC_SCENE, WM_JOB_EXCL_RENDER, WM_JOB_PRIORITY, WM_JOB_PROGRESS, WM_JOB_TYPE_LIGHT_BAKE, WM_JOB_TYPE_RENDER, WM_jobs_callbacks(), WM_jobs_customdata_set(), WM_jobs_get(), WM_jobs_stop_type(), WM_jobs_test(), and WM_jobs_timer().

Referenced by lightprobe_cache_bake_invoke().

◆ EEVEE_NEXT_lightbake_job_data_alloc()

void * EEVEE_NEXT_lightbake_job_data_alloc ( Main * bmain,
ViewLayer * view_layer,
Scene * scene,
blender::Vector< Object * > original_probes,
std::string & report,
int frame )

Allocate dependency graph and job description (EEVEE_NEXT_LightBake). Dependency graph evaluation does not happen here. It is delayed until EEVEE_NEXT_lightbake_job runs. IMPORTANT: Must run on the main thread because of potential GPUContext creation. Return EEVEE_NEXT_LightBake * but cast to void * because of compatibility with existing EEVEE function.

Definition at line 338 of file eevee_lightcache.cc.

Referenced by lightprobe_cache_bake_exec().

◆ EEVEE_NEXT_lightbake_job_data_free()

void EEVEE_NEXT_lightbake_job_data_free ( void * job_data)

Free the job data. NOTE: Does not free the GPUContext. This is the responsibility of EEVEE_NEXT_lightbake_job()

Definition at line 351 of file eevee_lightcache.cc.

Referenced by EEVEE_NEXT_lightbake_job_create(), and lightprobe_cache_bake_exec().

◆ EEVEE_NEXT_lightbake_update()

void EEVEE_NEXT_lightbake_update ( void * job_data)

Callback for updating original scene light cache with bake result. Run by the job system for each update step and the finish step. This is called manually by EEVEE_NEXT_lightbake_job() if not run from a job.

Definition at line 356 of file eevee_lightcache.cc.

References update().

Referenced by EEVEE_NEXT_lightbake_job_create(), and lightprobe_cache_bake_exec().