117 memset(dst, 0x0, offsetof(
DRWManager, gl_context));
125 static void drw_state_ensure_not_reused(
DRWManager *dst)
127 memset(dst, 0xff, offsetof(
DRWManager, gl_context));
212 if (embm && embm->mesh_eval_final ==
NULL) {
216 if (embm && embm->mesh_eval_cage && (embm->mesh_eval_cage != embm->mesh_eval_final)) {
327 bool use_render_settings =
false;
328 bool use_view_transform =
false;
333 bool use_scene_lights = (!v3d ||
338 bool use_scene_world = (!v3d ||
344 use_render_settings = v3d && ((use_workbench && use_view_transform) || use_scene_lights ||
357 use_render_settings =
true;
363 const bool display_color_channel = (display_channels_mode &
SNODE_SHOW_ALPHA) == 0;
364 if (display_color_channel) {
365 use_render_settings =
true;
369 use_render_settings =
true;
370 use_view_transform =
false;
373 if (use_render_settings) {
378 else if (use_view_transform) {
412 const void *engine_type_v,
int *r_fbl_len,
int *r_txl_len,
int *r_psl_len,
int *r_stl_len)
658 rctf region_space = {0.0f, 1.0f, 0.0f, 1.0f};
664 winmat[3][0] = -1.0f;
665 winmat[3][1] = -1.0f;
749 void **dupli_datas = val;
790 if (sled->engine_type == engine_type) {
791 return sled->storage;
887 if (drawdata ==
NULL) {
892 if (dd->engine_type == engine_type) {
920 const size_t t =
sizeof(
float) - 1;
936 if (init_cb !=
NULL) {
948 if (drawdata ==
NULL) {
953 if (dd->free !=
NULL) {
967 if (drawdata ==
NULL) {
985 static int lasttime = 0;
988 if (
U.vbotimeout == 0 || (ctime - lasttime) <
U.vbocollectrate || ctime == lasttime) {
1043 if (
data->text_draw_cache) {
1157 if (
data->text_draw_cache) {
1172 if (
data->info[0] !=
'\0') {
1173 char *chr_current =
data->info;
1174 char *chr_start = chr_current;
1181 BLF_shadow(font_id, 5, (
const float[4]){0.0f, 0.0f, 0.0f, 1.0f});
1184 while (*chr_current++ !=
'\0') {
1186 if (*chr_current ==
'\n') {
1187 char info[GPU_INFO_SIZE];
1189 *yoffset -= line_height;
1193 chr_start = chr_current + 1;
1198 char info[GPU_INFO_SIZE];
1200 *yoffset -= line_height;
1272 bool gpencil_engine_needed)
1279 if (gpencil_engine_needed && ((drawtype >=
OB_SOLID) || !use_xray)) {
1293 void **engine_handle_array =
BLI_array_alloca(engine_handle_array, enabled_engines + 1);
1298 engine_handle_array[i++] = engine;
1300 engine_handle_array[i] =
NULL;
1353 .view_layer = view_layer,
1354 .obact =
OBACT(view_layer),
1355 .engine_type = engine_type,
1422 if (do_annotations) {
1467 if (
G.debug_value > 20 &&
G.debug_value < 30) {
1548 .view_layer = view_layer,
1549 .obact =
OBACT(view_layer),
1550 .engine_type = engine_type,
1568 const bool do_populate_loop = internal_engine || overlays_on || !draw_type_render ||
1569 gpencil_engine_needed;
1594 if (do_populate_loop) {
1597 if ((object_type_exclude_viewport & (1 << ob->type)) != 0) {
1662 drw_state_ensure_not_reused(&
DST);
1687 const bool is_image_render,
1689 const bool do_color_management,
1695 if (viewport ==
NULL) {
1734 if (viewport ==
NULL) {
1790 .view_layer = view_layer,
1791 .engine_type = engine_type,
1814 render_view = render_view->next) {
1869 .view_layer = view_layer,
1870 .engine_type = engine_type,
1912 render_view = render_view->next) {
1934 drw_state_ensure_not_reused(&
DST);
1951 const int object_type_exclude_viewport = draw_ctx->
v3d ?
1956 if ((object_type_exclude_viewport & (1 << ob->
type)) == 0) {
1996 .view_layer = view_layer,
1997 .engine_type =
NULL,
2004 const int size[2] = {1, 1};
2028 drw_state_ensure_not_reused(&
DST);
2037 float size[2], inv_size[2];
2070 .view_layer = view_layer,
2071 .obact =
OBACT(view_layer),
2113 if (do_populate_loop) {
2157 if (do_annotations) {
2170 if (do_annotations) {
2179 if (do_draw_gizmos) {
2186 if (
G.debug_value > 20 &&
G.debug_value < 30) {
2211 drw_state_ensure_not_reused(&
DST);
2267 bool use_obedit_skip,
2269 bool UNUSED(use_nearest),
2272 void *select_pass_user_data,
2274 void *object_filter_user_data)
2281 #ifndef USE_GPU_SELECT
2289 bool use_obedit =
false;
2294 int object_type = 0;
2295 if (obedit !=
NULL) {
2296 object_type = obedit->
type;
2297 object_mode = obedit->
mode;
2311 if (obpose ==
NULL) {
2317 obpose = ob_armature;
2324 object_type = obpose->
type;
2325 object_mode = obpose->
mode;
2342 else if (!draw_surface) {
2370 .view_layer = view_layer,
2372 .engine_type = engine_type,
2402 bool filter_exclude =
false;
2420 if ((object_type_exclude_select & (1 << ob->type)) == 0) {
2421 if (object_filter_fn !=
NULL) {
2426 filter_exclude = (object_filter_fn(ob, object_filter_user_data) ==
false);
2428 if (filter_exclude) {
2482 drw_state_ensure_not_reused(&
DST);
2498 const bool use_opengl_context)
2505 if (use_opengl_context) {
2518 .view_layer = view_layer,
2519 .obact =
OBACT(view_layer),
2520 .engine_type = engine_type,
2550 if ((object_type_exclude_viewport & (1 << ob->type)) != 0) {
2589 drw_state_ensure_not_reused(&
DST);
2593 if (use_opengl_context) {
2664 .view_layer = view_layer,
2665 .obact =
OBACT(view_layer),
2715 drw_state_ensure_not_reused(&
DST);
2738 const float(*world_clip_planes)[4] =
NULL;
2747 switch (object->
type) {
2751 Mesh *me =
object->data;
2767 if (world_clip_planes !=
NULL) {
2992 if (
type->engine_free) {
2993 type->engine_free();
3024 if (re_gl_context !=
NULL) {
3027 void *re_gpu_context =
NULL;
3046 if (re_gl_context !=
NULL) {
3047 void *re_gpu_context =
NULL;
3170 #ifdef WITH_XR_OPENXR
3181 void *DRW_xr_opengl_context_get(
void)
3187 void *DRW_xr_gpu_context_get(
void)
3193 void DRW_xr_drawing_begin(
void)
3199 void DRW_xr_drawing_end(
void)
3210 #ifdef WITH_OPENGL_DRAW_TESTS
typedef float(TangentPoint)[2]
struct wmWindowManager * CTX_wm_manager(const bContext *C)
struct View3D * CTX_wm_view3d(const bContext *C)
struct Depsgraph * CTX_data_expect_evaluated_depsgraph(const bContext *C)
struct SpaceLink * CTX_wm_space_data(const bContext *C)
struct ARegion * CTX_wm_region(const bContext *C)
void(* BKE_curve_batch_cache_free_cb)(struct Curve *cu)
void(* BKE_curve_batch_cache_dirty_tag_cb)(struct Curve *cu, int mode)
void(* BKE_gpencil_batch_cache_dirty_tag_cb)(struct bGPdata *gpd)
void(* BKE_gpencil_batch_cache_free_cb)(struct bGPdata *gpd)
General operations for hairs.
void(* BKE_hair_batch_cache_free_cb)(struct Hair *hair)
void(* BKE_hair_batch_cache_dirty_tag_cb)(struct Hair *hair, int mode)
void(* BKE_lattice_batch_cache_free_cb)(struct Lattice *lt)
void(* BKE_lattice_batch_cache_dirty_tag_cb)(struct Lattice *lt, int mode)
#define FOREACH_OBJECT_IN_MODE_END
bool BKE_object_is_visible_in_viewport(const struct View3D *v3d, const struct Object *ob)
#define FOREACH_OBJECT_IN_MODE_BEGIN(_view_layer, _v3d, _object_type, _object_mode, _instance)
void(* BKE_mball_batch_cache_dirty_tag_cb)(struct MetaBall *mb, int mode)
void(* BKE_mball_batch_cache_free_cb)(struct MetaBall *mb)
void(* BKE_mesh_batch_cache_dirty_tag_cb)(struct Mesh *me, eMeshBatchDirtyMode mode)
void(* BKE_mesh_batch_cache_free_cb)(struct Mesh *me)
struct Object * BKE_modifiers_is_deformed_by_armature(struct Object *ob)
General operations, lookup, etc. for blender objects.
struct Object * BKE_object_pose_armature_get(struct Object *ob)
int BKE_object_visibility(const struct Object *ob, const int dag_eval_mode)
bool BKE_object_is_in_editmode(const struct Object *ob)
void(* BKE_particle_batch_cache_dirty_tag_cb)(struct ParticleSystem *psys, int mode)
bool psys_in_edit_mode(struct Depsgraph *depsgraph, const struct ParticleSystem *psys)
bool psys_check_enabled(struct Object *ob, struct ParticleSystem *psys, const bool use_render_params)
void(* BKE_particle_batch_cache_free_cb)(struct ParticleSystem *psys)
A BVH for high poly meshes.
General operations for point-clouds.
void(* BKE_pointcloud_batch_cache_free_cb)(struct PointCloud *pointcloud)
void(* BKE_pointcloud_batch_cache_dirty_tag_cb)(struct PointCloud *pointcloud, int mode)
struct Depsgraph * BKE_scene_get_depsgraph(const struct Scene *scene, const struct ViewLayer *view_layer)
bool BKE_scene_uses_blender_workbench(const struct Scene *scene)
void(* BKE_volume_batch_cache_dirty_tag_cb)(struct Volume *volume, int mode)
void(* BKE_volume_batch_cache_free_cb)(struct Volume *volume)
void BLF_draw_default(float x, float y, float z, const char *str, size_t len) ATTR_NONNULL()
void BLF_shadow_offset(int fontid, int x, int y)
void BLF_shadow(int fontid, int level, const float rgba[4]) ATTR_NONNULL(3)
void BLF_disable(int fontid, int option)
void BLF_enable(int fontid, int option)
#define BLI_array_alloca(arr, realsize)
GSet * BLI_gset_ptr_new(const char *info)
void BLI_ghash_free(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
void BLI_gset_free(GSet *gs, GSetKeyFreeFP keyfreefp)
GHash * BLI_ghash_ptr_new(const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
bool BLI_ghash_ensure_p(GHash *gh, void *key, void ***r_val) ATTR_WARN_UNUSED_RESULT
#define LISTBASE_FOREACH(type, var, list)
BLI_INLINE void BLI_listbase_clear(struct ListBase *lb)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void unit_m4(float m[4][4])
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE float normalize_v3_v3(float r[3], const float a[3])
MINLINE void copy_v3_fl(float r[3], float f)
MINLINE void zero_v3(float r[3])
#define BLI_memblock_create(elem_size)
void BLI_memblock_iternew(BLI_memblock *mblk, BLI_memblock_iter *iter) ATTR_NONNULL()
BLI_memblock * BLI_memblock_create_ex(uint elem_size, uint chunk_size) ATTR_WARN_UNUSED_RESULT
void * BLI_memblock_iterstep(BLI_memblock_iter *iter) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void * BLI_memblock_alloc(BLI_memblock *mblk) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void BLI_memblock_clear(BLI_memblock *mblk, MemblockValFreeFP free_callback) ATTR_NONNULL(1)
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
void BLI_rcti_init(struct rcti *rect, int xmin, int xmax, int ymin, int ymax)
void BLI_rctf_transform_calc_m4_pivot_min(const rctf *dst, const rctf *src, float matrix[4][4])
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
bool BLI_rcti_is_empty(const struct rcti *rect)
#define STRNCPY(dst, src)
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, const size_t maxncpy) ATTR_NONNULL()
struct TaskGraph * BLI_task_graph_create(void)
void BLI_task_graph_free(struct TaskGraph *task_graph)
void BLI_task_graph_work_and_wait(struct TaskGraph *task_graph)
void BLI_ticket_mutex_unlock(TicketMutex *ticket)
void BLI_ticket_mutex_lock(TicketMutex *ticket)
void BLI_ticket_mutex_free(TicketMutex *ticket)
int BLI_thread_is_main(void)
TicketMutex * BLI_ticket_mutex_alloc(void)
struct Depsgraph Depsgraph
struct Scene * DEG_get_input_scene(const Depsgraph *graph)
bool DEG_id_type_any_exists(const struct Depsgraph *depsgraph, short id_type)
#define DEG_OBJECT_ITER_FOR_RENDER_ENGINE_BEGIN(graph_, instance_)
bool DEG_is_original_id(const struct ID *id)
struct ViewLayer * DEG_get_evaluated_view_layer(const struct Depsgraph *graph)
#define DEG_OBJECT_ITER_FOR_RENDER_ENGINE_END
struct Object * DEG_get_evaluated_object(const struct Depsgraph *depsgraph, struct Object *object)
struct Scene * DEG_get_evaluated_scene(const struct Depsgraph *graph)
void(* DrawDataFreeCb)(struct DrawData *engine_data)
void(* DrawDataInitCb)(struct DrawData *engine_data)
#define OB_MODE_ALL_WEIGHT_PAINT
#define PSYS_HAIR_DYNAMICS
#define OBPOSE_FROM_OBACT(ob)
#define OBEDIT_FROM_OBACT(ob)
#define OBWEIGHTPAINT_FROM_OBACT(ob)
#define OBACT(_view_layer)
#define V3D_SHOW_ANNOTATION
@ V3D_OVERLAY_EDIT_OCCLUDE_WIRE
#define RV3D_LOCK_FLAGS(rv3d)
#define RV3D_CLIPPING_ENABLED(v3d, rv3d)
#define V3D_HIDE_OVERLAYS
@ V3D_OVERLAY_BONE_SELECT
@ V3D_SHADING_SCENE_WORLD_RENDER
@ V3D_SHADING_SCENE_WORLD
@ V3D_SHADING_SCENE_LIGHTS
@ V3D_SHADING_SCENE_LIGHTS_RENDER
bool(* DRW_ObjectFilterFn)(struct Object *ob, void *user_data)
bool(* DRW_SelectPassFn)(eDRWSelectStage stage, void *user_data)
#define DRW_UBO_FREE_SAFE(ubo)
#define DRW_STATE_DEPTH_TEST_ENABLED
struct DRWContextState DRWContextState
#define DRW_TEXTURE_FREE_SAFE(tex)
void ED_region_pixelspace(struct ARegion *region)
bScreen * ED_screen_animation_playing(const struct wmWindowManager *wm)
const rcti * ED_region_visible_rect(ARegion *region)
#define REGION_DRAW_POST_VIEW
void ED_region_draw_cb_draw(const struct bContext *, struct ARegion *, int)
#define REGION_DRAW_PRE_VIEW
#define XRAY_ENABLED(v3d)
struct RenderEngineType * ED_view3d_engine_type(const struct Scene *scene, int drawtype)
void ED_view3d_init_mats_rv3d(struct Object *ob, struct RegionView3D *rv3d)
void ED_view3d_clipping_local(struct RegionView3D *rv3d, const float mat[4][4])
void GPU_batch_program_set_builtin_with_config(GPUBatch *batch, eGPUBuiltinShader shader_id, eGPUShaderConfig sh_cfg)
#define GPU_batch_uniform_4fv_array(batch, name, len, val)
void GPU_batch_draw(GPUBatch *batch)
bool GPU_use_main_context_workaround(void)
void GPU_context_main_lock(void)
void GPU_context_discard(GPUContext *)
GPUContext * GPU_context_create(void *ghost_window)
void GPU_context_active_set(GPUContext *)
void GPU_context_main_unlock(void)
GPUDrawList * GPU_draw_list_create(int length)
void GPU_draw_list_discard(GPUDrawList *list)
GPUFrameBuffer * GPU_framebuffer_back_get(void)
struct GPUFrameBuffer GPUFrameBuffer
#define GPU_FRAMEBUFFER_FREE_SAFE(fb)
bool GPU_framebuffer_check_valid(GPUFrameBuffer *fb, char err_out[256])
void GPU_framebuffer_restore(void)
GPUFrameBuffer * GPU_framebuffer_active_get(void)
void GPU_framebuffer_bind(GPUFrameBuffer *fb)
GPUFrameBuffer * GPU_framebuffer_create(const char *name)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble t
void GPU_matrix_identity_projection_set(void)
void GPU_matrix_pop_projection(void)
#define GPU_matrix_set(x)
#define GPU_matrix_mul(x)
#define GPU_matrix_projection_set(x)
void GPU_matrix_identity_set(void)
void GPU_matrix_push_projection(void)
@ GPU_SHADER_3D_DEPTH_ONLY
@ GPU_BLEND_ALPHA_PREMULT
void GPU_blend(eGPUBlend blend)
void GPU_apply_state(void)
void GPU_viewport(int x, int y, int width, int height)
void GPU_depth_test(eGPUDepthTest test)
void GPU_clip_distances(int distances_enabled)
int GPU_texture_height(const GPUTexture *tex)
struct GPUTexture GPUTexture
int GPU_texture_width(const GPUTexture *tex)
void GPU_texture_free(GPUTexture *tex)
GPUTexture * GPU_texture_create_2d(const char *name, int w, int h, int mip_len, eGPUTextureFormat format, const float *data)
double * GPU_viewport_cache_time_get(GPUViewport *viewport)
void GPU_viewport_active_view_set(GPUViewport *viewport, int view)
void GPU_viewport_colorspace_set(GPUViewport *viewport, ColorManagedViewSettings *view_settings, ColorManagedDisplaySettings *display_settings, float dither)
void * GPU_viewport_engine_data_get(GPUViewport *viewport, void *engine_handle)
struct DRWInstanceDataList * GPU_viewport_instance_data_list_get(GPUViewport *viewport)
bool GPU_viewport_engines_data_validate(GPUViewport *viewport, void **engine_handle_array)
GPUViewport * GPU_viewport_create(void)
void GPU_viewport_unbind_from_offscreen(GPUViewport *viewport, struct GPUOffScreen *ofs, bool display_colorspace, bool do_overlay_merge)
void * GPU_viewport_texture_list_get(GPUViewport *viewport)
void GPU_viewport_bind_from_offscreen(GPUViewport *viewport, struct GPUOffScreen *ofs)
void GPU_viewport_free(GPUViewport *viewport)
void GPU_viewport_size_set(GPUViewport *viewport, const int size[2])
void GPU_viewport_tag_update(GPUViewport *viewport)
void * GPU_viewport_framebuffer_list_get(GPUViewport *viewport)
void GPU_viewport_cache_release(GPUViewport *viewport)
void * GPU_viewport_engine_data_create(GPUViewport *viewport, void *engine_type)
ViewportMemoryPool * GPU_viewport_mempool_get(GPUViewport *viewport)
void GPU_viewport_size_get(const GPUViewport *viewport, int size[2])
void UI_FontThemeColor(int fontid, int colorid)
void ED_annotation_draw_view2d(const bContext *C, bool onlyv2d)
void ED_annotation_draw_view3d(Scene *scene, struct Depsgraph *depsgraph, View3D *v3d, ARegion *region, bool only3d)
DrawEngineType draw_engine_basic_type
return(oflags[bm->toolflag_index].f &oflag) !=0
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
const Depsgraph * depsgraph
DEGForeachIDComponentCallback callback
void drw_batch_cache_generate_requested(Object *ob)
void DRW_shape_cache_free(void)
void DRW_batch_cache_free_old(Object *ob, int ctime)
void DRW_particle_batch_cache_free(struct ParticleSystem *psys)
void DRW_hair_batch_cache_dirty_tag(struct Hair *hair, int mode)
void DRW_hair_batch_cache_free(struct Hair *hair)
void DRW_mesh_batch_cache_create_requested(struct TaskGraph *task_graph, struct Object *ob, struct Mesh *me, const struct Scene *scene, const bool is_paint_mode, const bool use_hide)
void DRW_curve_batch_cache_free(struct Curve *cu)
void DRW_lattice_batch_cache_free(struct Lattice *lt)
void DRW_gpencil_batch_cache_dirty_tag(struct bGPdata *gpd)
void DRW_lattice_batch_cache_dirty_tag(struct Lattice *lt, int mode)
void DRW_gpencil_batch_cache_free(struct bGPdata *gpd)
void DRW_volume_batch_cache_free(struct Volume *volume)
void DRW_particle_batch_cache_dirty_tag(struct ParticleSystem *psys, int mode)
void DRW_mball_batch_cache_dirty_tag(struct MetaBall *mb, int mode)
void DRW_mesh_batch_cache_dirty_tag(struct Mesh *me, eMeshBatchDirtyMode mode)
void DRW_mball_batch_cache_free(struct MetaBall *mb)
void DRW_pointcloud_batch_cache_dirty_tag(struct PointCloud *pointcloud, int mode)
void DRW_volume_batch_cache_dirty_tag(struct Volume *volume, int mode)
void DRW_pointcloud_batch_cache_free(struct PointCloud *pointcloud)
struct GPUBatch * DRW_mesh_batch_cache_get_edit_triangles(struct Mesh *me)
void DRW_mesh_batch_cache_free(struct Mesh *me)
void DRW_curve_batch_cache_dirty_tag(struct Curve *cu, int mode)
struct GPUBatch * DRW_mesh_batch_cache_get_surface(struct Mesh *me)
void DRW_globals_update(void)
void DRW_globals_free(void)
void DRW_hair_update(void)
void drw_debug_draw(void)
void drw_debug_init(void)
void * DRW_instance_data_next(DRWInstanceData *idata)
void DRW_instance_data_list_free_unused(DRWInstanceDataList *idatalist)
DRWInstanceData * DRW_instance_data_request(DRWInstanceDataList *idatalist, uint attr_size)
GHash * DRW_uniform_attrs_pool_new()
void DRW_instance_buffer_finish(DRWInstanceDataList *idatalist)
void DRW_uniform_attrs_pool_clear_all(GHash *table)
void DRW_instance_data_list_reset(DRWInstanceDataList *idatalist)
void DRW_instance_data_list_resize(DRWInstanceDataList *idatalist)
#define MAX_INSTANCE_DATA_SIZE
void DRW_drawdata_free(ID *id)
const float * DRW_viewport_pixelsize_get(void)
bool DRW_state_is_opengl_render(void)
static void drw_viewport_var_init(void)
struct Object * DRW_object_get_dupli_parent(const Object *UNUSED(ob))
void DRW_opengl_context_create(void)
void DRW_gpu_render_context_enable(void *re_gpu_context)
bool DRW_state_is_playback(void)
static void drw_engines_enable_overlays(void)
void DRW_draw_depth_loop_gpencil(struct Depsgraph *depsgraph, ARegion *region, View3D *v3d, GPUViewport *viewport)
bool DRW_render_check_grease_pencil(Depsgraph *depsgraph)
void ** DRW_duplidata_get(void *vedata)
bool DRW_state_is_select(void)
static void drw_engines_world_update(Scene *scene)
static void drw_engines_draw_text(void)
void DRW_draw_region_engine_info(int xoffset, int *yoffset, int line_height)
static void drw_engines_enable(ViewLayer *UNUSED(view_layer), RenderEngineType *engine_type, bool gpencil_engine_needed)
void DRW_draw_view(const bContext *C)
DrawData * DRW_drawdata_ensure(ID *id, DrawEngineType *engine_type, size_t size, DrawDataInitCb init_cb, DrawDataFreeCb free_cb)
bool DRW_state_show_text(void)
void DRW_draw_select_id(Depsgraph *depsgraph, ARegion *region, View3D *v3d, const rcti *rect)
static void drw_engines_cache_finish(void)
void DRW_engines_free(void)
bool DRW_state_is_navigating(void)
void DRW_opengl_context_enable(void)
bool DRW_state_is_depth(void)
bool DRW_engine_render_support(DrawEngineType *draw_engine_type)
void DRW_draw_select_loop(struct Depsgraph *depsgraph, ARegion *region, View3D *v3d, bool use_obedit_skip, bool draw_surface, bool UNUSED(use_nearest), const rcti *rect, DRW_SelectPassFn select_pass_fn, void *select_pass_user_data, DRW_ObjectFilterFn object_filter_fn, void *object_filter_user_data)
struct IdDdtTemplate IdDdtTemplate
void * DRW_view_layer_engine_data_get(DrawEngineType *engine_type)
static void drw_task_graph_deinit(void)
void ** DRW_view_layer_engine_data_ensure(DrawEngineType *engine_type, void(*callback)(void *storage))
void DRW_notify_view_update(const DRWUpdateContext *update_ctx)
static void drw_engines_init(void)
static void drw_engines_data_validate(void)
bool DRW_object_is_in_edit_mode(const Object *ob)
void DRW_render_viewport_size_set(const int size[2])
static void drw_engines_draw_scene(void)
static void duplidata_value_free(void *val)
void DRW_opengl_render_context_disable(void *re_gl_context)
static void use_drw_engine(DrawEngineType *engine)
DefaultFramebufferList * DRW_viewport_framebuffer_list_get(void)
void DRW_draw_depth_loop(struct Depsgraph *depsgraph, ARegion *region, View3D *v3d, GPUViewport *viewport)
void DRW_render_instance_buffer_finish(void)
static void DRW_render_gpencil_to_image(RenderEngine *engine, struct RenderLayer *render_layer, const rcti *rect)
bool DRW_state_do_color_management(void)
void DRW_engines_register(void)
void DRW_draw_render_loop_ex(struct Depsgraph *depsgraph, RenderEngineType *engine_type, ARegion *region, View3D *v3d, GPUViewport *viewport, const bContext *evil_C)
static void drw_state_prepare_clean_for_draw(DRWManager *dst)
bool DRW_object_is_renderable(const Object *ob)
void DRW_opengl_context_disable_ex(bool restore)
static void drw_context_state_init(void)
void DRW_cache_free_old_batches(Main *bmain)
void DRW_draw_render_loop_offscreen(struct Depsgraph *depsgraph, RenderEngineType *engine_type, ARegion *region, View3D *v3d, const bool is_image_render, const bool draw_background, const bool do_color_management, GPUOffScreen *ofs, GPUViewport *viewport)
void DRW_render_gpencil(struct RenderEngine *engine, struct Depsgraph *depsgraph)
void * drw_viewport_engine_data_ensure(void *engine_type)
void DRW_draw_depth_object(Scene *scene, ARegion *region, View3D *v3d, GPUViewport *viewport, Object *object)
void ** DRW_view_layer_engine_data_ensure_ex(ViewLayer *view_layer, DrawEngineType *engine_type, void(*callback)(void *storage))
int DRW_object_visibility_in_active_context(const Object *ob)
void DRW_draw_callbacks_post_scene(void)
static void drw_engines_enable_basic(void)
static bool drw_draw_show_annotation(void)
bool DRW_state_draw_support(void)
void DRW_render_context_disable(Render *render)
bool DRW_state_is_fbo(void)
static void drw_duplidata_load(DupliObject *dupli)
struct DupliObject * DRW_object_get_dupli(const Object *UNUSED(ob))
static void drw_engines_cache_populate(Object *ob)
bool DRW_object_is_visible_psys_in_active_context(const Object *object, const ParticleSystem *psys)
const DRWContextState * DRW_context_state_get(void)
void DRW_render_to_image(RenderEngine *engine, struct Depsgraph *depsgraph)
void DRW_draw_callbacks_pre_scene(void)
static void drw_draw_depth_loop_impl(struct Depsgraph *depsgraph, ARegion *region, View3D *v3d, GPUViewport *viewport, const bool use_opengl_context)
bool DRW_state_draw_background(void)
static void draw_unit_state_create(void)
bool DRW_object_is_flat_normal(const Object *ob)
static void drw_engines_enable_from_engine(const RenderEngineType *engine_type, eDrawType drawtype)
static void drw_engines_enable_editors(void)
void DRW_opengl_context_enable_ex(bool UNUSED(restore))
void DRW_opengl_render_context_enable(void *re_gl_context)
void DRW_cache_restart(void)
DrawData * DRW_drawdata_get(ID *id, DrawEngineType *engine_type)
static void drw_engines_cache_init(void)
static void draw_render_result_ensure_pass_cb(void *user_data, struct Scene *UNUSED(scene), struct ViewLayer *view_layer, const char *name, int channels, const char *chanid, eNodeSocketDatatype UNUSED(type))
static void drw_task_graph_init(void)
const float * DRW_viewport_size_get(void)
void DRW_draw_render_loop_2d_ex(struct Depsgraph *depsgraph, ARegion *region, GPUViewport *viewport, const bContext *evil_C)
static bool drw_gpencil_engine_needed(Depsgraph *depsgraph, View3D *v3d)
bool DRW_object_use_hide_faces(const struct Object *ob)
void DRW_engine_register(DrawEngineType *draw_engine_type)
static struct DRWSelectBuffer g_select_buffer
const float * DRW_viewport_screenvecs_get(void)
void DRW_opengl_context_disable(void)
void DRW_render_set_time(RenderEngine *engine, Depsgraph *depsgraph, int frame, float subframe)
static void drw_engines_disable(void)
bool DRW_state_is_image_render(void)
void DRW_opengl_context_destroy(void)
void DRW_custom_pipeline(DrawEngineType *draw_engine_type, struct Depsgraph *depsgraph, void(*callback)(void *vedata, void *user_data), void *user_data)
const float * DRW_viewport_invert_size_get(void)
DrawDataList * DRW_drawdatalist_from_id(ID *id)
static void drw_duplidata_free(void)
static bool id_can_have_drawdata(const ID *id)
void DRW_engine_viewport_data_size_get(const void *engine_type_v, int *r_fbl_len, int *r_txl_len, int *r_psl_len, int *r_stl_len)
void DRW_render_context_enable(Render *render)
static ListBase DRW_engines
static void drw_viewport_colormanagement_set(void)
void DRW_gpu_render_context_disable(void *UNUSED(re_gpu_context))
bool DRW_state_is_scene_render(void)
static void draw_select_framebuffer_depth_only_setup(const int size[2])
void DRW_viewport_request_redraw(void)
struct DRWTextStore * DRW_text_cache_ensure(void)
DefaultTextureList * DRW_viewport_texture_list_get(void)
void DRW_render_object_iter(void *vedata, RenderEngine *engine, struct Depsgraph *depsgraph, void(*callback)(void *vedata, Object *ob, RenderEngine *engine, struct Depsgraph *depsgraph))
static void drw_drawdata_unlink_dupli(ID *id)
static void drw_viewport_cache_resize(void)
void DRW_draw_render_loop(struct Depsgraph *depsgraph, ARegion *region, View3D *v3d, GPUViewport *viewport)
static bool id_type_can_have_drawdata(const short id_type)
#define PROFILE_END_UPDATE(time_update, time_start)
#define PROFILE_START(time_start)
#define DRW_RESOURCE_CHUNK_LEN
struct DRWObjectInfos DRWObjectInfos
struct DRWObjectMatrix DRWObjectMatrix
BLI_INLINE void DRW_handle_increment(DRWResourceHandle *handle)
struct DRWCullingState DRWCullingState
void drw_resource_buffer_finish(ViewportMemoryPool *vmempool)
DRWView * DRW_view_create(const float viewmat[4][4], const float winmat[4][4], const float(*culling_viewmat)[4], const float(*culling_winmat)[4], DRWCallVisibilityFn *visibility_fn)
void DRW_view_clip_planes_set(DRWView *view, float(*planes)[4], int plane_len)
void DRW_view_camtexco_set(DRWView *view, float texco[4])
void DRW_view_reset(void)
void DRW_state_reset(void)
void DRW_state_lock(DRWState state)
void DRW_select_load_id(uint id)
void DRW_stats_begin(void)
void DRW_stats_group_start(const char *name)
void DRW_stats_reset(void)
void DRW_stats_draw(const rcti *rect)
void DRW_stats_group_end(void)
void DRW_stats_free(void)
void DRW_text_cache_draw(DRWTextStore *dt, ARegion *region, struct View3D *v3d)
DRWTextStore * DRW_text_cache_create(void)
void DRW_text_cache_destroy(struct DRWTextStore *dt)
void DRW_draw_cursor_2d(void)
void DRW_draw_gizmo_2d(void)
void DRW_draw_region_info(void)
void DRW_draw_gizmo_3d(void)
RenderEngineType DRW_engine_viewport_eevee_type
void RE_engine_frame_set(RenderEngine *engine, int frame, float subframe)
void RE_engine_update_render_passes(struct RenderEngine *engine, struct Scene *scene, struct ViewLayer *view_layer, update_render_passes_cb_t callback, void *callback_data)
void RE_engine_add_pass(RenderEngine *engine, const char *name, int channels, const char *chan_id, const char *layername)
void RE_engines_register(RenderEngineType *render_type)
RenderResult * RE_engine_get_result(RenderEngine *engine)
void RE_engine_end_result(RenderEngine *engine, RenderResult *result, bool cancel, bool highlight, bool merge_results)
RenderResult * RE_engine_begin_result(RenderEngine *engine, int x, int y, int w, int h, const char *layername, const char *viewname)
RenderEngineType DRW_engine_viewport_external_type
DrawEngineType draw_engine_gpencil_type
void GPU_framebuffer_texture_attach(GPUFrameBuffer *fb, GPUTexture *tex, int slot, int mip)
void GPU_clear_color(float red, float green, float blue, float alpha)
void GPU_offscreen_bind(GPUOffScreen *ofs, bool save)
DrawEngineType draw_engine_image_type
void RE_GetViewPlane(Render *re, rctf *r_viewplane, rcti *r_disprect)
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_mallocN)(size_t len, const char *str)
void drw_batch_cache_validate(Object *custom)
DrawEngineType draw_engine_overlay_type
void * RE_gpu_context_get(Render *re)
void * RE_gl_context_get(Render *re)
RenderLayer * RE_GetRenderLayer(RenderResult *rr, const char *name)
void RE_SetActiveRenderView(Render *re, const char *viewname)
DrawEngineType draw_engine_select_type
struct SELECTID_Context * DRW_select_engine_context_get(void)
struct SpaceLink * space_data
const struct bContext * evil_C
struct Depsgraph * depsgraph
struct ViewLayer * view_layer
struct Object * object_pose
struct Object * object_edit
struct RegionView3D * rv3d
struct DupliObject * dupli_source
DRWResourceHandle ob_handle
DRWResourceHandle pass_handle
struct TaskGraph * task_graph
bool buffer_finish_called
DRWResourceHandle resource_handle
struct DRWTextStore ** text_store_p
DRWInstanceData * object_instance_data[MAX_INSTANCE_DATA_SIZE]
struct Object * dupli_parent
struct GSet * delayed_extraction
struct GHash * dupli_ghash
ViewportMemoryPool * vmempool
struct GPUFrameBuffer * default_framebuffer
struct DRWManager::@295 options
struct Object * dupli_origin
DRWInstanceDataList * idatalist
TicketMutex * gl_context_mutex
struct GPUFrameBuffer * framebuffer_depth_only
struct GPUTexture * texture_depth
struct RenderEngineType * engine_type
struct ViewLayer * view_layer
struct Depsgraph * depsgraph
struct GPUUniformBuf * block_ubo
struct GPUTexture * weight_ramp
struct GPUUniformBuf * view_ubo
struct GPUFrameBuffer * depth_only_fb
struct GPUFrameBuffer * overlay_fb
struct GPUFrameBuffer * default_fb
struct DrawEngineType * engine_type
void(* store_metadata)(void *vedata, struct RenderResult *render_result)
void(* cache_populate)(void *vedata, struct Object *ob)
void(* id_update)(void *vedata, struct ID *id)
void(* render_to_image)(void *vedata, struct RenderEngine *engine, struct RenderLayer *layer, const struct rcti *rect)
void(* engine_init)(void *vedata)
const DrawEngineDataSize * vedata_size
void(* draw_scene)(void *vedata)
void(* view_update)(void *vedata)
void(* cache_init)(void *vedata)
void(* cache_finish)(void *vedata)
DefaultFramebufferList * fbl
struct BMEditMesh * edit_mesh
struct PointCache * pointcache
struct DrawEngineType * draw_engine
struct ToolSettings * toolsettings
ColorManagedViewSettings view_settings
ColorManagedDisplaySettings display_settings
int object_type_exclude_select
int object_type_exclude_viewport
struct DrawEngineType * engine_type
struct ViewLayerEngineData * next
void(* free)(void *storage)
struct BLI_memblock * commands_small
struct BLI_memblock * obmats
struct BLI_memblock * cullstates
struct BLI_memblock * views
struct BLI_memblock * obinfos
struct BLI_memblock * passes
struct BLI_memblock * images
struct GHash * obattrs_ubo_pool
struct BLI_memblock * callbuffers
struct BLI_memblock * shgroups
struct BLI_memblock * commands
struct BLI_memblock * uniforms
double PIL_check_seconds_timer(void)
static void draw_background(const rcti *rect)
GPUViewport * WM_draw_region_get_viewport(ARegion *region)
GPUViewport * WM_draw_region_get_bound_viewport(ARegion *region)
void WM_init_opengl(void)
void wmOrtho2(float x1, float x2, float y1, float y2)
void * WM_opengl_context_create(void)
void wm_window_reset_drawable(void)
void WM_opengl_context_activate(void *context)
void WM_opengl_context_release(void *context)
void WM_opengl_context_dispose(void *context)
RenderEngineType DRW_engine_viewport_workbench_type