Blender  V2.93
DRW_render.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * Copyright 2016, Blender Foundation.
17  */
18 
23 /* This is the Render Functions used by Realtime engines to draw with OpenGL */
24 
25 #pragma once
26 
27 #include "DRW_engine_types.h"
28 
29 #include "BLI_listbase.h"
30 #include "BLI_math_matrix.h"
31 #include "BLI_math_vector.h"
32 #include "BLI_string.h"
33 
34 #include "BKE_context.h"
35 #include "BKE_layer.h"
36 #include "BKE_material.h"
37 #include "BKE_scene.h"
38 
39 #include "BLT_translation.h"
40 
41 #include "DNA_light_types.h"
42 #include "DNA_material_types.h"
43 #include "DNA_object_types.h"
44 #include "DNA_scene_types.h"
45 #include "DNA_world_types.h"
46 
47 #include "GPU_framebuffer.h"
48 #include "GPU_primitive.h"
49 #include "GPU_shader.h"
50 #include "GPU_texture.h"
51 #include "GPU_uniform_buffer.h"
52 
53 #include "draw_cache.h"
54 #include "draw_common.h"
55 #include "draw_view.h"
56 
57 #include "draw_debug.h"
58 #include "draw_manager_profiling.h"
59 
60 #include "MEM_guardedalloc.h"
61 
62 #include "RE_engine.h"
63 
64 #include "DEG_depsgraph.h"
65 
66 struct GPUBatch;
67 struct GPUMaterial;
68 struct GPUShader;
69 struct GPUTexture;
70 struct GPUUniformBuf;
71 struct Object;
72 struct ParticleSystem;
73 struct RenderEngineType;
74 struct bContext;
75 struct rcti;
76 
77 typedef struct DRWCallBuffer DRWCallBuffer;
78 typedef struct DRWInterface DRWInterface;
79 typedef struct DRWPass DRWPass;
80 typedef struct DRWShaderLibrary DRWShaderLibrary;
81 typedef struct DRWShadingGroup DRWShadingGroup;
82 typedef struct DRWUniform DRWUniform;
83 typedef struct DRWView DRWView;
84 
85 /* TODO Put it somewhere else? */
86 typedef struct BoundSphere {
87  float center[3], radius;
89 
90 /* declare members as empty (unused) */
91 typedef char DRWViewportEmptyList;
92 
93 #define DRW_VIEWPORT_LIST_SIZE(list) \
94  (sizeof(list) == sizeof(DRWViewportEmptyList) ? 0 : ((sizeof(list)) / sizeof(void *)))
95 
96 /* Unused members must be either pass list or 'char *' when not used. */
97 #define DRW_VIEWPORT_DATA_SIZE(ty) \
98  { \
99  DRW_VIEWPORT_LIST_SIZE(*(((ty *)NULL)->fbl)), DRW_VIEWPORT_LIST_SIZE(*(((ty *)NULL)->txl)), \
100  DRW_VIEWPORT_LIST_SIZE(*(((ty *)NULL)->psl)), \
101  DRW_VIEWPORT_LIST_SIZE(*(((ty *)NULL)->stl)), \
102  }
103 
104 typedef struct DrawEngineDataSize {
105  int fbl_len;
106  int txl_len;
107  int psl_len;
108  int stl_len;
110 
111 typedef struct DrawEngineType {
113 
114  char idname[32];
115 
117 
118  void (*engine_init)(void *vedata);
119  void (*engine_free)(void);
120 
121  void (*cache_init)(void *vedata);
122  void (*cache_populate)(void *vedata, struct Object *ob);
123  void (*cache_finish)(void *vedata);
124 
125  void (*draw_scene)(void *vedata);
126 
127  void (*view_update)(void *vedata);
128  void (*id_update)(void *vedata, struct ID *id);
129 
130  void (*render_to_image)(void *vedata,
131  struct RenderEngine *engine,
132  struct RenderLayer *layer,
133  const struct rcti *rect);
134  void (*store_metadata)(void *vedata, struct RenderResult *render_result);
136 
137 /* Textures */
138 typedef enum {
139  DRW_TEX_FILTER = (1 << 0),
140  DRW_TEX_WRAP = (1 << 1),
141  DRW_TEX_COMPARE = (1 << 2),
142  DRW_TEX_MIPMAP = (1 << 3),
144 
145 /* Textures from DRW_texture_pool_query_* have the options
146  * DRW_TEX_FILTER for color float textures, and no options
147  * for depth textures and integer textures. */
149  int h,
151  DrawEngineType *engine_type);
153  DrawEngineType *engine_type);
154 
157  DRWTextureFlag flags,
158  const float *fpixels);
160  int w, int h, eGPUTextureFormat format, DRWTextureFlag flags, const float *fpixels);
162  int w, int h, int d, eGPUTextureFormat format, DRWTextureFlag flags, const float *fpixels);
164  int w, int h, int d, eGPUTextureFormat format, DRWTextureFlag flags, const float *fpixels);
167  DRWTextureFlag flags,
168  const float *fpixels);
170  int w, int d, eGPUTextureFormat format, DRWTextureFlag flags, const float *fpixels);
171 
174  DRWTextureFlag flags);
176  struct GPUTexture **tex, int w, int h, eGPUTextureFormat format, DRWTextureFlag flags);
177 
179 void DRW_texture_free(struct GPUTexture *tex);
180 #define DRW_TEXTURE_FREE_SAFE(tex) \
181  do { \
182  if (tex != NULL) { \
183  DRW_texture_free(tex); \
184  tex = NULL; \
185  } \
186  } while (0)
187 
188 #define DRW_UBO_FREE_SAFE(ubo) \
189  do { \
190  if (ubo != NULL) { \
191  GPU_uniformbuf_free(ubo); \
192  ubo = NULL; \
193  } \
194  } while (0)
195 
196 /* Shaders */
197 
198 #ifndef __GPU_MATERIAL_H__
199 /* FIXME: Meh avoid including all GPUMaterial. */
200 typedef void (*GPUMaterialEvalCallbackFn)(struct GPUMaterial *mat,
201  int options,
202  const char **vert_code,
203  const char **geom_code,
204  const char **frag_lib,
205  const char **defines);
206 #endif
207 
209  const char *vert, const char *geom, const char *frag, const char *defines, const char *name);
210 struct GPUShader *DRW_shader_create_with_lib_ex(const char *vert,
211  const char *geom,
212  const char *frag,
213  const char *lib,
214  const char *defines,
215  const char *name);
216 struct GPUShader *DRW_shader_create_with_shaderlib_ex(const char *vert,
217  const char *geom,
218  const char *frag,
219  const DRWShaderLibrary *lib,
220  const char *defines,
221  const char *name);
223  const char *geom,
224  const char *defines,
225  const eGPUShaderTFBType prim_type,
226  const char **varying_names,
227  const int varying_count);
228 struct GPUShader *DRW_shader_create_fullscreen_ex(const char *frag,
229  const char *defines,
230  const char *name);
232  const DRWShaderLibrary *lib,
233  const char *defines,
234  const char *name);
235 #define DRW_shader_create(vert, geom, frag, defines) \
236  DRW_shader_create_ex(vert, geom, frag, defines, __func__)
237 #define DRW_shader_create_with_lib(vert, geom, frag, lib, defines) \
238  DRW_shader_create_with_lib_ex(vert, geom, frag, lib, defines, __func__)
239 #define DRW_shader_create_with_shaderlib(vert, geom, frag, lib, defines) \
240  DRW_shader_create_with_shaderlib_ex(vert, geom, frag, lib, defines, __func__)
241 #define DRW_shader_create_fullscreen(frag, defines) \
242  DRW_shader_create_fullscreen_ex(frag, defines, __func__)
243 #define DRW_shader_create_fullscreen_with_shaderlib(frag, lib, defines) \
244  DRW_shader_create_fullscreen_with_shaderlib_ex(frag, lib, defines, __func__)
245 
246 struct GPUMaterial *DRW_shader_find_from_world(struct World *wo,
247  const void *engine_type,
248  const int options,
249  bool deferred);
251  const void *engine_type,
252  const int options,
253  bool deferred);
255  struct World *wo,
256  struct bNodeTree *ntree,
257  const void *engine_type,
258  const int options,
259  const bool is_volume_shader,
260  const char *vert,
261  const char *geom,
262  const char *frag_lib,
263  const char *defines,
264  bool deferred,
267  struct Material *ma,
268  struct bNodeTree *ntree,
269  const void *engine_type,
270  const int options,
271  const bool is_volume_shader,
272  const char *vert,
273  const char *geom,
274  const char *frag_lib,
275  const char *defines,
276  bool deferred,
278 void DRW_shader_free(struct GPUShader *shader);
279 #define DRW_SHADER_FREE_SAFE(shader) \
280  do { \
281  if (shader != NULL) { \
282  DRW_shader_free(shader); \
283  shader = NULL; \
284  } \
285  } while (0)
286 
288 
289 /* Warning: Each library must be added after all its dependencies. */
290 void DRW_shader_library_add_file(DRWShaderLibrary *lib, char *lib_code, const char *lib_name);
291 #define DRW_SHADER_LIB_ADD(lib, lib_name) \
292  DRW_shader_library_add_file(lib, datatoc_##lib_name##_glsl, STRINGIFY(lib_name) ".glsl")
293 
295  const char *shader_code);
296 
298 #define DRW_SHADER_LIB_FREE_SAFE(lib) \
299  do { \
300  if (lib != NULL) { \
301  DRW_shader_library_free(lib); \
302  lib = NULL; \
303  } \
304  } while (0)
305 
306 /* Batches */
307 /* DRWState is a bitmask that stores the current render state and the desired render state. Based
308  * on the differences the minimum state changes can be invoked to setup the desired render state.
309  *
310  * The Write Stencil, Stencil test, Depth test and Blend state options are mutual exclusive
311  * therefore they aren't ordered as a bit mask.*/
312 typedef enum {
316  /* Write Stencil. These options are mutual exclusive and packed into 2 bits */
334 
336  DRW_STATE_BLEND_ADD = (1 << 11),
344  DRW_STATE_BLEND_OIT = (6 << 11),
345  DRW_STATE_BLEND_MUL = (7 << 11),
346  DRW_STATE_BLEND_SUB = (8 << 11),
351 
358 } DRWState;
359 
360 #define DRW_STATE_DEFAULT \
361  (DRW_STATE_WRITE_DEPTH | DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_LESS_EQUAL)
362 #define DRW_STATE_BLEND_ENABLED \
363  (DRW_STATE_BLEND_ADD | DRW_STATE_BLEND_ADD_FULL | DRW_STATE_BLEND_ALPHA | \
364  DRW_STATE_BLEND_ALPHA_PREMUL | DRW_STATE_BLEND_BACKGROUND | DRW_STATE_BLEND_OIT | \
365  DRW_STATE_BLEND_MUL | DRW_STATE_BLEND_SUB | DRW_STATE_BLEND_CUSTOM | DRW_STATE_LOGIC_INVERT)
366 #define DRW_STATE_RASTERIZER_ENABLED \
367  (DRW_STATE_WRITE_DEPTH | DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_STENCIL | \
368  DRW_STATE_WRITE_STENCIL_SHADOW_PASS | DRW_STATE_WRITE_STENCIL_SHADOW_FAIL)
369 #define DRW_STATE_DEPTH_TEST_ENABLED \
370  (DRW_STATE_DEPTH_ALWAYS | DRW_STATE_DEPTH_LESS | DRW_STATE_DEPTH_LESS_EQUAL | \
371  DRW_STATE_DEPTH_EQUAL | DRW_STATE_DEPTH_GREATER | DRW_STATE_DEPTH_GREATER_EQUAL)
372 #define DRW_STATE_STENCIL_TEST_ENABLED \
373  (DRW_STATE_STENCIL_ALWAYS | DRW_STATE_STENCIL_EQUAL | DRW_STATE_STENCIL_NEQUAL)
374 #define DRW_STATE_WRITE_STENCIL_ENABLED \
375  (DRW_STATE_WRITE_STENCIL | DRW_STATE_WRITE_STENCIL_SHADOW_PASS | \
376  DRW_STATE_WRITE_STENCIL_SHADOW_FAIL)
377 
378 typedef enum {
381 } eDRWAttrType;
382 
383 typedef struct DRWInstanceAttrFormat {
384  char name[32];
388 
390  int arraysize);
391 #define DRW_shgroup_instance_format(format, ...) \
392  do { \
393  if (format == NULL) { \
394  DRWInstanceAttrFormat drw_format[] = __VA_ARGS__; \
395  format = DRW_shgroup_instance_format_array( \
396  drw_format, (sizeof(drw_format) / sizeof(DRWInstanceAttrFormat))); \
397  } \
398  } while (0)
399 
404  DRWPass *pass,
405  struct GPUVertBuf *tf_target);
406 
408 
409 /* return final visibility */
410 typedef bool(DRWCallVisibilityFn)(bool vis_in, void *user_data);
411 
413  Object *ob,
414  float (*obmat)[4],
415  struct GPUBatch *geom,
416  bool bypass_culling,
417  void *user_data);
418 
419 /* If ob is NULL, unit modelmatrix is assumed and culling is bypassed. */
420 #define DRW_shgroup_call(shgroup, geom, ob) \
421  DRW_shgroup_call_ex(shgroup, ob, NULL, geom, false, NULL)
422 
423 /* Same as DRW_shgroup_call but override the obmat. Not culled. */
424 #define DRW_shgroup_call_obmat(shgroup, geom, obmat) \
425  DRW_shgroup_call_ex(shgroup, NULL, obmat, geom, false, NULL)
426 
427 /* TODO(fclem): remove this when we have DRWView */
428 /* user_data is used by DRWCallVisibilityFn defined in DRWView. */
429 #define DRW_shgroup_call_with_callback(shgroup, geom, ob, user_data) \
430  DRW_shgroup_call_ex(shgroup, ob, NULL, geom, false, user_data)
431 
432 /* Same as DRW_shgroup_call but bypass culling even if ob is not NULL. */
433 #define DRW_shgroup_call_no_cull(shgroup, geom, ob) \
434  DRW_shgroup_call_ex(shgroup, ob, NULL, geom, true, NULL)
435 
437  DRWShadingGroup *shgroup, Object *ob, struct GPUBatch *geom, uint v_sta, uint v_ct);
439  DRWShadingGroup *shgroup, Object *ob, struct GPUBatch *geom, uint i_sta, uint i_ct);
440 
444 /* Warning: Only use with Shaders that have IN_PLACE_INSTANCES defined. */
446  Object *ob,
447  struct GPUBatch *geom,
448  uint count);
449 /* Warning: Only use with Shaders that have INSTANCED_ATTR defined. */
451  Object *ob,
452  struct GPUBatch *geom,
453  struct GPUBatch *inst_attributes);
454 
455 void DRW_shgroup_call_sculpt(DRWShadingGroup *sh, Object *ob, bool wire, bool mask);
457 
459  struct GPUVertFormat *format,
460  GPUPrimType prim_type);
462  struct GPUVertFormat *format,
463  struct GPUBatch *geom);
464 
465 void DRW_buffer_add_entry_struct(DRWCallBuffer *callbuf, const void *data);
466 void DRW_buffer_add_entry_array(DRWCallBuffer *callbuf, const void *attr[], uint attr_len);
467 
468 #define DRW_buffer_add_entry(buffer, ...) \
469  do { \
470  const void *array[] = {__VA_ARGS__}; \
471  DRW_buffer_add_entry_array(buffer, array, (sizeof(array) / sizeof(*array))); \
472  } while (0)
473 
474 /* Can only be called during iter phase. */
476 
479 
480 /* Reminders:
481  * - (compare_mask & reference) is what is tested against (compare_mask & stencil_value)
482  * stencil_value being the value stored in the stencil buffer.
483  * - (write-mask & reference) is what gets written if the test condition is fulfilled.
484  */
486  uint write_mask,
487  uint reference,
488  uint compare_mask);
489 /* TODO remove this function. Obsolete version. mask is actually reference value. */
491 
492 /* Issue a clear command. */
494  eGPUFrameBufferBits channels,
495  uchar r,
496  uchar g,
497  uchar b,
498  uchar a,
499  float depth,
500  uchar stencil);
501 
503  const char *name,
504  const struct GPUTexture *tex,
505  eGPUSamplerState sampler_state);
507  const char *name,
508  GPUTexture **tex,
509  eGPUSamplerState sampler_state);
511  const char *name,
512  const struct GPUTexture *tex);
514  const char *name,
515  struct GPUTexture **tex);
517  const char *name,
518  const struct GPUUniformBuf *ubo);
520  const char *name,
521  struct GPUUniformBuf **ubo);
523  const char *name,
524  const float *value,
525  int arraysize);
527  const char *name,
528  const float *value,
529  int arraysize);
531  const char *name,
532  const float *value,
533  int arraysize);
535  const char *name,
536  const float *value,
537  int arraysize);
538 /* Boolean are expected to be 4bytes longs for opengl! */
540  const char *name,
541  const int *value,
542  int arraysize);
544  const char *name,
545  const int *value,
546  int arraysize);
548  const char *name,
549  const int *value,
550  int arraysize);
552  const char *name,
553  const int *value,
554  int arraysize);
556  const char *name,
557  const int *value,
558  int arraysize);
559 void DRW_shgroup_uniform_mat3(DRWShadingGroup *shgroup, const char *name, const float (*value)[3]);
560 void DRW_shgroup_uniform_mat4(DRWShadingGroup *shgroup, const char *name, const float (*value)[4]);
561 /* Only to be used when image load store is supported (GPU_shader_image_load_store_support()). */
562 void DRW_shgroup_uniform_image(DRWShadingGroup *shgroup, const char *name, const GPUTexture *tex);
563 void DRW_shgroup_uniform_image_ref(DRWShadingGroup *shgroup, const char *name, GPUTexture **tex);
564 /* Store value instead of referencing it. */
565 void DRW_shgroup_uniform_int_copy(DRWShadingGroup *shgroup, const char *name, const int value);
566 void DRW_shgroup_uniform_ivec2_copy(DRWShadingGroup *shgroup, const char *name, const int *value);
567 void DRW_shgroup_uniform_ivec3_copy(DRWShadingGroup *shgroup, const char *name, const int *value);
568 void DRW_shgroup_uniform_ivec4_copy(DRWShadingGroup *shgroup, const char *name, const int *value);
569 void DRW_shgroup_uniform_bool_copy(DRWShadingGroup *shgroup, const char *name, const bool value);
570 void DRW_shgroup_uniform_float_copy(DRWShadingGroup *shgroup, const char *name, const float value);
571 void DRW_shgroup_uniform_vec2_copy(DRWShadingGroup *shgroup, const char *name, const float *value);
572 void DRW_shgroup_uniform_vec3_copy(DRWShadingGroup *shgroup, const char *name, const float *value);
573 void DRW_shgroup_uniform_vec4_copy(DRWShadingGroup *shgroup, const char *name, const float *value);
575  const char *name,
576  const float (*value)[4],
577  int arraysize);
578 
580 
581 /* Passes */
582 DRWPass *DRW_pass_create(const char *name, DRWState state);
583 DRWPass *DRW_pass_create_instance(const char *name, DRWPass *original, DRWState state);
584 void DRW_pass_link(DRWPass *first, DRWPass *second);
586  void (*callback)(void *userData, DRWShadingGroup *shgroup),
587  void *userData);
588 void DRW_pass_sort_shgroup_z(DRWPass *pass);
590 
591 bool DRW_pass_is_empty(DRWPass *pass);
592 
593 #define DRW_PASS_CREATE(pass, state) (pass = DRW_pass_create(#pass, state))
594 #define DRW_PASS_INSTANCE_CREATE(pass, original, state) \
595  (pass = DRW_pass_create_instance(#pass, (original), state))
596 
597 /* Views */
598 DRWView *DRW_view_create(const float viewmat[4][4],
599  const float winmat[4][4],
600  const float (*culling_viewmat)[4],
601  const float (*culling_winmat)[4],
602  DRWCallVisibilityFn *visibility_fn);
603 DRWView *DRW_view_create_sub(const DRWView *parent_view,
604  const float viewmat[4][4],
605  const float winmat[4][4]);
606 
608  const float viewmat[4][4],
609  const float winmat[4][4],
610  const float (*culling_viewmat)[4],
611  const float (*culling_winmat)[4]);
612 void DRW_view_update_sub(DRWView *view, const float viewmat[4][4], const float winmat[4][4]);
613 
614 const DRWView *DRW_view_default_get(void);
616 void DRW_view_reset(void);
618 
619 void DRW_view_clip_planes_set(DRWView *view, float (*planes)[4], int plane_len);
620 void DRW_view_camtexco_set(DRWView *view, float texco[4]);
621 
622 /* For all getters, if view is NULL, default view is assumed. */
623 void DRW_view_winmat_get(const DRWView *view, float mat[4][4], bool inverse);
624 void DRW_view_viewmat_get(const DRWView *view, float mat[4][4], bool inverse);
625 void DRW_view_persmat_get(const DRWView *view, float mat[4][4], bool inverse);
626 
627 void DRW_view_frustum_corners_get(const DRWView *view, BoundBox *corners);
628 void DRW_view_frustum_planes_get(const DRWView *view, float planes[6][4]);
629 
630 /* These are in view-space, so negative if in perspective.
631  * Extract near and far clip distance from the projection matrix. */
634 bool DRW_view_is_persp_get(const DRWView *view);
635 
636 /* Culling, return true if object is inside view frustum. */
637 bool DRW_culling_sphere_test(const DRWView *view, const BoundSphere *bsphere);
638 bool DRW_culling_box_test(const DRWView *view, const BoundBox *bbox);
639 bool DRW_culling_plane_test(const DRWView *view, const float plane[4]);
640 bool DRW_culling_min_max_test(const DRWView *view, float obmat[4][4], float min[3], float max[3]);
641 
643 void DRW_culling_frustum_planes_get(const DRWView *view, float planes[6][4]);
644 
645 /* Viewport */
646 
647 const float *DRW_viewport_size_get(void);
648 const float *DRW_viewport_invert_size_get(void);
649 const float *DRW_viewport_screenvecs_get(void);
650 const float *DRW_viewport_pixelsize_get(void);
651 
654 
655 void DRW_viewport_request_redraw(void);
656 
657 void DRW_render_to_image(struct RenderEngine *engine, struct Depsgraph *depsgraph);
658 void DRW_render_object_iter(void *vedata,
659  struct RenderEngine *engine,
660  struct Depsgraph *depsgraph,
661  void (*callback)(void *vedata,
662  struct Object *ob,
663  struct RenderEngine *engine,
664  struct Depsgraph *depsgraph));
666 void DRW_render_set_time(struct RenderEngine *engine,
667  struct Depsgraph *depsgraph,
668  int frame,
669  float subframe);
670 void DRW_render_viewport_size_set(const int size[2]);
671 
672 void DRW_custom_pipeline(DrawEngineType *draw_engine_type,
673  struct Depsgraph *depsgraph,
674  void (*callback)(void *vedata, void *user_data),
675  void *user_data);
676 
677 void DRW_cache_restart(void);
678 
679 /* ViewLayers */
681 void **DRW_view_layer_engine_data_ensure_ex(struct ViewLayer *view_layer,
682  DrawEngineType *engine_type,
683  void (*callback)(void *storage));
685  void (*callback)(void *storage));
686 
687 /* DrawData */
688 DrawData *DRW_drawdata_get(ID *id, DrawEngineType *engine_type);
690  DrawEngineType *engine_type,
691  size_t size,
692  DrawDataInitCb init_cb,
693  DrawDataFreeCb free_cb);
694 void **DRW_duplidata_get(void *vedata);
695 
696 /* Settings */
697 bool DRW_object_is_renderable(const struct Object *ob);
698 bool DRW_object_is_in_edit_mode(const struct Object *ob);
700 bool DRW_object_is_flat_normal(const struct Object *ob);
701 bool DRW_object_use_hide_faces(const struct Object *ob);
702 
704  const struct ParticleSystem *psys);
705 
706 struct Object *DRW_object_get_dupli_parent(const struct Object *ob);
707 struct DupliObject *DRW_object_get_dupli(const struct Object *ob);
708 
709 /* Draw commands */
710 void DRW_draw_pass(DRWPass *pass);
711 void DRW_draw_pass_subset(DRWPass *pass, DRWShadingGroup *start_group, DRWShadingGroup *end_group);
712 
715 
717 void DRW_state_reset(void);
719 
720 /* Selection */
721 void DRW_select_load_id(uint id);
722 
723 /* Draw State */
724 bool DRW_state_is_fbo(void);
725 bool DRW_state_is_select(void);
726 bool DRW_state_is_depth(void);
727 bool DRW_state_is_image_render(void);
729 bool DRW_state_is_scene_render(void);
730 bool DRW_state_is_opengl_render(void);
731 bool DRW_state_is_playback(void);
732 bool DRW_state_is_navigating(void);
733 bool DRW_state_show_text(void);
734 bool DRW_state_draw_support(void);
735 bool DRW_state_draw_background(void);
736 
737 /* Avoid too many lookups while drawing */
738 typedef struct DRWContextState {
739 
740  struct ARegion *region; /* 'CTX_wm_region(C)' */
741  struct RegionView3D *rv3d; /* 'CTX_wm_region_view3d(C)' */
742  struct View3D *v3d; /* 'CTX_wm_view3d(C)' */
743  struct SpaceLink *space_data; /* 'CTX_wm_space_data(C)' */
744 
745  struct Scene *scene; /* 'CTX_data_scene(C)' */
746  struct ViewLayer *view_layer; /* 'CTX_data_view_layer(C)' */
747 
748  /* Use 'object_edit' for edit-mode */
749  struct Object *obact; /* 'OBACT' */
750 
752 
754 
756 
758 
760 
763  const struct bContext *evil_C;
764 
765  /* ---- */
766 
767  /* Cache: initialized by 'drw_context_state_init'. */
770 
772 
General operations, lookup, etc. for materials.
unsigned char uchar
Definition: BLI_sys_types.h:86
unsigned int uint
Definition: BLI_sys_types.h:83
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:51
void(* DrawDataFreeCb)(struct DrawData *engine_data)
Definition: DNA_ID.h:45
void(* DrawDataInitCb)(struct DrawData *engine_data)
Definition: DNA_ID.h:44
eObjectMode
Object is a sort of wrapper for general info.
struct GPUTexture * DRW_texture_create_2d(int w, int h, eGPUTextureFormat format, DRWTextureFlag flags, const float *fpixels)
eDRWAttrType
Definition: DRW_render.h:378
@ DRW_ATTR_INT
Definition: DRW_render.h:379
@ DRW_ATTR_FLOAT
Definition: DRW_render.h:380
struct Object * DRW_object_get_dupli_parent(const struct Object *ob)
void DRW_view_frustum_corners_get(const DRWView *view, BoundBox *corners)
DRWShadingGroup * DRW_shgroup_material_create(struct GPUMaterial *material, DRWPass *pass)
const float * DRW_viewport_pixelsize_get(void)
Definition: draw_manager.c:454
float DRW_view_near_distance_get(const DRWView *view)
void DRW_shgroup_uniform_float_copy(DRWShadingGroup *shgroup, const char *name, const float value)
struct DRWInterface DRWInterface
Definition: DRW_render.h:78
bool DRW_state_is_opengl_render(void)
bool() DRWCallVisibilityFn(bool vis_in, void *user_data)
Definition: DRW_render.h:410
struct GPUShader * DRW_shader_create_ex(const char *vert, const char *geom, const char *frag, const char *defines, const char *name)
struct BoundSphere BoundSphere
bool DRW_state_is_playback(void)
DRWShadingGroup * DRW_shgroup_transform_feedback_create(struct GPUShader *shader, DRWPass *pass, struct GPUVertBuf *tf_target)
struct GPUShader * DRW_shader_create_with_transform_feedback(const char *vert, const char *geom, const char *defines, const eGPUShaderTFBType prim_type, const char **varying_names, const int varying_count)
void DRW_shgroup_call_ex(DRWShadingGroup *shgroup, Object *ob, float(*obmat)[4], struct GPUBatch *geom, bool bypass_culling, void *user_data)
void DRW_view_set_active(DRWView *view)
void ** DRW_duplidata_get(void *vedata)
Definition: draw_manager.c:767
void DRW_view_persmat_get(const DRWView *view, float mat[4][4], bool inverse)
void DRW_shgroup_state_disable(DRWShadingGroup *shgroup, DRWState state)
bool DRW_shgroup_is_empty(DRWShadingGroup *shgroup)
bool DRW_state_is_select(void)
char DRWViewportEmptyList
Definition: DRW_render.h:91
void DRW_texture_free(struct GPUTexture *tex)
struct GPUTexture * DRW_texture_pool_query_fullscreen(eGPUTextureFormat format, DrawEngineType *engine_type)
DrawData * DRW_drawdata_ensure(ID *id, DrawEngineType *engine_type, size_t size, DrawDataInitCb init_cb, DrawDataFreeCb free_cb)
Definition: draw_manager.c:899
bool DRW_state_show_text(void)
bool DRW_culling_plane_test(const DRWView *view, const float plane[4])
void DRW_view_frustum_planes_get(const DRWView *view, float planes[6][4])
void DRW_shgroup_uniform_vec4(DRWShadingGroup *shgroup, const char *name, const float *value, int arraysize)
void DRW_shgroup_uniform_ivec3_copy(DRWShadingGroup *shgroup, const char *name, const int *value)
bool DRW_state_is_navigating(void)
bool DRW_state_is_depth(void)
const DRWView * DRW_view_default_get(void)
void DRW_shgroup_call_instances(DRWShadingGroup *shgroup, Object *ob, struct GPUBatch *geom, uint count)
void DRW_shgroup_call_instance_range(DRWShadingGroup *shgroup, Object *ob, struct GPUBatch *geom, uint i_sta, uint i_ct)
void DRW_buffer_add_entry_struct(DRWCallBuffer *callbuf, const void *data)
void DRW_shgroup_stencil_set(DRWShadingGroup *shgroup, uint write_mask, uint reference, uint compare_mask)
void DRW_texture_ensure_2d(struct GPUTexture **tex, int w, int h, eGPUTextureFormat format, DRWTextureFlag flags)
struct GPUTexture * DRW_texture_create_3d(int w, int h, int d, eGPUTextureFormat format, DRWTextureFlag flags, const float *fpixels)
bool DRW_culling_sphere_test(const DRWView *view, const BoundSphere *bsphere)
bool DRW_object_is_visible_psys_in_active_context(const struct Object *object, const struct ParticleSystem *psys)
void DRW_buffer_add_entry_array(DRWCallBuffer *callbuf, const void *attr[], uint attr_len)
struct GPUShader * DRW_shader_create_with_shaderlib_ex(const char *vert, const char *geom, const char *frag, const DRWShaderLibrary *lib, const char *defines, const char *name)
void * DRW_view_layer_engine_data_get(DrawEngineType *engine_type)
Definition: draw_manager.c:787
void DRW_shgroup_state_enable(DRWShadingGroup *shgroup, DRWState state)
void ** DRW_view_layer_engine_data_ensure(DrawEngineType *engine_type, void(*callback)(void *storage))
Definition: draw_manager.c:817
void DRW_shgroup_uniform_ivec2_copy(DRWShadingGroup *shgroup, const char *name, const int *value)
void DRW_pass_link(DRWPass *first, DRWPass *second)
void DRW_render_viewport_size_set(const int size[2])
Definition: draw_manager.c:431
void DRW_shgroup_uniform_vec3_copy(DRWShadingGroup *shgroup, const char *name, const float *value)
void DRW_shgroup_uniform_vec3(DRWShadingGroup *shgroup, const char *name, const float *value, int arraysize)
bool DRW_view_is_persp_get(const DRWView *view)
void DRW_render_to_image(struct RenderEngine *engine, struct Depsgraph *depsgraph)
void DRW_draw_pass(DRWPass *pass)
void DRW_texture_ensure_fullscreen_2d(struct GPUTexture **tex, eGPUTextureFormat format, DRWTextureFlag flags)
DRWPass * DRW_pass_create_instance(const char *name, DRWPass *original, DRWState state)
DRWTextureFlag
Definition: DRW_render.h:138
@ DRW_TEX_MIPMAP
Definition: DRW_render.h:142
@ DRW_TEX_WRAP
Definition: DRW_render.h:140
@ DRW_TEX_FILTER
Definition: DRW_render.h:139
@ DRW_TEX_COMPARE
Definition: DRW_render.h:141
void DRW_render_instance_buffer_finish(void)
bool DRW_state_do_color_management(void)
struct DrawEngineDataSize DrawEngineDataSize
void DRW_shgroup_uniform_ivec2(DRWShadingGroup *shgroup, const char *name, const int *value, int arraysize)
uint32_t DRW_object_resource_id_get(Object *ob)
void DRW_shgroup_call_instances_with_attrs(DRWShadingGroup *shgroup, Object *ob, struct GPUBatch *geom, struct GPUBatch *inst_attributes)
struct DupliObject * DRW_object_get_dupli(const struct Object *ob)
struct GPUTexture * DRW_texture_create_cube(int w, eGPUTextureFormat format, DRWTextureFlag flags, const float *fpixels)
void DRW_shgroup_uniform_texture_ref_ex(DRWShadingGroup *shgroup, const char *name, GPUTexture **tex, eGPUSamplerState sampler_state)
void DRW_shader_library_add_file(DRWShaderLibrary *lib, char *lib_code, const char *lib_name)
struct GPUShader * DRW_shader_create_fullscreen_ex(const char *frag, const char *defines, const char *name)
void DRW_culling_frustum_planes_get(const DRWView *view, float planes[6][4])
struct GPUTexture * DRW_texture_create_cube_array(int w, int d, eGPUTextureFormat format, DRWTextureFlag flags, const float *fpixels)
DRWState
Definition: DRW_render.h:312
@ DRW_STATE_STENCIL_EQUAL
Definition: DRW_render.h:332
@ DRW_STATE_CLIP_PLANES
Definition: DRW_render.h:354
@ DRW_STATE_BLEND_ALPHA
Definition: DRW_render.h:340
@ DRW_STATE_BLEND_ADD
Definition: DRW_render.h:336
@ DRW_STATE_BLEND_BACKGROUND
Definition: DRW_render.h:343
@ DRW_STATE_CULL_FRONT
Definition: DRW_render.h:329
@ DRW_STATE_STENCIL_ALWAYS
Definition: DRW_render.h:331
@ DRW_STATE_DEPTH_LESS
Definition: DRW_render.h:322
@ DRW_STATE_IN_FRONT_SELECT
Definition: DRW_render.h:352
@ DRW_STATE_BLEND_SUB
Definition: DRW_render.h:346
@ DRW_STATE_DEPTH_GREATER_EQUAL
Definition: DRW_render.h:326
@ DRW_STATE_WRITE_STENCIL_SHADOW_FAIL
Definition: DRW_render.h:319
@ DRW_STATE_DEPTH_EQUAL
Definition: DRW_render.h:324
@ DRW_STATE_PROGRAM_POINT_SIZE
Definition: DRW_render.h:357
@ DRW_STATE_WRITE_DEPTH
Definition: DRW_render.h:314
@ DRW_STATE_BLEND_OIT
Definition: DRW_render.h:344
@ DRW_STATE_LOGIC_INVERT
Definition: DRW_render.h:349
@ DRW_STATE_SHADOW_OFFSET
Definition: DRW_render.h:353
@ DRW_STATE_BLEND_ADD_FULL
Definition: DRW_render.h:338
@ DRW_STATE_WRITE_COLOR
Definition: DRW_render.h:315
@ DRW_STATE_BLEND_ALPHA_UNDER_PREMUL
Definition: DRW_render.h:350
@ DRW_STATE_DEPTH_LESS_EQUAL
Definition: DRW_render.h:323
@ DRW_STATE_WRITE_STENCIL_SHADOW_PASS
Definition: DRW_render.h:318
@ DRW_STATE_CULL_BACK
Definition: DRW_render.h:328
@ DRW_STATE_FIRST_VERTEX_CONVENTION
Definition: DRW_render.h:355
@ DRW_STATE_STENCIL_NEQUAL
Definition: DRW_render.h:333
@ DRW_STATE_DEPTH_ALWAYS
Definition: DRW_render.h:321
@ DRW_STATE_BLEND_CUSTOM
Definition: DRW_render.h:348
@ DRW_STATE_BLEND_ALPHA_PREMUL
Definition: DRW_render.h:342
@ DRW_STATE_DEPTH_GREATER
Definition: DRW_render.h:325
@ DRW_STATE_BLEND_MUL
Definition: DRW_render.h:345
@ DRW_STATE_WRITE_STENCIL
Definition: DRW_render.h:317
struct GPUTexture * DRW_texture_pool_query_2d(int w, int h, eGPUTextureFormat format, DrawEngineType *engine_type)
struct DrawEngineType DrawEngineType
int DRW_object_visibility_in_active_context(const struct Object *ob)
struct GPUMaterial * DRW_shader_find_from_world(struct World *wo, const void *engine_type, const int options, bool deferred)
void DRW_culling_frustum_corners_get(const DRWView *view, BoundBox *corners)
struct DefaultFramebufferList * DRW_viewport_framebuffer_list_get(void)
Definition: draw_manager.c:697
struct DRWInstanceAttrFormat DRWInstanceAttrFormat
void DRW_shgroup_uniform_ivec3(DRWShadingGroup *shgroup, const char *name, const int *value, int arraysize)
void DRW_shgroup_uniform_vec4_array_copy(DRWShadingGroup *shgroup, const char *name, const float(*value)[4], int arraysize)
struct GPUTexture * DRW_texture_create_1d(int w, eGPUTextureFormat format, DRWTextureFlag flags, const float *fpixels)
struct GPUTexture * DRW_texture_create_2d_array(int w, int h, int d, eGPUTextureFormat format, DRWTextureFlag flags, const float *fpixels)
void DRW_shgroup_uniform_texture_ref(DRWShadingGroup *shgroup, const char *name, struct GPUTexture **tex)
void DRW_view_winmat_get(const DRWView *view, float mat[4][4], bool inverse)
struct GPUShader * DRW_shader_create_with_lib_ex(const char *vert, const char *geom, const char *frag, const char *lib, const char *defines, const char *name)
void DRW_shgroup_uniform_int_copy(DRWShadingGroup *shgroup, const char *name, const int value)
struct GPUVertFormat * DRW_shgroup_instance_format_array(const DRWInstanceAttrFormat attrs[], int arraysize)
void DRW_pass_sort_shgroup_z(DRWPass *pass)
bool DRW_pass_is_empty(DRWPass *pass)
void DRW_shgroup_uniform_bool(DRWShadingGroup *shgroup, const char *name, const int *value, int arraysize)
void DRW_shgroup_uniform_mat3(DRWShadingGroup *shgroup, const char *name, const float(*value)[3])
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(* GPUMaterialEvalCallbackFn)(struct GPUMaterial *mat, int options, const char **vert_code, const char **geom_code, const char **frag_lib, const char **defines)
Definition: DRW_render.h:200
void DRW_state_reset(void)
void DRW_draw_callbacks_post_scene(void)
void DRW_shgroup_uniform_texture(DRWShadingGroup *shgroup, const char *name, const struct GPUTexture *tex)
void DRW_shgroup_call_procedural_triangles(DRWShadingGroup *sh, Object *ob, uint tri_count)
DRWView * DRW_view_create_sub(const DRWView *parent_view, const float viewmat[4][4], const float winmat[4][4])
void DRW_view_update(DRWView *view, const float viewmat[4][4], const float winmat[4][4], const float(*culling_viewmat)[4], const float(*culling_winmat)[4])
DRWShadingGroup * DRW_shgroup_create(struct GPUShader *shader, DRWPass *pass)
bool DRW_state_draw_support(void)
bool DRW_object_is_flat_normal(const struct Object *ob)
bool DRW_state_is_fbo(void)
void DRW_shader_library_free(DRWShaderLibrary *lib)
void DRW_shgroup_uniform_int(DRWShadingGroup *shgroup, const char *name, const int *value, int arraysize)
void DRW_shgroup_uniform_block_ref(DRWShadingGroup *shgroup, const char *name, struct GPUUniformBuf **ubo)
void ** DRW_view_layer_engine_data_ensure_ex(struct ViewLayer *view_layer, DrawEngineType *engine_type, void(*callback)(void *storage))
Definition: draw_manager.c:797
DRWCallBuffer * DRW_shgroup_call_buffer(DRWShadingGroup *shgroup, struct GPUVertFormat *format, GPUPrimType prim_type)
const DRWContextState * DRW_context_state_get(void)
void DRW_draw_callbacks_pre_scene(void)
bool DRW_state_draw_background(void)
void DRW_shgroup_uniform_ivec4(DRWShadingGroup *shgroup, const char *name, const int *value, int arraysize)
float DRW_view_far_distance_get(const DRWView *view)
void DRW_shgroup_call_sculpt_with_materials(DRWShadingGroup **sh, int num_sh, Object *ob)
void DRW_shgroup_add_material_resources(DRWShadingGroup *grp, struct GPUMaterial *material)
struct GPUMaterial * DRW_shader_create_from_material(struct Scene *scene, struct Material *ma, struct bNodeTree *ntree, const void *engine_type, const int options, const bool is_volume_shader, const char *vert, const char *geom, const char *frag_lib, const char *defines, bool deferred, GPUMaterialEvalCallbackFn callback)
void DRW_shgroup_uniform_texture_ex(DRWShadingGroup *shgroup, const char *name, const struct GPUTexture *tex, eGPUSamplerState sampler_state)
void DRW_cache_restart(void)
DrawData * DRW_drawdata_get(ID *id, DrawEngineType *engine_type)
Definition: draw_manager.c:883
void DRW_view_clip_planes_set(DRWView *view, float(*planes)[4], int plane_len)
void DRW_view_default_set(DRWView *view)
void DRW_shgroup_call_range(DRWShadingGroup *shgroup, Object *ob, struct GPUBatch *geom, uint v_sta, uint v_ct)
void DRW_state_reset_ex(DRWState state)
DRWShadingGroup * DRW_shgroup_create_sub(DRWShadingGroup *shgroup)
void DRW_shgroup_uniform_vec4_copy(DRWShadingGroup *shgroup, const char *name, const float *value)
DRWPass * DRW_pass_create(const char *name, DRWState state)
void DRW_shgroup_clear_framebuffer(DRWShadingGroup *shgroup, eGPUFrameBufferBits channels, uchar r, uchar g, uchar b, uchar a, float depth, uchar stencil)
struct GPUMaterial * DRW_shader_find_from_material(struct Material *ma, const void *engine_type, const int options, bool deferred)
void DRW_shgroup_uniform_bool_copy(DRWShadingGroup *shgroup, const char *name, const bool value)
void DRW_draw_pass_subset(DRWPass *pass, DRWShadingGroup *start_group, DRWShadingGroup *end_group)
const float * DRW_viewport_size_get(void)
Definition: draw_manager.c:439
bool DRW_object_use_hide_faces(const struct Object *ob)
Definition: draw_manager.c:252
void DRW_shgroup_uniform_mat4(DRWShadingGroup *shgroup, const char *name, const float(*value)[4])
void DRW_render_object_iter(void *vedata, struct RenderEngine *engine, struct Depsgraph *depsgraph, void(*callback)(void *vedata, struct Object *ob, struct RenderEngine *engine, struct Depsgraph *depsgraph))
void DRW_shgroup_uniform_image_ref(DRWShadingGroup *shgroup, const char *name, GPUTexture **tex)
void DRW_shader_free(struct GPUShader *shader)
void DRW_shgroup_uniform_float(DRWShadingGroup *shgroup, const char *name, const float *value, int arraysize)
const float * DRW_viewport_screenvecs_get(void)
Definition: draw_manager.c:449
void DRW_pass_foreach_shgroup(DRWPass *pass, void(*callback)(void *userData, DRWShadingGroup *shgroup), void *userData)
void DRW_texture_generate_mipmaps(struct GPUTexture *tex)
struct DRWContextState DRWContextState
DRWShaderLibrary * DRW_shader_library_create(void)
void DRW_shgroup_uniform_vec2_copy(DRWShadingGroup *shgroup, const char *name, const float *value)
bool DRW_state_is_image_render(void)
void DRW_state_lock(DRWState state)
struct DefaultTextureList * DRW_viewport_texture_list_get(void)
Definition: draw_manager.c:702
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)
Definition: draw_manager.c:444
bool DRW_object_is_renderable(const struct Object *ob)
bool DRW_object_is_in_edit_mode(const struct Object *ob)
void DRW_pass_sort_shgroup_reverse(DRWPass *pass)
void DRW_view_update_sub(DRWView *view, const float viewmat[4][4], const float winmat[4][4])
bool DRW_culling_min_max_test(const DRWView *view, float obmat[4][4], float min[3], float max[3])
struct GPUMaterial * DRW_shader_create_from_world(struct Scene *scene, struct World *wo, struct bNodeTree *ntree, const void *engine_type, const int options, const bool is_volume_shader, const char *vert, const char *geom, const char *frag_lib, const char *defines, bool deferred, GPUMaterialEvalCallbackFn callback)
void DRW_shgroup_uniform_vec2(DRWShadingGroup *shgroup, const char *name, const float *value, int arraysize)
bool DRW_culling_box_test(const DRWView *view, const BoundBox *bbox)
void DRW_shgroup_uniform_image(DRWShadingGroup *shgroup, const char *name, const GPUTexture *tex)
void DRW_select_load_id(uint id)
struct GPUShader * DRW_shader_create_fullscreen_with_shaderlib_ex(const char *frag, const DRWShaderLibrary *lib, const char *defines, const char *name)
void DRW_shgroup_call_procedural_points(DRWShadingGroup *sh, Object *ob, uint point_count)
char * DRW_shader_library_create_shader_string(const DRWShaderLibrary *lib, const char *shader_code)
bool DRW_state_is_scene_render(void)
void DRW_shgroup_uniform_ivec4_copy(DRWShadingGroup *shgroup, const char *name, const int *value)
void DRW_view_camtexco_set(DRWView *view, float texco[4])
void DRW_shgroup_stencil_mask(DRWShadingGroup *shgroup, uint mask)
void DRW_viewport_request_redraw(void)
Definition: draw_manager.c:707
void DRW_shgroup_call_sculpt(DRWShadingGroup *sh, Object *ob, bool wire, bool mask)
void DRW_view_reset(void)
void DRW_shgroup_call_procedural_lines(DRWShadingGroup *sh, Object *ob, uint line_count)
void DRW_shgroup_uniform_block(DRWShadingGroup *shgroup, const char *name, const struct GPUUniformBuf *ubo)
void DRW_render_set_time(struct RenderEngine *engine, struct Depsgraph *depsgraph, int frame, float subframe)
DRWCallBuffer * DRW_shgroup_call_buffer_instance(DRWShadingGroup *shgroup, struct GPUVertFormat *format, struct GPUBatch *geom)
void DRW_view_viewmat_get(const DRWView *view, float mat[4][4], bool inverse)
static AppView * view
GPUBatch
Definition: GPU_batch.h:93
eGPUFrameBufferBits
_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 GLdouble r _GL_VOID_RET _GL_VOID GLfloat GLfloat r _GL_VOID_RET _GL_VOID GLint GLint r _GL_VOID_RET _GL_VOID GLshort GLshort r _GL_VOID_RET _GL_VOID GLdouble GLdouble r
GPUPrimType
Definition: GPU_primitive.h:34
struct GPUShader GPUShader
Definition: GPU_shader.h:33
eGPUShaderConfig
Definition: GPU_shader.h:391
eGPUShaderTFBType
Definition: GPU_shader.h:35
eGPUSamplerState
Definition: GPU_texture.h:40
struct GPUTexture GPUTexture
Definition: GPU_texture.h:33
eGPUTextureFormat
Definition: GPU_texture.h:84
struct GPUUniformBuf GPUUniformBuf
struct GPUVertBuf GPUVertBuf
Read Guarded memory(de)allocation.
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition: btDbvt.cpp:52
btMatrix3x3 inverse() const
Return the inverse of the matrix.
Definition: btTransform.h:182
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition: btQuadWord.h:119
CCL_NAMESPACE_BEGIN struct Options options
Scene scene
Material material
const Depsgraph * depsgraph
void * user_data
DEGForeachIDComponentCallback callback
bNodeTree * ntree
DRWShaderLibrary * lib
int count
void KERNEL_FUNCTION_FULL_NAME() shader(KernelGlobals *kg, uint4 *input, float4 *output, int type, int filter, int i, int offset, int sample)
format
Definition: logImageCore.h:47
static ulong state[N]
static unsigned a[3]
Definition: RandGen.cpp:92
#define min(a, b)
Definition: sort.c:51
unsigned int uint32_t
Definition: stdint.h:83
float center[3]
Definition: DRW_render.h:87
float radius
Definition: DRW_render.h:87
struct Object * obact
Definition: DRW_render.h:749
struct Scene * scene
Definition: DRW_render.h:745
struct SpaceLink * space_data
Definition: DRW_render.h:743
const struct bContext * evil_C
Definition: DRW_render.h:763
struct Depsgraph * depsgraph
Definition: DRW_render.h:753
eGPUShaderConfig sh_cfg
Definition: DRW_render.h:759
struct ViewLayer * view_layer
Definition: DRW_render.h:746
eObjectMode object_mode
Definition: DRW_render.h:757
struct TaskGraph * task_graph
Definition: DRW_render.h:755
struct View3D * v3d
Definition: DRW_render.h:742
struct ARegion * region
Definition: DRW_render.h:740
struct Object * object_pose
Definition: DRW_render.h:768
struct RenderEngineType * engine_type
Definition: DRW_render.h:751
struct Object * object_edit
Definition: DRW_render.h:769
struct RegionView3D * rv3d
Definition: DRW_render.h:741
eDRWAttrType type
Definition: DRW_render.h:385
void(* store_metadata)(void *vedata, struct RenderResult *render_result)
Definition: DRW_render.h:134
struct DrawEngineType * prev
Definition: DRW_render.h:112
struct DrawEngineType * next
Definition: DRW_render.h:112
void(* cache_populate)(void *vedata, struct Object *ob)
Definition: DRW_render.h:122
char idname[32]
Definition: DRW_render.h:114
void(* id_update)(void *vedata, struct ID *id)
Definition: DRW_render.h:128
void(* render_to_image)(void *vedata, struct RenderEngine *engine, struct RenderLayer *layer, const struct rcti *rect)
Definition: DRW_render.h:130
void(* engine_init)(void *vedata)
Definition: DRW_render.h:118
const DrawEngineDataSize * vedata_size
Definition: DRW_render.h:116
void(* draw_scene)(void *vedata)
Definition: DRW_render.h:125
void(* engine_free)(void)
Definition: DRW_render.h:119
void(* view_update)(void *vedata)
Definition: DRW_render.h:127
void(* cache_init)(void *vedata)
Definition: DRW_render.h:121
void(* cache_finish)(void *vedata)
Definition: DRW_render.h:123
struct Object * ob
Definition: BKE_duplilist.h:45
Material * ma
Definition: gpu_material.c:67
bool is_volume_shader
Definition: gpu_material.c:73
const void * engine_type
Definition: gpu_material.c:71
GPUVertAttr attrs[GPU_VERT_ATTR_MAX_LEN]
Definition: DNA_ID.h:273
float max
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)