Blender  V3.3
DRW_render.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2016 Blender Foundation. */
3 
8 /* This is the Render Functions used by Realtime engines to draw with OpenGL */
9 
10 #pragma once
11 
12 #include "BLI_listbase.h"
13 #include "BLI_math_matrix.h"
14 #include "BLI_math_vector.h"
15 #include "BLI_string.h"
16 
17 #include "BKE_context.h"
18 #include "BKE_layer.h"
19 #include "BKE_material.h"
20 #include "BKE_scene.h"
21 
22 #include "BLT_translation.h"
23 
24 #include "DNA_light_types.h"
25 #include "DNA_material_types.h"
26 #include "DNA_object_types.h"
27 #include "DNA_scene_types.h"
28 #include "DNA_world_types.h"
29 
30 #include "GPU_framebuffer.h"
31 #include "GPU_material.h"
32 #include "GPU_primitive.h"
33 #include "GPU_shader.h"
34 #include "GPU_storage_buffer.h"
35 #include "GPU_texture.h"
36 #include "GPU_uniform_buffer.h"
37 
38 #include "draw_cache.h"
39 #include "draw_common.h"
40 #include "draw_view.h"
41 
42 #include "draw_debug.h"
43 #include "draw_manager_profiling.h"
44 #include "draw_view_data.h"
45 
46 #include "MEM_guardedalloc.h"
47 
48 #include "RE_engine.h"
49 
50 #include "DEG_depsgraph.h"
51 
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
55 
56 /* Uncomment to track unused resource bindings. */
57 // #define DRW_UNUSED_RESOURCE_TRACKING
58 
59 #ifdef DRW_UNUSED_RESOURCE_TRACKING
60 # define DRW_DEBUG_FILE_LINE_ARGS , const char *file, int line
61 #else
62 # define DRW_DEBUG_FILE_LINE_ARGS
63 #endif
64 
65 struct GPUBatch;
66 struct GPUMaterial;
67 struct GPUShader;
68 struct GPUTexture;
69 struct GPUUniformBuf;
70 struct Object;
71 struct ParticleSystem;
72 struct RenderEngineType;
73 struct bContext;
74 struct rcti;
75 
76 typedef struct DRWCallBuffer DRWCallBuffer;
77 typedef struct DRWInterface DRWInterface;
78 typedef struct DRWPass DRWPass;
79 typedef struct DRWShaderLibrary DRWShaderLibrary;
80 typedef struct DRWShadingGroup DRWShadingGroup;
81 typedef struct DRWUniform DRWUniform;
82 typedef struct DRWView DRWView;
83 
84 /* TODO: Put it somewhere else? */
85 typedef struct BoundSphere {
86  float center[3], radius;
88 
89 /* declare members as empty (unused) */
90 typedef char DRWViewportEmptyList;
91 
92 #define DRW_VIEWPORT_LIST_SIZE(list) \
93  (sizeof(list) == sizeof(DRWViewportEmptyList) ? 0 : (sizeof(list) / sizeof(void *)))
94 
95 /* Unused members must be either pass list or 'char *' when not used. */
96 #define DRW_VIEWPORT_DATA_SIZE(ty) \
97  { \
98  DRW_VIEWPORT_LIST_SIZE(*(((ty *)NULL)->fbl)), DRW_VIEWPORT_LIST_SIZE(*(((ty *)NULL)->txl)), \
99  DRW_VIEWPORT_LIST_SIZE(*(((ty *)NULL)->psl)), \
100  DRW_VIEWPORT_LIST_SIZE(*(((ty *)NULL)->stl)), \
101  }
102 
103 typedef struct DrawEngineDataSize {
104  int fbl_len;
105  int txl_len;
106  int psl_len;
107  int stl_len;
109 
110 typedef struct DrawEngineType {
112 
113  char idname[32];
114 
116 
117  void (*engine_init)(void *vedata);
119 
120  void (*instance_free)(void *instance_data);
121 
122  void (*cache_init)(void *vedata);
123  void (*cache_populate)(void *vedata, struct Object *ob);
124  void (*cache_finish)(void *vedata);
125 
126  void (*draw_scene)(void *vedata);
127 
128  void (*view_update)(void *vedata);
129  void (*id_update)(void *vedata, struct ID *id);
130 
131  void (*render_to_image)(void *vedata,
132  struct RenderEngine *engine,
133  struct RenderLayer *layer,
134  const struct rcti *rect);
135  void (*store_metadata)(void *vedata, struct RenderResult *render_result);
137 
138 /* Textures */
139 typedef enum {
140  DRW_TEX_FILTER = (1 << 0),
141  DRW_TEX_WRAP = (1 << 1),
142  DRW_TEX_COMPARE = (1 << 2),
143  DRW_TEX_MIPMAP = (1 << 3),
145 
152  int h,
154  DrawEngineType *engine_type);
156  DrawEngineType *engine_type);
157 
160  DRWTextureFlag flags,
161  const float *fpixels);
163  int w, int h, eGPUTextureFormat format, DRWTextureFlag flags, const float *fpixels);
165  int w, int h, int d, eGPUTextureFormat format, DRWTextureFlag flags, const float *fpixels);
167  int w, int h, int d, eGPUTextureFormat format, DRWTextureFlag flags, const float *fpixels);
170  DRWTextureFlag flags,
171  const float *fpixels);
173  int w, int d, eGPUTextureFormat format, DRWTextureFlag flags, const float *fpixels);
174 
177  DRWTextureFlag flags);
179  struct GPUTexture **tex, int w, int h, eGPUTextureFormat format, DRWTextureFlag flags);
180 
182 void DRW_texture_free(struct GPUTexture *tex);
183 #define DRW_TEXTURE_FREE_SAFE(tex) \
184  do { \
185  if (tex != NULL) { \
186  DRW_texture_free(tex); \
187  tex = NULL; \
188  } \
189  } while (0)
190 
191 #define DRW_UBO_FREE_SAFE(ubo) \
192  do { \
193  if (ubo != NULL) { \
194  GPU_uniformbuf_free(ubo); \
195  ubo = NULL; \
196  } \
197  } while (0)
198 
199 /* Shaders */
200 
202  const char *vert, const char *geom, const char *frag, const char *defines, const char *name);
203 struct GPUShader *DRW_shader_create_with_lib_ex(const char *vert,
204  const char *geom,
205  const char *frag,
206  const char *lib,
207  const char *defines,
208  const char *name);
209 struct GPUShader *DRW_shader_create_with_shaderlib_ex(const char *vert,
210  const char *geom,
211  const char *frag,
212  const DRWShaderLibrary *lib,
213  const char *defines,
214  const char *name);
216  const char *geom,
217  const char *defines,
218  eGPUShaderTFBType prim_type,
219  const char **varying_names,
220  int varying_count);
221 struct GPUShader *DRW_shader_create_fullscreen_ex(const char *frag,
222  const char *defines,
223  const char *name);
225  const DRWShaderLibrary *lib,
226  const char *defines,
227  const char *name);
228 #define DRW_shader_create(vert, geom, frag, defines) \
229  DRW_shader_create_ex(vert, geom, frag, defines, __func__)
230 #define DRW_shader_create_with_lib(vert, geom, frag, lib, defines) \
231  DRW_shader_create_with_lib_ex(vert, geom, frag, lib, defines, __func__)
232 #define DRW_shader_create_with_shaderlib(vert, geom, frag, lib, defines) \
233  DRW_shader_create_with_shaderlib_ex(vert, geom, frag, lib, defines, __func__)
234 #define DRW_shader_create_fullscreen(frag, defines) \
235  DRW_shader_create_fullscreen_ex(frag, defines, __func__)
236 #define DRW_shader_create_fullscreen_with_shaderlib(frag, lib, defines) \
237  DRW_shader_create_fullscreen_with_shaderlib_ex(frag, lib, defines, __func__)
238 
239 struct GPUMaterial *DRW_shader_from_world(struct World *wo,
240  struct bNodeTree *ntree,
241  const uint64_t shader_id,
242  const bool is_volume_shader,
243  bool deferred,
245  void *thunk);
247  struct bNodeTree *ntree,
248  const uint64_t shader_id,
249  const bool is_volume_shader,
250  bool deferred,
252  void *thunk);
253 void DRW_shader_free(struct GPUShader *shader);
254 #define DRW_SHADER_FREE_SAFE(shader) \
255  do { \
256  if (shader != NULL) { \
257  DRW_shader_free(shader); \
258  shader = NULL; \
259  } \
260  } while (0)
261 
263 
268  const char *lib_code,
269  const char *lib_name);
270 #define DRW_SHADER_LIB_ADD(lib, lib_name) \
271  DRW_shader_library_add_file(lib, datatoc_##lib_name##_glsl, STRINGIFY(lib_name) ".glsl")
272 
278  const char *shader_code);
279 
281 #define DRW_SHADER_LIB_FREE_SAFE(lib) \
282  do { \
283  if (lib != NULL) { \
284  DRW_shader_library_free(lib); \
285  lib = NULL; \
286  } \
287  } while (0)
288 
289 /* Batches */
290 
298 typedef enum {
304  /* Write Stencil. These options are mutual exclusive and packed into 2 bits */
322 
324  DRW_STATE_BLEND_ADD = (1 << 11),
332  DRW_STATE_BLEND_OIT = (6 << 11),
333  DRW_STATE_BLEND_MUL = (7 << 11),
334  DRW_STATE_BLEND_SUB = (8 << 11),
339 
346 } DRWState;
347 
349 
350 #define DRW_STATE_DEFAULT \
351  (DRW_STATE_WRITE_DEPTH | DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_LESS_EQUAL)
352 #define DRW_STATE_BLEND_ENABLED \
353  (DRW_STATE_BLEND_ADD | DRW_STATE_BLEND_ADD_FULL | DRW_STATE_BLEND_ALPHA | \
354  DRW_STATE_BLEND_ALPHA_PREMUL | DRW_STATE_BLEND_BACKGROUND | DRW_STATE_BLEND_OIT | \
355  DRW_STATE_BLEND_MUL | DRW_STATE_BLEND_SUB | DRW_STATE_BLEND_CUSTOM | DRW_STATE_LOGIC_INVERT)
356 #define DRW_STATE_RASTERIZER_ENABLED \
357  (DRW_STATE_WRITE_DEPTH | DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_STENCIL | \
358  DRW_STATE_WRITE_STENCIL_SHADOW_PASS | DRW_STATE_WRITE_STENCIL_SHADOW_FAIL)
359 #define DRW_STATE_DEPTH_TEST_ENABLED \
360  (DRW_STATE_DEPTH_ALWAYS | DRW_STATE_DEPTH_LESS | DRW_STATE_DEPTH_LESS_EQUAL | \
361  DRW_STATE_DEPTH_EQUAL | DRW_STATE_DEPTH_GREATER | DRW_STATE_DEPTH_GREATER_EQUAL)
362 #define DRW_STATE_STENCIL_TEST_ENABLED \
363  (DRW_STATE_STENCIL_ALWAYS | DRW_STATE_STENCIL_EQUAL | DRW_STATE_STENCIL_NEQUAL)
364 #define DRW_STATE_WRITE_STENCIL_ENABLED \
365  (DRW_STATE_WRITE_STENCIL | DRW_STATE_WRITE_STENCIL_SHADOW_PASS | \
366  DRW_STATE_WRITE_STENCIL_SHADOW_FAIL)
367 
368 typedef enum {
371 } eDRWAttrType;
372 
373 typedef struct DRWInstanceAttrFormat {
374  char name[32];
378 
380  int arraysize);
381 #define DRW_shgroup_instance_format(format, ...) \
382  do { \
383  if (format == NULL) { \
384  DRWInstanceAttrFormat drw_format[] = __VA_ARGS__; \
385  format = DRW_shgroup_instance_format_array( \
386  drw_format, (sizeof(drw_format) / sizeof(DRWInstanceAttrFormat))); \
387  } \
388  } while (0)
389 
390 DRWShadingGroup *DRW_shgroup_create(struct GPUShader *shader, DRWPass *pass);
394  DRWPass *pass,
395  struct GPUVertBuf *tf_target);
396 
398 
402 typedef bool(DRWCallVisibilityFn)(bool vis_in, void *user_data);
403 
405  Object *ob,
406  float (*obmat)[4],
407  struct GPUBatch *geom,
408  bool bypass_culling,
409  void *user_data);
410 
414 #define DRW_shgroup_call(shgroup, geom, ob) \
415  DRW_shgroup_call_ex(shgroup, ob, NULL, geom, false, NULL)
416 
420 #define DRW_shgroup_call_obmat(shgroup, geom, obmat) \
421  DRW_shgroup_call_ex(shgroup, NULL, obmat, geom, false, NULL)
422 
423 /* TODO(fclem): remove this when we have DRWView */
424 /* user_data is used by DRWCallVisibilityFn defined in DRWView. */
425 #define DRW_shgroup_call_with_callback(shgroup, geom, ob, user_data) \
426  DRW_shgroup_call_ex(shgroup, ob, NULL, geom, false, user_data)
427 
431 #define DRW_shgroup_call_no_cull(shgroup, geom, ob) \
432  DRW_shgroup_call_ex(shgroup, ob, NULL, geom, true, NULL)
433 
435  DRWShadingGroup *shgroup, Object *ob, struct GPUBatch *geom, uint v_sta, uint v_num);
440  DRWShadingGroup *shgroup, Object *ob, struct GPUBatch *geom, uint i_sta, uint i_num);
441 
443  int groups_x_len,
444  int groups_y_len,
445  int groups_z_len);
449 void DRW_shgroup_call_compute_ref(DRWShadingGroup *shgroup, int groups_ref[3]);
462  Object *ob,
463  struct GPUBatch *geom,
464  uint count);
469  Object *ob,
470  struct GPUBatch *geom,
471  struct GPUBatch *inst_attributes);
472 
473 void DRW_shgroup_call_sculpt(DRWShadingGroup *sh, Object *ob, bool wire, bool mask);
475 
477  struct GPUVertFormat *format,
478  GPUPrimType prim_type);
480  struct GPUVertFormat *format,
481  struct GPUBatch *geom);
482 
483 void DRW_buffer_add_entry_struct(DRWCallBuffer *callbuf, const void *data);
484 void DRW_buffer_add_entry_array(DRWCallBuffer *callbuf, const void *attr[], uint attr_len);
485 
486 #define DRW_buffer_add_entry(buffer, ...) \
487  do { \
488  const void *array[] = {__VA_ARGS__}; \
489  DRW_buffer_add_entry_array(buffer, array, (sizeof(array) / sizeof(*array))); \
490  } while (0)
491 
496 
503 
511  uint write_mask,
512  uint reference,
513  uint compare_mask);
518 
523 
529  uchar r,
530  uchar g,
531  uchar b,
532  uchar a,
533  float depth,
534  uchar stencil);
535 
537  const char *name,
538  const struct GPUTexture *tex,
539  eGPUSamplerState sampler_state);
541  const char *name,
542  GPUTexture **tex,
543  eGPUSamplerState sampler_state);
545  const char *name,
546  const struct GPUTexture *tex);
548  const char *name,
549  struct GPUTexture **tex);
551  const char *name,
552  const struct GPUUniformBuf *ubo DRW_DEBUG_FILE_LINE_ARGS);
554  const char *name,
557  const char *name,
558  const struct GPUStorageBuf *ssbo DRW_DEBUG_FILE_LINE_ARGS);
560  const char *name,
563  const char *name,
564  const float *value,
565  int arraysize);
567  const char *name,
568  const float *value,
569  int arraysize);
571  const char *name,
572  const float *value,
573  int arraysize);
575  const char *name,
576  const float *value,
577  int arraysize);
579  const char *name,
580  const int *value,
581  int arraysize);
583  const char *name,
584  const int *value,
585  int arraysize);
587  const char *name,
588  const int *value,
589  int arraysize);
591  const char *name,
592  const int *value,
593  int arraysize);
595  const char *name,
596  const int *value,
597  int arraysize);
598 void DRW_shgroup_uniform_mat3(DRWShadingGroup *shgroup, const char *name, const float (*value)[3]);
599 void DRW_shgroup_uniform_mat4(DRWShadingGroup *shgroup, const char *name, const float (*value)[4]);
603 void DRW_shgroup_uniform_image(DRWShadingGroup *shgroup, const char *name, const GPUTexture *tex);
604 void DRW_shgroup_uniform_image_ref(DRWShadingGroup *shgroup, const char *name, GPUTexture **tex);
605 
606 /* Store value instead of referencing it. */
607 
608 void DRW_shgroup_uniform_int_copy(DRWShadingGroup *shgroup, const char *name, int value);
609 void DRW_shgroup_uniform_ivec2_copy(DRWShadingGroup *shgroup, const char *name, const int *value);
610 void DRW_shgroup_uniform_ivec3_copy(DRWShadingGroup *shgroup, const char *name, const int *value);
611 void DRW_shgroup_uniform_ivec4_copy(DRWShadingGroup *shgroup, const char *name, const int *value);
612 void DRW_shgroup_uniform_bool_copy(DRWShadingGroup *shgroup, const char *name, bool value);
613 void DRW_shgroup_uniform_float_copy(DRWShadingGroup *shgroup, const char *name, float value);
614 void DRW_shgroup_uniform_vec2_copy(DRWShadingGroup *shgroup, const char *name, const float *value);
615 void DRW_shgroup_uniform_vec3_copy(DRWShadingGroup *shgroup, const char *name, const float *value);
616 void DRW_shgroup_uniform_vec4_copy(DRWShadingGroup *shgroup, const char *name, const float *value);
618  const char *name,
619  const float (*value)[4]);
621  const char *name,
622  struct GPUVertBuf *vertex_buffer DRW_DEBUG_FILE_LINE_ARGS);
624  const char *name,
625  struct GPUVertBuf **vertex_buffer DRW_DEBUG_FILE_LINE_ARGS);
627  const char *name,
628  struct GPUVertBuf *vertex_buffer);
630  const char *name,
631  struct GPUVertBuf **vertex_buffer);
632 
633 #ifdef DRW_UNUSED_RESOURCE_TRACKING
634 # define DRW_shgroup_vertex_buffer(shgroup, name, vert) \
635  DRW_shgroup_vertex_buffer_ex(shgroup, name, vert, __FILE__, __LINE__)
636 # define DRW_shgroup_vertex_buffer_ref(shgroup, name, vert) \
637  DRW_shgroup_vertex_buffer_ref_ex(shgroup, name, vert, __FILE__, __LINE__)
638 # define DRW_shgroup_uniform_block(shgroup, name, ubo) \
639  DRW_shgroup_uniform_block_ex(shgroup, name, ubo, __FILE__, __LINE__)
640 # define DRW_shgroup_uniform_block_ref(shgroup, name, ubo) \
641  DRW_shgroup_uniform_block_ref_ex(shgroup, name, ubo, __FILE__, __LINE__)
642 # define DRW_shgroup_storage_block(shgroup, name, ssbo) \
643  DRW_shgroup_storage_block_ex(shgroup, name, ssbo, __FILE__, __LINE__)
644 # define DRW_shgroup_storage_block_ref(shgroup, name, ssbo) \
645  DRW_shgroup_storage_block_ref_ex(shgroup, name, ssbo, __FILE__, __LINE__)
646 #else
647 # define DRW_shgroup_vertex_buffer(shgroup, name, vert) \
648  DRW_shgroup_vertex_buffer_ex(shgroup, name, vert)
649 # define DRW_shgroup_vertex_buffer_ref(shgroup, name, vert) \
650  DRW_shgroup_vertex_buffer_ref_ex(shgroup, name, vert)
651 # define DRW_shgroup_uniform_block(shgroup, name, ubo) \
652  DRW_shgroup_uniform_block_ex(shgroup, name, ubo)
653 # define DRW_shgroup_uniform_block_ref(shgroup, name, ubo) \
654  DRW_shgroup_uniform_block_ref_ex(shgroup, name, ubo)
655 # define DRW_shgroup_storage_block(shgroup, name, ssbo) \
656  DRW_shgroup_storage_block_ex(shgroup, name, ssbo)
657 # define DRW_shgroup_storage_block_ref(shgroup, name, ssbo) \
658  DRW_shgroup_storage_block_ref_ex(shgroup, name, ssbo)
659 #endif
660 
662 
663 /* Passes. */
664 
665 DRWPass *DRW_pass_create(const char *name, DRWState state);
670 DRWPass *DRW_pass_create_instance(const char *name, DRWPass *original, DRWState state);
674 void DRW_pass_link(DRWPass *first, DRWPass *second);
676  void (*callback)(void *userData, DRWShadingGroup *shgroup),
677  void *userData);
682 void DRW_pass_sort_shgroup_z(DRWPass *pass);
687 
688 bool DRW_pass_is_empty(DRWPass *pass);
689 
690 #define DRW_PASS_CREATE(pass, state) (pass = DRW_pass_create(#pass, state))
691 #define DRW_PASS_INSTANCE_CREATE(pass, original, state) \
692  (pass = DRW_pass_create_instance(#pass, (original), state))
693 
694 /* Views. */
695 
699 DRWView *DRW_view_create(const float viewmat[4][4],
700  const float winmat[4][4],
701  const float (*culling_viewmat)[4],
702  const float (*culling_winmat)[4],
703  DRWCallVisibilityFn *visibility_fn);
707 DRWView *DRW_view_create_sub(const DRWView *parent_view,
708  const float viewmat[4][4],
709  const float winmat[4][4]);
710 
715  const float viewmat[4][4],
716  const float winmat[4][4],
717  const float (*culling_viewmat)[4],
718  const float (*culling_winmat)[4]);
722 void DRW_view_update_sub(DRWView *view, const float viewmat[4][4], const float winmat[4][4]);
723 
727 const DRWView *DRW_view_default_get(void);
731 void DRW_view_default_set(const DRWView *view);
735 void DRW_view_reset(void);
739 void DRW_view_set_active(const DRWView *view);
740 const DRWView *DRW_view_get_active(void);
741 
747 void DRW_view_clip_planes_set(DRWView *view, float (*planes)[4], int plane_len);
748 void DRW_view_camtexco_set(DRWView *view, float texco[4]);
749 void DRW_view_camtexco_get(const DRWView *view, float r_texco[4]);
750 
751 /* For all getters, if view is NULL, default view is assumed. */
752 
753 void DRW_view_winmat_get(const DRWView *view, float mat[4][4], bool inverse);
754 void DRW_view_viewmat_get(const DRWView *view, float mat[4][4], bool inverse);
755 void DRW_view_persmat_get(const DRWView *view, float mat[4][4], bool inverse);
756 
760 void DRW_view_frustum_corners_get(const DRWView *view, BoundBox *corners);
765 void DRW_view_frustum_planes_get(const DRWView *view, float planes[6][4]);
766 
773 bool DRW_view_is_persp_get(const DRWView *view);
774 
775 /* Culling, return true if object is inside view frustum. */
776 
781 bool DRW_culling_sphere_test(const DRWView *view, const BoundSphere *bsphere);
786 bool DRW_culling_box_test(const DRWView *view, const BoundBox *bbox);
791 bool DRW_culling_plane_test(const DRWView *view, const float plane[4]);
796 bool DRW_culling_min_max_test(const DRWView *view, float obmat[4][4], float min[3], float max[3]);
797 
799 void DRW_culling_frustum_planes_get(const DRWView *view, float planes[6][4]);
800 
801 /* Viewport. */
802 
803 const float *DRW_viewport_size_get(void);
804 const float *DRW_viewport_invert_size_get(void);
805 const float *DRW_viewport_screenvecs_get(void);
806 const float *DRW_viewport_pixelsize_get(void);
807 
810 
811 void DRW_viewport_request_redraw(void);
812 
813 void DRW_render_to_image(struct RenderEngine *engine, struct Depsgraph *depsgraph);
814 void DRW_render_object_iter(void *vedata,
815  struct RenderEngine *engine,
816  struct Depsgraph *depsgraph,
817  void (*callback)(void *vedata,
818  struct Object *ob,
819  struct RenderEngine *engine,
820  struct Depsgraph *depsgraph));
828 void DRW_render_set_time(struct RenderEngine *engine,
829  struct Depsgraph *depsgraph,
830  int frame,
831  float subframe);
835 void DRW_render_viewport_size_set(const int size[2]);
836 
842 void DRW_custom_pipeline(DrawEngineType *draw_engine_type,
843  struct Depsgraph *depsgraph,
844  void (*callback)(void *vedata, void *user_data),
845  void *user_data);
846 
850 void DRW_cache_restart(void);
851 
852 /* ViewLayers */
853 
855 void **DRW_view_layer_engine_data_ensure_ex(struct ViewLayer *view_layer,
856  DrawEngineType *engine_type,
857  void (*callback)(void *storage));
859  void (*callback)(void *storage));
860 
861 /* DrawData */
862 
863 DrawData *DRW_drawdata_get(ID *id, DrawEngineType *engine_type);
865  DrawEngineType *engine_type,
866  size_t size,
867  DrawDataInitCb init_cb,
868  DrawDataFreeCb free_cb);
872 void **DRW_duplidata_get(void *vedata);
873 
874 /* Settings. */
875 
876 bool DRW_object_is_renderable(const struct Object *ob);
884 bool DRW_object_is_in_edit_mode(const struct Object *ob);
890 bool DRW_object_use_hide_faces(const struct Object *ob);
891 
893  const struct ParticleSystem *psys);
894 
895 struct Object *DRW_object_get_dupli_parent(const struct Object *ob);
896 struct DupliObject *DRW_object_get_dupli(const struct Object *ob);
897 
898 /* Draw commands */
899 
900 void DRW_draw_pass(DRWPass *pass);
904 void DRW_draw_pass_subset(DRWPass *pass, DRWShadingGroup *start_group, DRWShadingGroup *end_group);
905 
908 
913 void DRW_state_reset(void);
921 
922 /* Selection. */
923 
924 void DRW_select_load_id(uint id);
925 
926 /* Draw State. */
927 
932 bool DRW_state_is_fbo(void);
936 bool DRW_state_is_select(void);
938 bool DRW_state_is_depth(void);
942 bool DRW_state_is_image_render(void);
947 bool DRW_state_is_scene_render(void);
951 bool DRW_state_is_opengl_render(void);
952 bool DRW_state_is_playback(void);
956 bool DRW_state_is_navigating(void);
960 bool DRW_state_show_text(void);
965 bool DRW_state_draw_support(void);
969 bool DRW_state_draw_background(void);
970 
971 /* Avoid too many lookups while drawing */
972 typedef struct DRWContextState {
973 
974  struct ARegion *region; /* 'CTX_wm_region(C)' */
975  struct RegionView3D *rv3d; /* 'CTX_wm_region_view3d(C)' */
976  struct View3D *v3d; /* 'CTX_wm_view3d(C)' */
977  struct SpaceLink *space_data; /* 'CTX_wm_space_data(C)' */
978 
979  struct Scene *scene; /* 'CTX_data_scene(C)' */
980  struct ViewLayer *view_layer; /* 'CTX_data_view_layer(C)' */
981 
982  /* Use 'object_edit' for edit-mode */
983  struct Object *obact; /* 'OBACT' */
984 
986 
988 
990 
992 
994 
997  const struct bContext *evil_C;
998 
999  /* ---- */
1000 
1001  /* Cache: initialized by 'drw_context_state_init'. */
1004 
1006 
1008 
1009 #ifdef __cplusplus
1010 }
1011 #endif
General operations, lookup, etc. for materials.
unsigned char uchar
Definition: BLI_sys_types.h:70
unsigned int uint
Definition: BLI_sys_types.h:67
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:35
void(* DrawDataFreeCb)(struct DrawData *engine_data)
Definition: DNA_ID.h:30
void(* DrawDataInitCb)(struct DrawData *engine_data)
Definition: DNA_ID.h:29
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:368
@ DRW_ATTR_INT
Definition: DRW_render.h:369
@ DRW_ATTR_FLOAT
Definition: DRW_render.h:370
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:303
float DRW_view_near_distance_get(const DRWView *view)
void DRW_shgroup_storage_block_ref_ex(DRWShadingGroup *shgroup, const char *name, struct GPUStorageBuf **ssbo DRW_DEBUG_FILE_LINE_ARGS)
struct DRWInterface DRWInterface
Definition: DRW_render.h:77
bool DRW_state_is_opengl_render(void)
bool() DRWCallVisibilityFn(bool vis_in, void *user_data)
Definition: DRW_render.h:402
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)
void DRW_shgroup_call_ex(DRWShadingGroup *shgroup, Object *ob, float(*obmat)[4], struct GPUBatch *geom, bool bypass_culling, void *user_data)
void ** DRW_duplidata_get(void *vedata)
Definition: draw_manager.c:741
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:90
void DRW_texture_free(struct GPUTexture *tex)
void DRW_shgroup_buffer_texture_ref(DRWShadingGroup *shgroup, const char *name, struct GPUVertBuf **vertex_buffer)
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:866
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)
void DRW_shgroup_call_instance_range(DRWShadingGroup *shgroup, Object *ob, struct GPUBatch *geom, uint i_sta, uint i_num)
void DRW_shgroup_uniform_bool_copy(DRWShadingGroup *shgroup, const char *name, bool value)
bool DRW_state_is_navigating(void)
void DRW_view_camtexco_get(const DRWView *view, float r_texco[4])
bool DRW_state_is_depth(void)
#define DRW_DEBUG_FILE_LINE_ARGS
Definition: DRW_render.h:62
const DRWView * DRW_view_default_get(void)
void DRW_shgroup_call_instances(DRWShadingGroup *shgroup, Object *ob, struct GPUBatch *geom, uint count)
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_shgroup_call_compute_indirect(DRWShadingGroup *shgroup, GPUStorageBuf *indirect_buf)
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:757
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:787
ENUM_OPERATORS(DRWState, DRW_STATE_PROGRAM_POINT_SIZE)
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:280
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_shgroup_uniform_float_copy(DRWShadingGroup *shgroup, const char *name, float value)
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)
bool DRW_state_is_material_select(void)
DRWPass * DRW_pass_create_instance(const char *name, DRWPass *original, DRWState state)
DRWTextureFlag
Definition: DRW_render.h:139
@ DRW_TEX_MIPMAP
Definition: DRW_render.h:143
@ DRW_TEX_WRAP
Definition: DRW_render.h:141
@ DRW_TEX_FILTER
Definition: DRW_render.h:140
@ DRW_TEX_COMPARE
Definition: DRW_render.h:142
void DRW_render_instance_buffer_finish(void)
struct DrawEngineDataSize DrawEngineDataSize
void DRW_view_set_active(const DRWView *view)
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)
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)
void DRW_shgroup_call_compute(DRWShadingGroup *shgroup, int groups_x_len, int groups_y_len, int groups_z_len)
DRWState
Definition: DRW_render.h:298
@ DRW_STATE_STENCIL_EQUAL
Definition: DRW_render.h:320
@ DRW_STATE_CLIP_PLANES
Definition: DRW_render.h:342
@ DRW_STATE_BLEND_ALPHA
Definition: DRW_render.h:328
@ DRW_STATE_BLEND_ADD
Definition: DRW_render.h:324
@ DRW_STATE_BLEND_BACKGROUND
Definition: DRW_render.h:331
@ DRW_STATE_CULL_FRONT
Definition: DRW_render.h:317
@ DRW_STATE_STENCIL_ALWAYS
Definition: DRW_render.h:319
@ DRW_STATE_DEPTH_LESS
Definition: DRW_render.h:310
@ DRW_STATE_NO_DRAW
Definition: DRW_render.h:300
@ DRW_STATE_IN_FRONT_SELECT
Definition: DRW_render.h:340
@ DRW_STATE_BLEND_SUB
Definition: DRW_render.h:334
@ DRW_STATE_DEPTH_GREATER_EQUAL
Definition: DRW_render.h:314
@ DRW_STATE_WRITE_STENCIL_SHADOW_FAIL
Definition: DRW_render.h:307
@ DRW_STATE_DEPTH_EQUAL
Definition: DRW_render.h:312
@ DRW_STATE_PROGRAM_POINT_SIZE
Definition: DRW_render.h:345
@ DRW_STATE_WRITE_DEPTH
Definition: DRW_render.h:302
@ DRW_STATE_BLEND_OIT
Definition: DRW_render.h:332
@ DRW_STATE_LOGIC_INVERT
Definition: DRW_render.h:337
@ DRW_STATE_SHADOW_OFFSET
Definition: DRW_render.h:341
@ DRW_STATE_BLEND_ADD_FULL
Definition: DRW_render.h:326
@ DRW_STATE_WRITE_COLOR
Definition: DRW_render.h:303
@ DRW_STATE_BLEND_ALPHA_UNDER_PREMUL
Definition: DRW_render.h:338
@ DRW_STATE_DEPTH_LESS_EQUAL
Definition: DRW_render.h:311
@ DRW_STATE_WRITE_STENCIL_SHADOW_PASS
Definition: DRW_render.h:306
@ DRW_STATE_CULL_BACK
Definition: DRW_render.h:316
@ DRW_STATE_FIRST_VERTEX_CONVENTION
Definition: DRW_render.h:343
@ DRW_STATE_STENCIL_NEQUAL
Definition: DRW_render.h:321
@ DRW_STATE_DEPTH_ALWAYS
Definition: DRW_render.h:309
@ DRW_STATE_BLEND_CUSTOM
Definition: DRW_render.h:336
@ DRW_STATE_BLEND_ALPHA_PREMUL
Definition: DRW_render.h:330
@ DRW_STATE_DEPTH_GREATER
Definition: DRW_render.h:313
@ DRW_STATE_BLEND_MUL
Definition: DRW_render.h:333
@ DRW_STATE_WRITE_STENCIL
Definition: DRW_render.h:305
struct GPUTexture * DRW_texture_pool_query_2d(int w, int h, eGPUTextureFormat format, DrawEngineType *engine_type)
struct GPUShader * DRW_shader_create_with_transform_feedback(const char *vert, const char *geom, const char *defines, eGPUShaderTFBType prim_type, const char **varying_names, int varying_count)
struct DrawEngineType DrawEngineType
int DRW_object_visibility_in_active_context(const struct Object *ob)
void DRW_culling_frustum_corners_get(const DRWView *view, BoundBox *corners)
struct DefaultFramebufferList * DRW_viewport_framebuffer_list_get(void)
Definition: draw_manager.c:633
struct DRWInstanceAttrFormat DRWInstanceAttrFormat
void DRW_shgroup_barrier(DRWShadingGroup *shgroup, eGPUBarrier type)
void DRW_shgroup_uniform_ivec3(DRWShadingGroup *shgroup, const char *name, const int *value, 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)
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])
const DRWView * DRW_view_get_active(void)
void DRW_shgroup_vertex_buffer_ex(DRWShadingGroup *shgroup, const char *name, struct GPUVertBuf *vertex_buffer DRW_DEBUG_FILE_LINE_ARGS)
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_shader_library_add_file(DRWShaderLibrary *lib, const char *lib_code, const char *lib_name)
void DRW_state_reset(void)
void DRW_shgroup_call_compute_ref(DRWShadingGroup *shgroup, int groups_ref[3])
struct GPUMaterial * DRW_shader_from_world(struct World *wo, struct bNodeTree *ntree, const uint64_t shader_id, const bool is_volume_shader, bool deferred, GPUCodegenCallbackFn callback, void *thunk)
void DRW_draw_callbacks_post_scene(void)
void DRW_shgroup_uniform_block_ex(DRWShadingGroup *shgroup, const char *name, const struct GPUUniformBuf *ubo DRW_DEBUG_FILE_LINE_ARGS)
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_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_view_layer_engine_data_ensure_ex(struct ViewLayer *view_layer, DrawEngineType *engine_type, void(*callback)(void *storage))
Definition: draw_manager.c:767
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)
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:850
void DRW_view_clip_planes_set(DRWView *view, float(*planes)[4], int plane_len)
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)
void DRW_draw_pass_subset(DRWPass *pass, DRWShadingGroup *start_group, DRWShadingGroup *end_group)
const float * DRW_viewport_size_get(void)
Definition: draw_manager.c:288
bool DRW_object_use_hide_faces(const struct Object *ob)
Definition: draw_manager.c:215
void DRW_shgroup_uniform_mat4_copy(DRWShadingGroup *shgroup, const char *name, const float(*value)[4])
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_call_range(DRWShadingGroup *shgroup, Object *ob, struct GPUBatch *geom, uint v_sta, uint v_num)
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:298
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:638
void DRW_custom_pipeline(DrawEngineType *draw_engine_type, struct Depsgraph *depsgraph, void(*callback)(void *vedata, void *user_data), void *user_data)
void DRW_view_default_set(const DRWView *view)
const float * DRW_viewport_invert_size_get(void)
Definition: draw_manager.c:293
bool DRW_object_is_renderable(const struct Object *ob)
void DRW_shgroup_buffer_texture(DRWShadingGroup *shgroup, const char *name, struct GPUVertBuf *vertex_buffer)
struct GPUMaterial * DRW_shader_from_material(struct Material *ma, struct bNodeTree *ntree, const uint64_t shader_id, const bool is_volume_shader, bool deferred, GPUCodegenCallbackFn callback, void *thunk)
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])
void DRW_shgroup_vertex_buffer_ref_ex(DRWShadingGroup *shgroup, const char *name, struct GPUVertBuf **vertex_buffer DRW_DEBUG_FILE_LINE_ARGS)
void DRW_shgroup_storage_block_ex(DRWShadingGroup *shgroup, const char *name, const struct GPUStorageBuf *ssbo DRW_DEBUG_FILE_LINE_ARGS)
void DRW_shgroup_uniform_vec2(DRWShadingGroup *shgroup, const char *name, const float *value, int arraysize)
void DRW_shgroup_uniform_block_ref_ex(DRWShadingGroup *shgroup, const char *name, struct GPUUniformBuf **ubo DRW_DEBUG_FILE_LINE_ARGS)
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:643
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_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)
void DRW_shgroup_uniform_int_copy(DRWShadingGroup *shgroup, const char *name, int value)
static AppView * view
GPUBatch
Definition: GPU_batch.h:78
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
_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
void(* GPUCodegenCallbackFn)(void *thunk, GPUMaterial *mat, GPUCodegenOutput *codegen)
Definition: GPU_material.h:137
GPUPrimType
Definition: GPU_primitive.h:18
struct GPUShader GPUShader
Definition: GPU_shader.h:20
eGPUShaderConfig
Definition: GPU_shader.h:364
eGPUShaderTFBType
Definition: GPU_shader.h:22
eGPUBarrier
Definition: GPU_state.h:24
struct GPUStorageBuf GPUStorageBuf
eGPUSamplerState
Definition: GPU_texture.h:25
struct GPUTexture GPUTexture
Definition: GPU_texture.h:17
eGPUTextureFormat
Definition: GPU_texture.h:83
struct GPUUniformBuf GPUUniformBuf
struct GPUVertBuf GPUVertBuf
Read Guarded memory(de)allocation.
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert a producing a negative Combine Generate a color from its and blue channels(Deprecated)") DefNode(ShaderNode
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
Material material
const Depsgraph * depsgraph
void * user_data
DEGForeachIDComponentCallback callback
SyclQueue void void size_t num_bytes void
bNodeTree * ntree
DRWShaderLibrary * lib
int count
const int state
ccl_gpu_kernel_postfix ccl_global float int int int int sh
format
Definition: logImageCore.h:38
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
Definition: math_float4.h:513
static unsigned a[3]
Definition: RandGen.cpp:78
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
static const pxr::TfToken g("g", pxr::TfToken::Immortal)
#define min(a, b)
Definition: sort.c:35
unsigned int uint32_t
Definition: stdint.h:80
unsigned __int64 uint64_t
Definition: stdint.h:90
float center[3]
Definition: DRW_render.h:86
float radius
Definition: DRW_render.h:86
struct Object * obact
Definition: DRW_render.h:983
struct Scene * scene
Definition: DRW_render.h:979
struct SpaceLink * space_data
Definition: DRW_render.h:977
const struct bContext * evil_C
Definition: DRW_render.h:997
struct Depsgraph * depsgraph
Definition: DRW_render.h:987
eGPUShaderConfig sh_cfg
Definition: DRW_render.h:993
struct ViewLayer * view_layer
Definition: DRW_render.h:980
eObjectMode object_mode
Definition: DRW_render.h:991
struct TaskGraph * task_graph
Definition: DRW_render.h:989
struct View3D * v3d
Definition: DRW_render.h:976
struct ARegion * region
Definition: DRW_render.h:974
struct Object * object_pose
Definition: DRW_render.h:1002
struct RenderEngineType * engine_type
Definition: DRW_render.h:985
struct Object * object_edit
Definition: DRW_render.h:1003
struct RegionView3D * rv3d
Definition: DRW_render.h:975
eDRWAttrType type
Definition: DRW_render.h:375
void(* store_metadata)(void *vedata, struct RenderResult *render_result)
Definition: DRW_render.h:135
struct DrawEngineType * prev
Definition: DRW_render.h:111
struct DrawEngineType * next
Definition: DRW_render.h:111
void(* instance_free)(void *instance_data)
Definition: DRW_render.h:120
void(* cache_populate)(void *vedata, struct Object *ob)
Definition: DRW_render.h:123
char idname[32]
Definition: DRW_render.h:113
void(* id_update)(void *vedata, struct ID *id)
Definition: DRW_render.h:129
void(* render_to_image)(void *vedata, struct RenderEngine *engine, struct RenderLayer *layer, const struct rcti *rect)
Definition: DRW_render.h:131
void(* engine_init)(void *vedata)
Definition: DRW_render.h:117
const DrawEngineDataSize * vedata_size
Definition: DRW_render.h:115
void(* draw_scene)(void *vedata)
Definition: DRW_render.h:126
void(* engine_free)(void)
Definition: DRW_render.h:118
void(* view_update)(void *vedata)
Definition: DRW_render.h:128
void(* cache_init)(void *vedata)
Definition: DRW_render.h:122
void(* cache_finish)(void *vedata)
Definition: DRW_render.h:124
struct Object * ob
Definition: BKE_duplilist.h:34
Material * ma
Definition: gpu_material.c:71
bool is_volume_shader
Definition: gpu_material.c:66
GPUVertAttr attrs[GPU_VERT_ATTR_MAX_LEN]
Definition: DNA_ID.h:368
float max