Blender V5.0
render_opengl.cc File Reference
#include <condition_variable>
#include <cstddef>
#include <cstring>
#include "MEM_guardedalloc.h"
#include "BLI_bitmap.h"
#include "BLI_fileops.h"
#include "BLI_listbase.h"
#include "BLI_math_color_blend.h"
#include "BLI_mutex.hh"
#include "BLI_string_utf8.h"
#include "BLI_task.h"
#include "BLI_task.hh"
#include "BLI_utildefines.h"
#include "BLI_vector.hh"
#include "DNA_anim_types.h"
#include "DNA_curve_types.h"
#include "DNA_gpencil_legacy_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "BKE_anim_data.hh"
#include "BKE_camera.h"
#include "BKE_context.hh"
#include "BKE_customdata.hh"
#include "BKE_fcurve.hh"
#include "BKE_global.hh"
#include "BKE_image.hh"
#include "BKE_image_format.hh"
#include "BKE_image_save.hh"
#include "BKE_lib_query.hh"
#include "BKE_main.hh"
#include "BKE_report.hh"
#include "BKE_scene.hh"
#include "DEG_depsgraph.hh"
#include "DEG_depsgraph_query.hh"
#include "DRW_engine.hh"
#include "WM_api.hh"
#include "WM_types.hh"
#include "ED_gpencil_legacy.hh"
#include "ED_screen.hh"
#include "ED_view3d.hh"
#include "ED_view3d_offscreen.hh"
#include "IMB_imbuf.hh"
#include "IMB_imbuf_types.hh"
#include "MOV_write.hh"
#include "RE_pipeline.h"
#include "BLT_translation.hh"
#include "RNA_access.hh"
#include "RNA_define.hh"
#include "SEQ_render.hh"
#include "ANIM_action_legacy.hh"
#include "GPU_context.hh"
#include "GPU_framebuffer.hh"
#include "GPU_matrix.hh"
#include "GPU_state.hh"
#include "GPU_viewport.hh"
#include "CLG_log.h"
#include "render_intern.hh"

Go to the source code of this file.

Classes

struct  OGLRender
struct  WriteTaskData

Macros

#define MAX_SCHEDULED_FRAMES   8

Functions

static bool screen_opengl_is_multiview (OGLRender *oglrender)
static void screen_opengl_views_setup (OGLRender *oglrender)
static void screen_opengl_render_doit (OGLRender *oglrender, RenderResult *rr)
static void screen_opengl_render_write (OGLRender *oglrender)
static void UNUSED_FUNCTION addAlphaOverFloat (float dest[4], const float source[4])
static void screen_opengl_render_apply (OGLRender *oglrender)
static void gather_frames_to_render_for_adt (const OGLRender *oglrender, const AnimData *adt)
static void gather_frames_to_render_for_grease_pencil (const OGLRender *oglrender, const bGPdata *gp)
static int gather_frames_to_render_for_id (LibraryIDLinkCallbackData *cb_data)
static void gather_frames_to_render (bContext *C, OGLRender *oglrender)
static bool screen_opengl_render_init (bContext *C, wmOperator *op)
static void screen_opengl_render_end (OGLRender *oglrender)
static void screen_opengl_render_cancel (bContext *C, wmOperator *op)
static bool screen_opengl_render_anim_init (wmOperator *op)
static void write_result (TaskPool *__restrict pool, WriteTaskData *task_data)
static void write_result_func (TaskPool *__restrict pool, void *task_data_v)
static bool schedule_write_result (OGLRender *oglrender, RenderResult *rr)
static bool screen_opengl_render_anim_step (OGLRender *oglrender)
static wmOperatorStatus screen_opengl_render_modal (bContext *C, wmOperator *op, const wmEvent *event)
static void opengl_render_startjob (void *customdata, wmJobWorkerStatus *worker_status)
static void opengl_render_freejob (void *customdata)
static wmOperatorStatus screen_opengl_render_invoke (bContext *C, wmOperator *op, const wmEvent *event)
static wmOperatorStatus screen_opengl_render_exec (bContext *C, wmOperator *op)
static std::string screen_opengl_render_get_description (bContext *, wmOperatorType *, PointerRNA *ptr)
void RENDER_OT_opengl (wmOperatorType *ot)

Variables

static CLG_LogRef LOG = {"render"}

Macro Definition Documentation

◆ MAX_SCHEDULED_FRAMES

#define MAX_SCHEDULED_FRAMES   8

Definition at line 91 of file render_opengl.cc.

Referenced by schedule_write_result().

Function Documentation

◆ addAlphaOverFloat()

void UNUSED_FUNCTION addAlphaOverFloat ( float dest[4],
const float source[4] )
static

Definition at line 453 of file render_opengl.cc.

References addAlphaOverFloat(), and mul().

Referenced by addAlphaOverFloat().

◆ gather_frames_to_render()

void gather_frames_to_render ( bContext * C,
OGLRender * oglrender )
static

Collect the frame numbers for which selected objects have keys in the animation data. The frames ares stored in OGLRender.render_frames.

Note that this follows all pointers to ID blocks, only filtering on ID type, so it will pick up keys from pointers in custom properties as well.

Definition at line 673 of file render_opengl.cc.

References BKE_animdata_from_id(), BKE_library_foreach_ID_link(), BLI_BITMAP_ENABLE, BLI_BITMAP_NEW, C, CTX_DATA_BEGIN, CTX_DATA_END, gather_frames_to_render_for_adt(), gather_frames_to_render_for_id(), IDWALK_RECURSE, PEFRA, PSFRA, OGLRender::render_frames, and RenderJobBase::scene.

Referenced by screen_opengl_render_init().

◆ gather_frames_to_render_for_adt()

◆ gather_frames_to_render_for_grease_pencil()

void gather_frames_to_render_for_grease_pencil ( const OGLRender * oglrender,
const bGPdata * gp )
static

◆ gather_frames_to_render_for_id()

◆ opengl_render_freejob()

void opengl_render_freejob ( void * customdata)
static

Definition at line 1303 of file render_opengl.cc.

References screen_opengl_render_end().

Referenced by screen_opengl_render_invoke().

◆ opengl_render_startjob()

◆ RENDER_OT_opengl()

◆ schedule_write_result()

◆ screen_opengl_is_multiview()

bool screen_opengl_is_multiview ( OGLRender * oglrender)
static

◆ screen_opengl_render_anim_init()

◆ screen_opengl_render_anim_step()

◆ screen_opengl_render_apply()

◆ screen_opengl_render_cancel()

void screen_opengl_render_cancel ( bContext * C,
wmOperator * op )
static

◆ screen_opengl_render_doit()

void screen_opengl_render_doit ( OGLRender * oglrender,
RenderResult * rr )
static

Definition at line 261 of file render_opengl.cc.

References RenderData::alphamode, BKE_camera_multiview_render(), BKE_image_stamp_buf(), BKE_scene_graph_evaluated_ensure(), blend_color_mix_byte(), BLI_assert, OGLRender::bmain, ImBuf::byte_buffer, Scene::camera, View3D::camera, RenderData::cfra, CLOG_ERROR, ImBufByteBuffer::data, ImBufFloatBuffer::data, depsgraph, OGLRender::depsgraph, DRW_gpu_context_disable(), DRW_gpu_context_enable(), ED_annotation_draw_ex(), ED_view3d_draw_offscreen_imbuf(), ED_view3d_draw_offscreen_imbuf_simple(), SpaceSeq::flag, ImBuf::float_buffer, G, G_FLAG_RENDER_VIEWPORT, SpaceSeq::gpd, GPU_backend_get_type(), GPU_BACKEND_METAL, GPU_clear_color(), GPU_clear_depth(), GPU_DATA_UBYTE, GPU_flush(), GPU_matrix_reset(), GPU_matrix_translate_2f(), GPU_offscreen_bind(), GPU_offscreen_read_color(), GPU_offscreen_unbind(), GPU_render_step(), i, IB_byte_data, IB_float_data, OGLRender::ibufs_arr, IMB_allocImBuf(), IMB_byte_from_float(), IMB_dupImBuf(), IMB_free_float_pixels(), IMB_freeImBuf(), OGLRender::is_sequencer, LOG, MEM_freeN(), MEM_mallocN(), OB_SOLID, OGLRender::ofs, RegionView3D::persp, Scene::r, R_ADDSKY, R_ALPHAPREMUL, R_STAMP_ALL, R_STAMP_DRAW, OGLRender::re, RE_GetActiveRenderView(), RE_render_result_rect_from_ibuf(), OGLRender::region, OGLRender::rv3d, RV3D_CAMOB, RenderJobBase::scene, OGLRender::seq_data, SEQ_PREVIEW_SHOW_GPENCIL, View3D::shading, OGLRender::sizex, OGLRender::sizey, SPACE_SEQ, OGLRender::sseq, RenderData::stamp, View3DShading::type, OGLRender::v3d, V3D_OFSDRAW_SHOW_ANNOTATION, OGLRender::view_id, OGLRender::viewport, wmOrtho2(), ImBuf::x, RenderData::xsch, ImBuf::y, and RenderData::ysch.

Referenced by screen_opengl_render_apply().

◆ screen_opengl_render_end()

◆ screen_opengl_render_exec()

◆ screen_opengl_render_get_description()

std::string screen_opengl_render_get_description ( bContext * ,
wmOperatorType * ,
PointerRNA * ptr )
static

Definition at line 1389 of file render_opengl.cc.

References ptr, RNA_boolean_get(), and TIP_.

Referenced by RENDER_OT_opengl().

◆ screen_opengl_render_init()

bool screen_opengl_render_init ( bContext * C,
wmOperator * op )
static

Definition at line 700 of file render_opengl.cc.

References BKE_image_backup_render(), BKE_image_ensure_viewer(), BKE_image_signal(), BKE_imtype_is_movie(), BKE_render_resolution(), BKE_report(), BKE_reportf(), BKE_scene_multiview_num_views_get(), BLI_task_pool_create(), BLI_task_pool_create_background_serial(), OGLRender::bmain, C, Scene::camera, RenderData::cfra, OGLRender::cfrao, OGLRender::color_depth, CTX_data_ensure_evaluated_depsgraph(), CTX_data_main(), CTX_data_scene(), CTX_data_sequencer_scene(), CTX_data_view_layer(), CTX_wm_area(), CTX_wm_area_set(), CTX_wm_manager(), CTX_wm_region(), CTX_wm_region_set(), CTX_wm_screen(), CTX_wm_space_seq(), CTX_wm_view3d(), CTX_wm_window(), CTX_wm_workspace(), RenderJobBase::current_scene, wmOperator::customdata, Scene::customdata_mask, Scene::customdata_mask_modal, CustomData_MeshMasks_update(), OGLRender::depsgraph, ImageFormatData::depth, DRW_gpu_context_disable(), DRW_gpu_context_enable(), ED_view3d_context_activate(), ED_view3d_context_user_region(), ED_view3d_datamask(), G, gather_frames_to_render(), GPU_offscreen_create(), GPU_TEXTURE_USAGE_HOST_READ, GPU_TEXTURE_USAGE_SHADER_READ, GPU_viewport_create(), OGLRender::ibufs_arr, RenderData::im_format, OGLRender::ima, IMA_SIGNAL_FREE, IMA_TYPE_R_RESULT, ImageFormatData::imtype, OGLRender::is_animation, OGLRender::is_sequencer, OGLRender::iuser, MEM_callocN(), OGLRender::ofs, wmOperator::ptr, Scene::r, R_IMF_CHAN_DEPTH_32, OGLRender::re, RE_InitState(), RE_NewSceneRender(), OGLRender::region, ARegion::regiondata, wmOperator::reports, RNA_boolean_get(), RNA_boolean_set(), RPT_ERROR, OGLRender::rv3d, ImageUser::scene, RenderJobBase::scene, screen_opengl_views_setup(), OGLRender::seq_data, OGLRender::sizex, OGLRender::sizey, OGLRender::sseq, OGLRender::task_pool, TASK_PRIORITY_HIGH, OGLRender::v3d, OGLRender::view_layer, Scene::view_layers, OGLRender::viewport, OGLRender::views_len, OGLRender::win, OGLRender::wm, WM_JOB_TYPE_RENDER, WM_jobs_kill_all_except(), WM_jobs_test(), OGLRender::workspace, and OGLRender::write_still.

Referenced by screen_opengl_render_exec(), and screen_opengl_render_invoke().

◆ screen_opengl_render_invoke()

◆ screen_opengl_render_modal()

◆ screen_opengl_render_write()

◆ screen_opengl_views_setup()

◆ write_result()

◆ write_result_func()

void write_result_func ( TaskPool *__restrict pool,
void * task_data_v )
static

Definition at line 1108 of file render_opengl.cc.

References blender::threading::isolate_task(), and write_result().

Referenced by schedule_write_result().

Variable Documentation

◆ LOG

CLG_LogRef LOG = {"render"}
static

Definition at line 87 of file render_opengl.cc.