Blender  V2.93
gpu_py_state.c
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 
26 #include <Python.h>
27 
28 #include "GPU_state.h"
29 
30 #include "../generic/py_capi_utils.h"
31 #include "../generic/python_utildefines.h"
32 
33 #include "gpu_py_state.h" /* own include */
34 
35 /* -------------------------------------------------------------------- */
39 static const struct PyC_StringEnumItems pygpu_state_blend_items[] = {
40  {GPU_BLEND_NONE, "NONE"},
41  {GPU_BLEND_ALPHA, "ALPHA"},
42  {GPU_BLEND_ALPHA_PREMULT, "ALPHA_PREMULT"},
43  {GPU_BLEND_ADDITIVE, "ADDITIVE"},
44  {GPU_BLEND_ADDITIVE_PREMULT, "ADDITIVE_PREMULT"},
45  {GPU_BLEND_MULTIPLY, "MULTIPLY"},
46  {GPU_BLEND_SUBTRACT, "SUBTRACT"},
47  {GPU_BLEND_INVERT, "INVERT"},
54  {0, NULL},
55 };
56 
57 static const struct PyC_StringEnumItems pygpu_state_depthtest_items[] = {
58  {GPU_DEPTH_NONE, "NONE"},
59  {GPU_DEPTH_ALWAYS, "ALWAYS"},
60  {GPU_DEPTH_LESS, "LESS"},
61  {GPU_DEPTH_LESS_EQUAL, "LESS_EQUAL"},
62  {GPU_DEPTH_EQUAL, "EQUAL"},
63  {GPU_DEPTH_GREATER, "GREATER"},
64  {GPU_DEPTH_GREATER_EQUAL, "GREATER_EQUAL"},
65  {0, NULL},
66 };
67 
68 static const struct PyC_StringEnumItems pygpu_state_faceculling_items[] = {
69  {GPU_CULL_NONE, "NONE"},
70  {GPU_CULL_FRONT, "FRONT"},
71  {GPU_CULL_BACK, "BACK"},
72  {0, NULL},
73 };
74 
77 /* -------------------------------------------------------------------- */
82  pygpu_state_blend_set_doc,
83  ".. function:: blend_set(mode)\n"
84  "\n"
85  " Defines the fixed pipeline blending equation.\n"
86  "\n"
87  " :param mode: The type of blend mode.\n"
88  " * ``NONE`` No blending.\n"
89  " * ``ALPHA`` The original color channels are interpolated according to the alpha "
90  "value.\n"
91  " * ``ALPHA_PREMULT`` The original color channels are interpolated according to the "
92  "alpha value with the new colors pre-multiplied by this value.\n"
93  " * ``ADDITIVE`` The original color channels are added by the corresponding ones.\n"
94  " * ``ADDITIVE_PREMULT`` The original color channels are added by the corresponding ones "
95  "that are pre-multiplied by the alpha value.\n"
96  " * ``MULTIPLY`` The original color channels are multiplied by the corresponding ones.\n"
97  " * ``SUBTRACT`` The original color channels are subtracted by the corresponding ones.\n"
98  " * ``INVERT`` The original color channels are replaced by its complementary color.\n"
99  //" * ``OIT``.\n"
100  //" * ``BACKGROUND`` .\n"
101  //" * ``CUSTOM`` .\n"
102  " :type mode: str\n");
103 static PyObject *pygpu_state_blend_set(PyObject *UNUSED(self), PyObject *value)
104 {
105  struct PyC_StringEnum pygpu_blend = {pygpu_state_blend_items};
106  if (!PyC_ParseStringEnum(value, &pygpu_blend)) {
107  return NULL;
108  }
109  GPU_blend(pygpu_blend.value_found);
110  Py_RETURN_NONE;
111 }
112 
113 PyDoc_STRVAR(pygpu_state_blend_get_doc,
114  ".. function:: blend_get()\n"
115  "\n"
116  " Current blending equation.\n"
117  "\n");
118 static PyObject *pygpu_state_blend_get(PyObject *UNUSED(self))
119 {
121  return PyUnicode_FromString(PyC_StringEnum_FindIDFromValue(pygpu_state_blend_items, blend));
122 }
123 
124 PyDoc_STRVAR(pygpu_state_depth_test_set_doc,
125  ".. function:: depth_test_set(mode)\n"
126  "\n"
127  " Defines the depth_test equation.\n"
128  "\n"
129  " :param mode: The depth test equation name.\n"
130  " Possible values are `NONE`, `ALWAYS`, `LESS`, `LESS_EQUAL`, `EQUAL`, "
131  "`GREATER` and `GREATER_EQUAL`.\n"
132  " :type mode: str\n");
133 static PyObject *pygpu_state_depth_test_set(PyObject *UNUSED(self), PyObject *value)
134 {
135  struct PyC_StringEnum pygpu_depth_test = {pygpu_state_depthtest_items};
136  if (!PyC_ParseStringEnum(value, &pygpu_depth_test)) {
137  return NULL;
138  }
139  GPU_depth_test(pygpu_depth_test.value_found);
140  Py_RETURN_NONE;
141 }
142 
143 PyDoc_STRVAR(pygpu_state_depth_test_get_doc,
144  ".. function:: blend_depth_test_get()\n"
145  "\n"
146  " Current depth_test equation.\n"
147  "\n");
148 static PyObject *pygpu_state_depth_test_get(PyObject *UNUSED(self))
149 {
151  return PyUnicode_FromString(PyC_StringEnum_FindIDFromValue(pygpu_state_depthtest_items, test));
152 }
153 
154 PyDoc_STRVAR(pygpu_state_depth_mask_set_doc,
155  ".. function:: depth_mask_set(value)\n"
156  "\n"
157  " Write to depth component.\n"
158  "\n"
159  " :param value: True for writing to the depth component.\n"
160  " :type near: bool\n");
161 static PyObject *pygpu_state_depth_mask_set(PyObject *UNUSED(self), PyObject *value)
162 {
163  bool write_to_depth;
164  if (!PyC_ParseBool(value, &write_to_depth)) {
165  return NULL;
166  }
167  GPU_depth_mask(write_to_depth);
168  Py_RETURN_NONE;
169 }
170 
171 PyDoc_STRVAR(pygpu_state_depth_mask_get_doc,
172  ".. function:: depth_mask_set_get()\n"
173  "\n"
174  " Writing status in the depth component.\n");
175 static PyObject *pygpu_state_depth_mask_get(PyObject *UNUSED(self))
176 {
177  return PyBool_FromLong(GPU_depth_mask_get());
178 }
179 
180 PyDoc_STRVAR(pygpu_state_viewport_set_doc,
181  ".. function:: viewport_set(x, y, xsize, ysize)\n"
182  "\n"
183  " Specifies the viewport of the active framebuffer.\n"
184  " Note: The viewport state is not saved upon framebuffer rebind.\n"
185  "\n"
186  " :param x, y: lower left corner of the viewport_set rectangle, in pixels.\n"
187  " :param width, height: width and height of the viewport_set.\n"
188  " :type x, y, xsize, ysize: int\n");
189 static PyObject *pygpu_state_viewport_set(PyObject *UNUSED(self), PyObject *args)
190 {
191  int x, y, xsize, ysize;
192  if (!PyArg_ParseTuple(args, "iiii:viewport_set", &x, &y, &xsize, &ysize)) {
193  return NULL;
194  }
195 
196  GPU_viewport(x, y, xsize, ysize);
197  Py_RETURN_NONE;
198 }
199 
200 PyDoc_STRVAR(pygpu_state_viewport_get_doc,
201  ".. function:: viewport_get()\n"
202  "\n"
203  " Viewport of the active framebuffer.\n");
204 static PyObject *pygpu_state_viewport_get(PyObject *UNUSED(self), PyObject *UNUSED(args))
205 {
206  int viewport[4];
207  GPU_viewport_size_get_i(viewport);
208 
209  PyObject *ret = PyTuple_New(4);
211  PyLong_FromLong(viewport[0]),
212  PyLong_FromLong(viewport[1]),
213  PyLong_FromLong(viewport[2]),
214  PyLong_FromLong(viewport[3]));
215  return ret;
216 }
217 
218 PyDoc_STRVAR(pygpu_state_line_width_set_doc,
219  ".. function:: line_width_set(width)\n"
220  "\n"
221  " Specify the width of rasterized lines.\n"
222  "\n"
223  " :param size: New width.\n"
224  " :type mode: float\n");
225 static PyObject *pygpu_state_line_width_set(PyObject *UNUSED(self), PyObject *value)
226 {
227  float width = (float)PyFloat_AsDouble(value);
228  if (PyErr_Occurred()) {
229  return NULL;
230  }
231 
233  Py_RETURN_NONE;
234 }
235 
236 PyDoc_STRVAR(pygpu_state_line_width_get_doc,
237  ".. function:: line_width_get()\n"
238  "\n"
239  " Current width of rasterized lines.\n");
240 static PyObject *pygpu_state_line_width_get(PyObject *UNUSED(self))
241 {
242  float width = GPU_line_width_get();
243  return PyFloat_FromDouble((double)width);
244 }
245 
246 PyDoc_STRVAR(pygpu_state_point_size_set_doc,
247  ".. function:: point_size_set(size)\n"
248  "\n"
249  " Specify the diameter of rasterized points.\n"
250  "\n"
251  " :param size: New diameter.\n"
252  " :type mode: float\n");
253 static PyObject *pygpu_state_point_size_set(PyObject *UNUSED(self), PyObject *value)
254 {
255  float size = (float)PyFloat_AsDouble(value);
256  if (PyErr_Occurred()) {
257  return NULL;
258  }
259 
261  Py_RETURN_NONE;
262 }
263 
264 PyDoc_STRVAR(pygpu_state_color_mask_set_doc,
265  ".. function:: color_mask_set(r, g, b, a)\n"
266  "\n"
267  " Enable or disable writing of frame buffer color components.\n"
268  "\n"
269  " :param r, g, b, a: components red, green, blue, and alpha.\n"
270  " :type r, g, b, a: bool\n");
271 static PyObject *pygpu_state_color_mask_set(PyObject *UNUSED(self), PyObject *args)
272 {
273  int r, g, b, a;
274  if (!PyArg_ParseTuple(args, "pppp:color_mask_set", &r, &g, &b, &a)) {
275  return NULL;
276  }
277 
278  GPU_color_mask((bool)r, (bool)g, (bool)b, (bool)a);
279  Py_RETURN_NONE;
280 }
281 
282 PyDoc_STRVAR(pygpu_state_face_culling_set_doc,
283  ".. function:: face_culling_set(culling)\n"
284  "\n"
285  " Specify whether none, front-facing or back-facing facets can be culled.\n"
286  "\n"
287  " :param mode: `NONE`, `FRONT` or `BACK`.\n"
288  " :type mode: str\n");
289 static PyObject *pygpu_state_face_culling_set(PyObject *UNUSED(self), PyObject *value)
290 {
291  struct PyC_StringEnum pygpu_faceculling = {pygpu_state_faceculling_items};
292  if (!PyC_ParseStringEnum(value, &pygpu_faceculling)) {
293  return NULL;
294  }
295 
296  GPU_face_culling(pygpu_faceculling.value_found);
297  Py_RETURN_NONE;
298 }
299 
300 PyDoc_STRVAR(pygpu_state_front_facing_set_doc,
301  ".. function:: front_facing_set(invert)\n"
302  "\n"
303  " Specifies the orientation of front-facing polygons.\n"
304  "\n"
305  " :param invert: True for clockwise polygons as front-facing.\n"
306  " :type mode: bool\n");
307 static PyObject *pygpu_state_front_facing_set(PyObject *UNUSED(self), PyObject *value)
308 {
309  bool invert;
310  if (!PyC_ParseBool(value, &invert)) {
311  return NULL;
312  }
313 
315  Py_RETURN_NONE;
316 }
317 
318 PyDoc_STRVAR(pygpu_state_program_point_size_set_doc,
319  ".. function:: use_program_point_size(enable)\n"
320  "\n"
321  " If enabled, the derived point size is taken from the (potentially clipped) "
322  "shader builtin gl_PointSize.\n"
323  "\n"
324  " :param enable: True for shader builtin gl_PointSize.\n"
325  " :type enable: bool\n");
326 static PyObject *pygpu_state_program_point_size_set(PyObject *UNUSED(self), PyObject *value)
327 {
328  bool enable;
329  if (!PyC_ParseBool(value, &enable)) {
330  return NULL;
331  }
332 
333  GPU_program_point_size(enable);
334  Py_RETURN_NONE;
335 }
336 
339 /* -------------------------------------------------------------------- */
343 static struct PyMethodDef pygpu_state__tp_methods[] = {
344  /* Manage Stack */
345  {"blend_set", (PyCFunction)pygpu_state_blend_set, METH_O, pygpu_state_blend_set_doc},
346  {"blend_get", (PyCFunction)pygpu_state_blend_get, METH_NOARGS, pygpu_state_blend_get_doc},
347  {"depth_test_set",
348  (PyCFunction)pygpu_state_depth_test_set,
349  METH_O,
350  pygpu_state_depth_test_set_doc},
351  {"depth_test_get",
352  (PyCFunction)pygpu_state_depth_test_get,
353  METH_NOARGS,
354  pygpu_state_depth_test_get_doc},
355  {"depth_mask_set",
356  (PyCFunction)pygpu_state_depth_mask_set,
357  METH_O,
358  pygpu_state_depth_mask_set_doc},
359  {"depth_mask_get",
360  (PyCFunction)pygpu_state_depth_mask_get,
361  METH_NOARGS,
362  pygpu_state_depth_mask_get_doc},
363  {"viewport_set",
364  (PyCFunction)pygpu_state_viewport_set,
365  METH_VARARGS,
366  pygpu_state_viewport_set_doc},
367  {"viewport_get",
368  (PyCFunction)pygpu_state_viewport_get,
369  METH_NOARGS,
370  pygpu_state_viewport_get_doc},
371  {"line_width_set",
372  (PyCFunction)pygpu_state_line_width_set,
373  METH_O,
374  pygpu_state_line_width_set_doc},
375  {"line_width_get",
376  (PyCFunction)pygpu_state_line_width_get,
377  METH_NOARGS,
378  pygpu_state_line_width_get_doc},
379  {"point_size_set",
380  (PyCFunction)pygpu_state_point_size_set,
381  METH_O,
382  pygpu_state_point_size_set_doc},
383  {"color_mask_set",
384  (PyCFunction)pygpu_state_color_mask_set,
385  METH_VARARGS,
386  pygpu_state_color_mask_set_doc},
387  {"face_culling_set",
388  (PyCFunction)pygpu_state_face_culling_set,
389  METH_O,
390  pygpu_state_face_culling_set_doc},
391  {"front_facing_set",
392  (PyCFunction)pygpu_state_front_facing_set,
393  METH_O,
394  pygpu_state_front_facing_set_doc},
395  {"program_point_size_set",
397  METH_O,
398  pygpu_state_program_point_size_set_doc},
399  {NULL, NULL, 0, NULL},
400 };
401 
402 PyDoc_STRVAR(pygpu_state__tp_doc, "This module provides access to the gpu state.");
403 static PyModuleDef pygpu_state_module_def = {
404  PyModuleDef_HEAD_INIT,
405  .m_name = "gpu.state",
406  .m_doc = pygpu_state__tp_doc,
407  .m_methods = pygpu_state__tp_methods,
408 };
409 
410 PyObject *bpygpu_state_init(void)
411 {
412  PyObject *submodule;
413 
414  submodule = PyModule_Create(&pygpu_state_module_def);
415 
416  return submodule;
417 }
418 
typedef float(TangentPoint)[2]
#define UNUSED(x)
_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 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
_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 y
void GPU_program_point_size(bool enable)
Definition: gpu_state.cc:191
void GPU_face_culling(eGPUFaceCullTest culling)
Definition: gpu_state.cc:60
eGPUBlend
Definition: GPU_state.h:54
@ GPU_BLEND_ADDITIVE_PREMULT
Definition: GPU_state.h:60
@ GPU_BLEND_INVERT
Definition: GPU_state.h:65
@ GPU_BLEND_MULTIPLY
Definition: GPU_state.h:61
@ GPU_BLEND_NONE
Definition: GPU_state.h:55
@ GPU_BLEND_ALPHA
Definition: GPU_state.h:57
@ GPU_BLEND_ADDITIVE
Definition: GPU_state.h:59
@ GPU_BLEND_SUBTRACT
Definition: GPU_state.h:62
@ GPU_BLEND_ALPHA_PREMULT
Definition: GPU_state.h:58
void GPU_blend(eGPUBlend blend)
Definition: gpu_state.cc:55
void GPU_line_width(float width)
Definition: gpu_state.cc:173
float GPU_line_width_get(void)
Definition: gpu_state.cc:268
void GPU_depth_mask(bool depth)
Definition: gpu_state.cc:117
@ GPU_CULL_FRONT
Definition: GPU_state.h:104
@ GPU_CULL_NONE
Definition: GPU_state.h:103
@ GPU_CULL_BACK
Definition: GPU_state.h:105
void GPU_color_mask(bool r, bool g, bool b, bool a)
Definition: gpu_state.cc:105
void GPU_viewport_size_get_i(int coords[4])
Definition: gpu_state.cc:288
eGPUBlend GPU_blend_get(void)
Definition: gpu_state.cc:237
void GPU_front_facing(bool invert)
Definition: gpu_state.cc:65
void GPU_viewport(int x, int y, int width, int height)
Definition: gpu_state.cc:210
void GPU_point_size(float size)
Definition: gpu_state.cc:179
bool GPU_depth_mask_get(void)
Definition: gpu_state.cc:293
eGPUDepthTest
Definition: GPU_state.h:77
@ GPU_DEPTH_GREATER
Definition: GPU_state.h:83
@ GPU_DEPTH_EQUAL
Definition: GPU_state.h:82
@ GPU_DEPTH_ALWAYS
Definition: GPU_state.h:79
@ GPU_DEPTH_GREATER_EQUAL
Definition: GPU_state.h:84
@ GPU_DEPTH_LESS
Definition: GPU_state.h:80
@ GPU_DEPTH_LESS_EQUAL
Definition: GPU_state.h:81
@ GPU_DEPTH_NONE
Definition: GPU_state.h:78
eGPUDepthTest GPU_depth_test_get(void)
Definition: gpu_state.cc:255
void GPU_depth_test(eGPUDepthTest test)
Definition: gpu_state.cc:75
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition: btDbvt.cpp:52
static PyObject * pygpu_state_depth_mask_set(PyObject *UNUSED(self), PyObject *value)
Definition: gpu_py_state.c:161
static const struct PyC_StringEnumItems pygpu_state_faceculling_items[]
Definition: gpu_py_state.c:68
static PyObject * pygpu_state_viewport_set(PyObject *UNUSED(self), PyObject *args)
Definition: gpu_py_state.c:189
static PyObject * pygpu_state_blend_set(PyObject *UNUSED(self), PyObject *value)
Definition: gpu_py_state.c:103
static const struct PyC_StringEnumItems pygpu_state_depthtest_items[]
Definition: gpu_py_state.c:57
static PyObject * pygpu_state_front_facing_set(PyObject *UNUSED(self), PyObject *value)
Definition: gpu_py_state.c:307
static PyObject * pygpu_state_blend_get(PyObject *UNUSED(self))
Definition: gpu_py_state.c:118
static PyObject * pygpu_state_depth_mask_get(PyObject *UNUSED(self))
Definition: gpu_py_state.c:175
static PyObject * pygpu_state_depth_test_set(PyObject *UNUSED(self), PyObject *value)
Definition: gpu_py_state.c:133
PyDoc_STRVAR(pygpu_state_blend_set_doc, ".. function:: blend_set(mode)\n" "\n" " Defines the fixed pipeline blending equation.\n" "\n" " :param mode: The type of blend mode.\n" " * ``NONE`` No blending.\n" " * ``ALPHA`` The original color channels are interpolated according to the alpha " "value.\n" " * ``ALPHA_PREMULT`` The original color channels are interpolated according to the " "alpha value with the new colors pre-multiplied by this value.\n" " * ``ADDITIVE`` The original color channels are added by the corresponding ones.\n" " * ``ADDITIVE_PREMULT`` The original color channels are added by the corresponding ones " "that are pre-multiplied by the alpha value.\n" " * ``MULTIPLY`` The original color channels are multiplied by the corresponding ones.\n" " * ``SUBTRACT`` The original color channels are subtracted by the corresponding ones.\n" " * ``INVERT`` The original color channels are replaced by its complementary color.\n" " :type mode: str\n")
static PyObject * pygpu_state_point_size_set(PyObject *UNUSED(self), PyObject *value)
Definition: gpu_py_state.c:253
static PyObject * pygpu_state_face_culling_set(PyObject *UNUSED(self), PyObject *value)
Definition: gpu_py_state.c:289
static PyObject * pygpu_state_program_point_size_set(PyObject *UNUSED(self), PyObject *value)
Definition: gpu_py_state.c:326
static PyObject * pygpu_state_line_width_get(PyObject *UNUSED(self))
Definition: gpu_py_state.c:240
static PyObject * pygpu_state_viewport_get(PyObject *UNUSED(self), PyObject *UNUSED(args))
Definition: gpu_py_state.c:204
static struct PyMethodDef pygpu_state__tp_methods[]
Definition: gpu_py_state.c:343
static PyObject * pygpu_state_line_width_set(PyObject *UNUSED(self), PyObject *value)
Definition: gpu_py_state.c:225
static PyObject * pygpu_state_color_mask_set(PyObject *UNUSED(self), PyObject *args)
Definition: gpu_py_state.c:271
static PyModuleDef pygpu_state_module_def
Definition: gpu_py_state.c:403
static PyObject * pygpu_state_depth_test_get(PyObject *UNUSED(self))
Definition: gpu_py_state.c:148
PyObject * bpygpu_state_init(void)
Definition: gpu_py_state.c:410
static const struct PyC_StringEnumItems pygpu_state_blend_items[]
Definition: gpu_py_state.c:39
static unsigned a[3]
Definition: RandGen.cpp:92
int PyC_ParseStringEnum(PyObject *o, void *p)
const char * PyC_StringEnum_FindIDFromValue(const struct PyC_StringEnumItems *items, const int value)
int PyC_ParseBool(PyObject *o, void *p)
#define PyTuple_SET_ITEMS(op_arg,...)
return ret
CCL_NAMESPACE_BEGIN ccl_device float invert(float color, float factor)
Definition: svm_invert.h:19
static int blend(const Tex *tex, const float texvec[3], TexResult *texres)