Blender  V3.3
gpu_batch_presets.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2016 Blender Foundation. All rights reserved. */
3 
8 #include "BLI_listbase.h"
9 #include "BLI_math.h"
10 #include "BLI_threads.h"
11 #include "BLI_utildefines.h"
12 #include "MEM_guardedalloc.h"
13 
14 #include "GPU_batch.h"
15 #include "GPU_batch_presets.h" /* Own include. */
16 
17 /* -------------------------------------------------------------------- */
21 /* Struct to store 3D Batches and their format */
22 static struct {
23  struct {
29  } batch;
30 
32 
33  struct {
36 
38 } g_presets_3d = {{0}};
39 
40 static struct {
41  struct {
44  } batch;
45 
50 
52 
53  struct {
55  } attr_id;
56 } g_presets_2d = {{0}};
57 
59 
62 /* -------------------------------------------------------------------- */
67 {
68  if (g_presets_3d.format.attr_len == 0) {
71  format, "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
73  format, "nor", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
74  }
75  return &g_presets_3d.format;
76 }
77 
79 {
80  if (g_presets_2d.format.attr_len == 0) {
83  format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
85  format, "color", GPU_COMP_F32, 4, GPU_FETCH_FLOAT);
86  }
87  return &g_presets_2d.format;
88 }
89 
91  GPUVertBufRaw *nor_step,
92  float lat,
93  float lon)
94 {
95  float pos[3];
96  pos[0] = sinf(lat) * cosf(lon);
97  pos[1] = cosf(lat);
98  pos[2] = sinf(lat) * sinf(lon);
100  copy_v3_v3(GPU_vertbuf_raw_step(nor_step), pos);
101 }
103 {
104  BLI_assert(lod >= 0 && lod <= 2);
106 
107  if (lod == 0) {
108  return g_presets_3d.batch.sphere_low;
109  }
110  if (lod == 1) {
111  return g_presets_3d.batch.sphere_med;
112  }
113 
114  return g_presets_3d.batch.sphere_high;
115 }
116 
118 {
119  BLI_assert(lod >= 0 && lod <= 1);
121 
122  if (lod == 0) {
123  return g_presets_3d.batch.sphere_wire_low;
124  }
125 
126  return g_presets_3d.batch.sphere_wire_med;
127 }
128 
131 /* -------------------------------------------------------------------- */
135 static GPUBatch *gpu_batch_sphere(int lat_res, int lon_res)
136 {
137  const float lon_inc = 2 * M_PI / lon_res;
138  const float lat_inc = M_PI / lat_res;
139  float lon, lat;
140 
142  const uint vbo_len = (lat_res - 1) * lon_res * 6;
143  GPU_vertbuf_data_alloc(vbo, vbo_len);
144 
145  GPUVertBufRaw pos_step, nor_step;
146  GPU_vertbuf_attr_get_raw_data(vbo, g_presets_3d.attr_id.pos, &pos_step);
147  GPU_vertbuf_attr_get_raw_data(vbo, g_presets_3d.attr_id.nor, &nor_step);
148 
149  lon = 0.0f;
150  for (int i = 0; i < lon_res; i++, lon += lon_inc) {
151  lat = 0.0f;
152  for (int j = 0; j < lat_res; j++, lat += lat_inc) {
153  if (j != lat_res - 1) { /* Pole */
154  batch_sphere_lat_lon_vert(&pos_step, &nor_step, lat + lat_inc, lon + lon_inc);
155  batch_sphere_lat_lon_vert(&pos_step, &nor_step, lat + lat_inc, lon);
156  batch_sphere_lat_lon_vert(&pos_step, &nor_step, lat, lon);
157  }
158 
159  if (j != 0) { /* Pole */
160  batch_sphere_lat_lon_vert(&pos_step, &nor_step, lat, lon + lon_inc);
161  batch_sphere_lat_lon_vert(&pos_step, &nor_step, lat + lat_inc, lon + lon_inc);
162  batch_sphere_lat_lon_vert(&pos_step, &nor_step, lat, lon);
163  }
164  }
165  }
166 
167  BLI_assert(vbo_len == GPU_vertbuf_raw_used(&pos_step));
168  BLI_assert(vbo_len == GPU_vertbuf_raw_used(&nor_step));
169 
171 }
172 
173 static GPUBatch *batch_sphere_wire(int lat_res, int lon_res)
174 {
175  const float lon_inc = 2 * M_PI / lon_res;
176  const float lat_inc = M_PI / lat_res;
177  float lon, lat;
178 
180  const uint vbo_len = (lat_res * lon_res * 2) + ((lat_res - 1) * lon_res * 2);
181  GPU_vertbuf_data_alloc(vbo, vbo_len);
182 
183  GPUVertBufRaw pos_step, nor_step;
184  GPU_vertbuf_attr_get_raw_data(vbo, g_presets_3d.attr_id.pos, &pos_step);
185  GPU_vertbuf_attr_get_raw_data(vbo, g_presets_3d.attr_id.nor, &nor_step);
186 
187  lon = 0.0f;
188  for (int i = 0; i < lon_res; i++, lon += lon_inc) {
189  lat = 0.0f;
190  for (int j = 0; j < lat_res; j++, lat += lat_inc) {
191  batch_sphere_lat_lon_vert(&pos_step, &nor_step, lat + lat_inc, lon);
192  batch_sphere_lat_lon_vert(&pos_step, &nor_step, lat, lon);
193 
194  if (j != lat_res - 1) { /* Pole */
195  batch_sphere_lat_lon_vert(&pos_step, &nor_step, lat + lat_inc, lon + lon_inc);
196  batch_sphere_lat_lon_vert(&pos_step, &nor_step, lat + lat_inc, lon);
197  }
198  }
199  }
200 
201  BLI_assert(vbo_len == GPU_vertbuf_raw_used(&pos_step));
202  BLI_assert(vbo_len == GPU_vertbuf_raw_used(&nor_step));
203 
205 }
206 
209 /* -------------------------------------------------------------------- */
214  float x1,
215  float y1,
216  float x2,
217  float y2,
218  GPUVertBufRaw *col_step,
219  const float color[4])
220 {
221  copy_v2_v2(GPU_vertbuf_raw_step(pos_step), (const float[2]){x1, y1});
223 
224  copy_v2_v2(GPU_vertbuf_raw_step(pos_step), (const float[2]){x2, y1});
226 
227  copy_v2_v2(GPU_vertbuf_raw_step(pos_step), (const float[2]){x2, y2});
229 
230  copy_v2_v2(GPU_vertbuf_raw_step(pos_step), (const float[2]){x1, y1});
232 
233  copy_v2_v2(GPU_vertbuf_raw_step(pos_step), (const float[2]){x2, y2});
235 
236  copy_v2_v2(GPU_vertbuf_raw_step(pos_step), (const float[2]){x1, y2});
238 }
239 
241  const float col_high[4],
242  const float col_dark[4],
243  const float width)
244 {
246  const uint vbo_len = 4 * 2 * (6 * 2);
247  GPU_vertbuf_data_alloc(vbo, vbo_len);
248 
249  GPUVertBufRaw pos_step, col_step;
250  GPU_vertbuf_attr_get_raw_data(vbo, g_presets_2d.attr_id.pos, &pos_step);
251  GPU_vertbuf_attr_get_raw_data(vbo, g_presets_2d.attr_id.col, &col_step);
252 
253  const int px = (int)pixelsize;
254  const int px_zoom = max_ii(round_fl_to_int(width / 22.0f), 1);
255 
256  const int box_margin = max_ii(round_fl_to_int((float)(px_zoom * 2.0f)), px);
257  const int box_size = max_ii(round_fl_to_int((width / 8.0f) - px), px);
258 
259  const int y_ofs = max_ii(round_fl_to_int(width / 2.5f), px);
260  const int x_ofs = y_ofs;
261  int i_x, i_y;
262 
263  for (i_x = 0; i_x < 4; i_x++) {
264  for (i_y = 0; i_y < 2; i_y++) {
265  const int x_co = (x_ofs) + (i_x * (box_size + box_margin));
266  const int y_co = (y_ofs) + (i_y * (box_size + box_margin));
267 
269  x_co - box_size,
270  y_co - px_zoom,
271  x_co,
272  (y_co + box_size) - px_zoom,
273  &col_step,
274  col_dark);
276  &pos_step, x_co - box_size, y_co, x_co, y_co + box_size, &col_step, col_high);
277  }
278  }
280 }
281 
283  const float col_high[4],
284  const float col_dark[4],
285  const float width)
286 {
287  const bool parameters_changed = (g_presets_2d.panel_drag_widget_pixelsize != pixelsize) ||
288  (g_presets_2d.panel_drag_widget_width != width) ||
289  !equals_v4v4(g_presets_2d.panel_drag_widget_col_high,
290  col_high) ||
291  !equals_v4v4(g_presets_2d.panel_drag_widget_col_dark, col_dark);
292 
293  if (g_presets_2d.batch.panel_drag_widget && parameters_changed) {
294  gpu_batch_presets_unregister(g_presets_2d.batch.panel_drag_widget);
295  GPU_batch_discard(g_presets_2d.batch.panel_drag_widget);
296  g_presets_2d.batch.panel_drag_widget = NULL;
297  }
298 
299  if (!g_presets_2d.batch.panel_drag_widget) {
300  g_presets_2d.batch.panel_drag_widget = gpu_batch_preset_panel_drag_widget(
301  pixelsize, col_high, col_dark, width);
302  gpu_batch_presets_register(g_presets_2d.batch.panel_drag_widget);
303  g_presets_2d.panel_drag_widget_pixelsize = pixelsize;
304  g_presets_2d.panel_drag_widget_width = width;
305  copy_v4_v4(g_presets_2d.panel_drag_widget_col_high, col_high);
306  copy_v4_v4(g_presets_2d.panel_drag_widget_col_dark, col_dark);
307  }
308  return g_presets_2d.batch.panel_drag_widget;
309 }
310 
312 {
313  if (!g_presets_2d.batch.quad) {
315  GPU_vertbuf_data_alloc(vbo, 4);
316 
317  float pos_data[4][2] = {{0.0f, 0.0f}, {0.0f, 1.0f}, {1.0f, 0.0f}, {1.0f, 1.0f}};
318  GPU_vertbuf_attr_fill(vbo, g_presets_2d.attr_id.pos, pos_data);
319  /* Don't fill the color. */
320 
321  g_presets_2d.batch.quad = GPU_batch_create_ex(
323 
325  }
326  return g_presets_2d.batch.quad;
327 }
328 
331 /* -------------------------------------------------------------------- */
336 {
338 
339  /* Hard coded resolution */
340  g_presets_3d.batch.sphere_low = gpu_batch_sphere(8, 16);
341  gpu_batch_presets_register(g_presets_3d.batch.sphere_low);
342 
343  g_presets_3d.batch.sphere_med = gpu_batch_sphere(16, 10);
344  gpu_batch_presets_register(g_presets_3d.batch.sphere_med);
345 
346  g_presets_3d.batch.sphere_high = gpu_batch_sphere(32, 24);
347  gpu_batch_presets_register(g_presets_3d.batch.sphere_high);
348 
349  g_presets_3d.batch.sphere_wire_low = batch_sphere_wire(6, 8);
350  gpu_batch_presets_register(g_presets_3d.batch.sphere_wire_low);
351 
352  g_presets_3d.batch.sphere_wire_med = batch_sphere_wire(8, 16);
353  gpu_batch_presets_register(g_presets_3d.batch.sphere_wire_med);
354 }
355 
357 {
359  BLI_addtail(&presets_list, BLI_genericNodeN(preset_batch));
361 }
362 
364 {
366  for (LinkData *link = presets_list.last; link; link = link->prev) {
367  if (preset_batch == link->data) {
368  BLI_remlink(&presets_list, link);
370  MEM_freeN(link);
371  return true;
372  }
373  }
375  return false;
376 }
377 
379 {
380  LinkData *link;
381  while ((link = BLI_pophead(&presets_list))) {
382  GPUBatch *preset = link->data;
383  GPU_batch_discard(preset);
384  MEM_freeN(link);
385  }
386 
387  BLI_mutex_end(&g_presets_3d.mutex);
388 }
389 
#define BLI_assert(a)
Definition: BLI_assert.h:46
void * BLI_pophead(ListBase *listbase) ATTR_NONNULL(1)
Definition: listbase.c:221
struct LinkData * BLI_genericNodeN(void *data)
Definition: listbase.c:842
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:80
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:100
MINLINE int round_fl_to_int(float a)
MINLINE int max_ii(int a, int b)
#define M_PI
Definition: BLI_math_base.h:20
MINLINE void copy_v4_v4(float r[4], const float a[4])
MINLINE bool equals_v4v4(const float a[4], const float b[4]) ATTR_WARN_UNUSED_RESULT
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE void copy_v3_v3(float r[3], const float a[3])
unsigned int uint
Definition: BLI_sys_types.h:67
void BLI_mutex_end(ThreadMutex *mutex)
Definition: threads.cc:388
void BLI_mutex_init(ThreadMutex *mutex)
Definition: threads.cc:368
int BLI_thread_is_main(void)
Definition: threads.cc:207
void BLI_mutex_lock(ThreadMutex *mutex)
Definition: threads.cc:373
void BLI_mutex_unlock(ThreadMutex *mutex)
Definition: threads.cc:378
pthread_mutex_t ThreadMutex
Definition: BLI_threads.h:82
GPUBatch
Definition: GPU_batch.h:78
void GPU_batch_discard(GPUBatch *)
Definition: gpu_batch.cc:109
GPUBatch * GPU_batch_create_ex(GPUPrimType prim, GPUVertBuf *vert, GPUIndexBuf *elem, eGPUBatchFlag owns_flag)
Definition: gpu_batch.cc:43
@ GPU_BATCH_OWNS_VBO
Definition: GPU_batch.h:30
_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 y1
_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 x2
_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 width
@ GPU_PRIM_LINES
Definition: GPU_primitive.h:20
@ GPU_PRIM_TRI_STRIP
Definition: GPU_primitive.h:24
@ GPU_PRIM_TRIS
Definition: GPU_primitive.h:21
#define GPU_vertbuf_create_with_format(format)
struct GPUVertBuf GPUVertBuf
GPU_INLINE uint GPU_vertbuf_raw_used(GPUVertBufRaw *a)
void GPU_vertbuf_data_alloc(GPUVertBuf *, uint v_len)
void GPU_vertbuf_attr_fill(GPUVertBuf *, uint a_idx, const void *data)
GPU_INLINE void * GPU_vertbuf_raw_step(GPUVertBufRaw *a)
void GPU_vertbuf_attr_get_raw_data(GPUVertBuf *, uint a_idx, GPUVertBufRaw *access)
@ GPU_FETCH_FLOAT
uint GPU_vertformat_attr_add(GPUVertFormat *, const char *name, GPUVertCompType, uint comp_len, GPUVertFetchMode)
@ GPU_COMP_F32
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 color
#define sinf(x)
Definition: cuda/compat.h:102
#define cosf(x)
Definition: cuda/compat.h:101
bool gpu_batch_presets_unregister(GPUBatch *preset_batch)
static ListBase presets_list
float panel_drag_widget_width
GPUVertFormat format
uint pos
void gpu_batch_presets_register(GPUBatch *preset_batch)
static struct @654 g_presets_2d
GPUBatch * sphere_low
ThreadMutex mutex
static void batch_sphere_lat_lon_vert(GPUVertBufRaw *pos_step, GPUVertBufRaw *nor_step, float lat, float lon)
static GPUVertFormat * preset_2d_format(void)
GPUBatch * sphere_wire_low
void gpu_batch_presets_exit(void)
static GPUBatch * gpu_batch_sphere(int lat_res, int lon_res)
float panel_drag_widget_col_high[4]
GPUBatch * panel_drag_widget
static GPUVertFormat * preset_3d_format(void)
uint nor
GPUBatch * sphere_high
GPUBatch * GPU_batch_preset_sphere_wire(int lod)
GPUBatch * GPU_batch_preset_panel_drag_widget(const float pixelsize, const float col_high[4], const float col_dark[4], const float width)
struct @653::@656 attr_id
GPUBatch * sphere_med
uint col
float panel_drag_widget_pixelsize
static void gpu_batch_preset_rectf_tris_color_ex(GPUVertBufRaw *pos_step, float x1, float y1, float x2, float y2, GPUVertBufRaw *col_step, const float color[4])
GPUBatch * sphere_wire_med
GPUBatch * quad
void gpu_batch_presets_init(void)
GPUBatch * GPU_batch_preset_sphere(int lod)
static GPUBatch * gpu_batch_preset_panel_drag_widget(float pixelsize, const float col_high[4], const float col_dark[4], const float width)
static GPUBatch * batch_sphere_wire(int lat_res, int lon_res)
struct @653::@655 batch
GPUBatch * GPU_batch_preset_quad(void)
static struct @653 g_presets_3d
float panel_drag_widget_col_dark[4]
format
Definition: logImageCore.h:38
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:27
void * data
Definition: DNA_listBase.h:26
void * last
Definition: DNA_listBase.h:31