Blender  V3.3
render_types.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2001-2002 NaN Holding BV. All rights reserved. */
3 
8 #pragma once
9 
10 /* ------------------------------------------------------------------------- */
11 /* exposed internal in render module only! */
12 /* ------------------------------------------------------------------------- */
13 
14 #include "DNA_object_types.h"
15 #include "DNA_scene_types.h"
16 
17 #include "BLI_threads.h"
18 
19 #include "BKE_main.h"
20 
21 #include "RE_pipeline.h"
22 
23 struct GHash;
24 struct Depsgraph;
25 struct GSet;
26 struct Main;
27 struct Object;
28 struct RenderEngine;
29 struct ReportList;
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 typedef struct HighlightedTile {
38 
39 /* controls state of render, everything that's read-only during render stage */
40 struct Render {
41  struct Render *next, *prev;
43  int slot;
44 
45  /* state settings */
46  short flag, ok, result_ok;
47 
48  /* result of rendering */
50  /* if render with single-layer option, other rendered layers are stored here */
54  /* read/write mutex, all internal code that writes to re->result must use a
55  * write lock, all external code must use a read lock. internal code is assumed
56  * to not conflict with writes, so no lock used for that */
58 
59  /* Guard for drawing render result using engine's `draw()` callback. */
61 
65  int winx, winy;
66  rcti disprect; /* part within winx winy */
67  rctf viewplane; /* mapped on winx winy */
68 
69  /* final picture width and height (within disprect) */
70  int rectx, recty;
71 
72  /* Camera transform, only used by Freestyle. */
73  float winmat[4][4];
74 
75  /* Clipping. */
76  float clip_start;
77  float clip_end;
78 
79  /* main, scene, and its full copy of renderdata and world */
80  struct Main *main;
86 
89 
90  /* render engine */
92 
93  /* NOTE: This is a minimal dependency graph and evaluated scene which is enough to access view
94  * layer visibility and use for postprocessing (compositor and sequencer). */
97 
98  /* callbacks */
99  void (*display_init)(void *handle, RenderResult *rr);
100  void *dih;
101  void (*display_clear)(void *handle, RenderResult *rr);
102  void *dch;
103  void (*display_update)(void *handle, RenderResult *rr, rcti *rect);
104  void *duh;
105  void (*current_scene_update)(void *handle, struct Scene *scene);
106  void *suh;
107 
108  void (*stats_draw)(void *handle, RenderStats *ri);
109  void *sdh;
110  void (*progress)(void *handle, float i);
111  void *prh;
112 
113  void (*draw_lock)(void *handle, bool lock);
114  void *dlh;
115  int (*test_break)(void *handle);
116  void *tbh;
117 
119 
121 
124 
125  /* TODO: replace by a whole draw manager. */
126  void *gl_context;
127  void *gpu_context;
128 };
129 
130 /* **************** defines ********************* */
131 
133 #define R_ANIMATION 1
134 
135 #ifdef __cplusplus
136 }
137 #endif
struct GSet GSet
Definition: BLI_ghash.h:340
pthread_rwlock_t ThreadRWMutex
Definition: BLI_threads.h:125
pthread_mutex_t ThreadMutex
Definition: BLI_threads.h:82
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:35
#define MAX_NAME
Definition: DNA_defs.h:48
Object is a sort of wrapper for general info.
#define RE_MAXNAME
Definition: RE_pipeline.h:36
volatile int lock
SyclQueue void void size_t num_bytes void
struct HighlightedTile HighlightedTile
Definition: BKE_main.h:121
ThreadMutex engine_draw_mutex
Definition: render_types.h:60
void(* current_scene_update)(void *handle, struct Scene *scene)
Definition: render_types.h:105
int recty
Definition: render_types.h:70
void * dch
Definition: render_types.h:102
float winmat[4][4]
Definition: render_types.h:73
struct Render * prev
Definition: render_types.h:41
void * sdh
Definition: render_types.h:109
void(* progress)(void *handle, float i)
Definition: render_types.h:110
Scene * pipeline_scene_eval
Definition: render_types.h:96
void * duh
Definition: render_types.h:104
void * prh
Definition: render_types.h:111
RenderResult * result
Definition: render_types.h:49
RenderResult * pushedresult
Definition: render_types.h:51
float clip_start
Definition: render_types.h:76
RenderData r
Definition: render_types.h:82
int winy
Definition: render_types.h:65
struct RenderEngine * engine
Definition: render_types.h:91
int slot
Definition: render_types.h:43
struct Main * main
Definition: render_types.h:80
void * dih
Definition: render_types.h:100
float clip_end
Definition: render_types.h:77
short ok
Definition: render_types.h:46
int active_view_layer
Definition: render_types.h:84
struct GSet * highlighted_tiles
Definition: render_types.h:88
void * dlh
Definition: render_types.h:114
Scene * scene
Definition: render_types.h:81
ListBase fullresult
Definition: render_types.h:53
int rectx
Definition: render_types.h:70
struct Depsgraph * pipeline_depsgraph
Definition: render_types.h:95
void(* display_update)(void *handle, RenderResult *rr, rcti *rect)
Definition: render_types.h:103
short result_ok
Definition: render_types.h:46
short flag
Definition: render_types.h:46
ThreadRWMutex resultmutex
Definition: render_types.h:57
char viewname[MAX_NAME]
Definition: render_types.h:123
struct Render * next
Definition: render_types.h:41
RenderStats i
Definition: render_types.h:118
void * tbh
Definition: render_types.h:116
void ** movie_ctx_arr
Definition: render_types.h:122
int winx
Definition: render_types.h:65
void(* display_init)(void *handle, RenderResult *rr)
Definition: render_types.h:99
void(* draw_lock)(void *handle, bool lock)
Definition: render_types.h:113
void(* stats_draw)(void *handle, RenderStats *ri)
Definition: render_types.h:108
void(* display_clear)(void *handle, RenderResult *rr)
Definition: render_types.h:101
rctf viewplane
Definition: render_types.h:67
int(* test_break)(void *handle)
Definition: render_types.h:115
ThreadMutex highlighted_tiles_mutex
Definition: render_types.h:87
void * suh
Definition: render_types.h:106
struct ReportList * reports
Definition: render_types.h:120
rcti disprect
Definition: render_types.h:66
struct Object * camera_override
Definition: render_types.h:85
void * gl_context
Definition: render_types.h:126
ListBase view_layers
Definition: render_types.h:83
char name[RE_MAXNAME]
Definition: render_types.h:42
void * gpu_context
Definition: render_types.h:127