Blender  V2.93
GPU_shader.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2005 Blender Foundation.
17  * All rights reserved.
18  */
19 
24 #pragma once
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 struct GPUVertBuf;
31 
33 typedef struct GPUShader GPUShader;
34 
35 typedef enum eGPUShaderTFBType {
36  GPU_SHADER_TFB_NONE = 0, /* Transform feedback unsupported. */
41 
42 GPUShader *GPU_shader_create(const char *vertcode,
43  const char *fragcode,
44  const char *geomcode,
45  const char *libcode,
46  const char *defines,
47  const char *shname);
48 GPUShader *GPU_shader_create_from_python(const char *vertcode,
49  const char *fragcode,
50  const char *geomcode,
51  const char *libcode,
52  const char *defines);
53 GPUShader *GPU_shader_create_ex(const char *vertcode,
54  const char *fragcode,
55  const char *geomcode,
56  const char *libcode,
57  const char *defines,
58  const eGPUShaderTFBType tf_type,
59  const char **tf_names,
60  const int tf_count,
61  const char *shname);
62 
64  const char **vert, **geom, **frag, **defs;
65 };
67  const struct GPU_ShaderCreateFromArray_Params *params, const char *func, int line);
68 
69 #define GPU_shader_create_from_arrays(...) \
70  GPU_shader_create_from_arrays_impl( \
71  &(const struct GPU_ShaderCreateFromArray_Params)__VA_ARGS__, __func__, __LINE__)
72 
73 #define GPU_shader_create_from_arrays_named(name, ...) \
74  GPU_shader_create_from_arrays_impl( \
75  &(const struct GPU_ShaderCreateFromArray_Params)__VA_ARGS__, name, 0)
76 
78 
80 void GPU_shader_unbind(void);
81 
82 /* Returns true if transform feedback was successfully enabled. */
85 
87 
88 typedef enum {
89  GPU_UNIFORM_MODEL = 0, /* mat4 ModelMatrix */
90  GPU_UNIFORM_VIEW, /* mat4 ViewMatrix */
91  GPU_UNIFORM_MODELVIEW, /* mat4 ModelViewMatrix */
92  GPU_UNIFORM_PROJECTION, /* mat4 ProjectionMatrix */
93  GPU_UNIFORM_VIEWPROJECTION, /* mat4 ViewProjectionMatrix */
94  GPU_UNIFORM_MVP, /* mat4 ModelViewProjectionMatrix */
95 
96  GPU_UNIFORM_MODEL_INV, /* mat4 ModelMatrixInverse */
97  GPU_UNIFORM_VIEW_INV, /* mat4 ViewMatrixInverse */
98  GPU_UNIFORM_MODELVIEW_INV, /* mat4 ModelViewMatrixInverse */
99  GPU_UNIFORM_PROJECTION_INV, /* mat4 ProjectionMatrixInverse */
100  GPU_UNIFORM_VIEWPROJECTION_INV, /* mat4 ViewProjectionMatrixInverse */
101 
102  GPU_UNIFORM_NORMAL, /* mat3 NormalMatrix */
103  GPU_UNIFORM_ORCO, /* vec4 OrcoTexCoFactors[] */
104  GPU_UNIFORM_CLIPPLANES, /* vec4 WorldClipPlanes[] */
105 
106  GPU_UNIFORM_COLOR, /* vec4 color */
107  GPU_UNIFORM_BASE_INSTANCE, /* int baseInstance */
108  GPU_UNIFORM_RESOURCE_CHUNK, /* int resourceChunk */
109  GPU_UNIFORM_RESOURCE_ID, /* int resourceId */
110  GPU_UNIFORM_SRGB_TRANSFORM, /* bool srgbTarget */
111 
112  GPU_NUM_UNIFORMS, /* Special value, denotes number of builtin uniforms. */
114 
115 typedef enum {
116  GPU_UNIFORM_BLOCK_VIEW = 0, /* viewBlock */
117  GPU_UNIFORM_BLOCK_MODEL, /* modelBlock */
118  GPU_UNIFORM_BLOCK_INFO, /* infoBlock */
119 
120  GPU_NUM_UNIFORM_BLOCKS, /* Special value, denotes number of builtin uniforms block. */
122 
124 
125 int GPU_shader_get_uniform(GPUShader *shader, const char *name);
128 int GPU_shader_get_uniform_block(GPUShader *shader, const char *name);
129 
131 int GPU_shader_get_texture_binding(GPUShader *shader, const char *name);
132 
134  GPUShader *shader, int location, int length, int arraysize, const float *value);
136  GPUShader *shader, int location, int length, int arraysize, const int *value);
137 
138 void GPU_shader_uniform_float(GPUShader *shader, int location, float value);
139 void GPU_shader_uniform_int(GPUShader *shader, int location, int value);
140 
141 void GPU_shader_uniform_1i(GPUShader *sh, const char *name, int value);
142 void GPU_shader_uniform_1b(GPUShader *sh, const char *name, bool value);
143 void GPU_shader_uniform_1f(GPUShader *sh, const char *name, float value);
144 void GPU_shader_uniform_2f(GPUShader *sh, const char *name, float x, float y);
145 void GPU_shader_uniform_3f(GPUShader *sh, const char *name, float x, float y, float z);
146 void GPU_shader_uniform_4f(GPUShader *sh, const char *name, float x, float y, float z, float w);
147 void GPU_shader_uniform_2fv(GPUShader *sh, const char *name, const float data[2]);
148 void GPU_shader_uniform_3fv(GPUShader *sh, const char *name, const float data[3]);
149 void GPU_shader_uniform_4fv(GPUShader *sh, const char *name, const float data[4]);
150 void GPU_shader_uniform_mat4(GPUShader *sh, const char *name, const float data[4][4]);
151 void GPU_shader_uniform_2fv_array(GPUShader *sh, const char *name, int len, const float (*val)[2]);
152 void GPU_shader_uniform_4fv_array(GPUShader *sh, const char *name, int len, const float (*val)[4]);
153 
154 int GPU_shader_get_attribute(GPUShader *shader, const char *name);
155 
156 void GPU_shader_set_framebuffer_srgb_target(int use_srgb_to_linear);
157 
158 /* Builtin/Non-generated shaders */
159 typedef enum eGPUBuiltinShader {
160  /* specialized drawing */
164  /* for simple 2D drawing */
193  /* for simple 3D drawing */
248  /* basic image drawing */
261  /* points */
364  /* lines */
367  /* instance */
369  /* grease pencil drawing */
371  /* specialized for widget drawing */
378  /* specialized for edituv drawing */
388 #define GPU_SHADER_BUILTIN_LEN (GPU_SHADER_2D_UV_FACES_STRETCH_ANGLE + 1)
389 
391 typedef enum eGPUShaderConfig {
395 #define GPU_SHADER_CFG_LEN (GPU_SHADER_CFG_CLIPPED + 1)
396 
397 typedef struct GPUShaderConfigData {
398  const char *lib;
399  const char *def;
401 /* gpu_shader.c */
403 
405  eGPUShaderConfig sh_cfg);
407 
409  const char **r_vert,
410  const char **r_frag,
411  const char **r_geom,
412  const char **r_defines);
413 
415 
416 /* Vertex attributes for shaders */
417 
418 /* Hardware limit is 16. Position attribute is always needed so we reduce to 15.
419  * This makes sure the GPUVertexFormat name buffer does not overflow. */
420 #define GPU_MAX_ATTR 15
421 
422 /* Determined by the maximum uniform buffer size divided by chunk size. */
423 #define GPU_MAX_UNIFORM_ATTR 8
424 
425 #ifdef __cplusplus
426 }
427 #endif
_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 z
_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
GPUShader * GPU_shader_create(const char *vertcode, const char *fragcode, const char *geomcode, const char *libcode, const char *defines, const char *shname)
Definition: gpu_shader.cc:376
void GPU_shader_unbind(void)
Definition: gpu_shader.cc:516
int GPU_shader_get_uniform(GPUShader *shader, const char *name)
Definition: gpu_shader.cc:551
void GPU_shader_uniform_2fv(GPUShader *sh, const char *name, const float data[2])
Definition: gpu_shader.cc:674
void GPU_shader_uniform_vector_int(GPUShader *shader, int location, int length, int arraysize, const int *value)
Definition: gpu_shader.cc:623
void GPU_shader_set_srgb_uniform(GPUShader *shader)
Definition: gpu_shader.cc:731
struct GPUShader GPUShader
Definition: GPU_shader.h:33
void GPU_shader_uniform_1i(GPUShader *sh, const char *name, int value)
Definition: gpu_shader.cc:639
void GPU_shader_uniform_3f(GPUShader *sh, const char *name, float x, float y, float z)
Definition: gpu_shader.cc:656
eGPUShaderConfig
Definition: GPU_shader.h:391
@ GPU_SHADER_CFG_DEFAULT
Definition: GPU_shader.h:392
@ GPU_SHADER_CFG_CLIPPED
Definition: GPU_shader.h:393
void GPU_shader_uniform_2f(GPUShader *sh, const char *name, float x, float y)
Definition: gpu_shader.cc:650
void GPU_shader_uniform_2fv_array(GPUShader *sh, const char *name, int len, const float(*val)[2])
Definition: gpu_shader.cc:698
GPUShader * GPU_shader_get_builtin_shader_with_config(eGPUBuiltinShader shader, eGPUShaderConfig sh_cfg)
void GPU_shader_set_framebuffer_srgb_target(int use_srgb_to_linear)
Definition: gpu_shader.cc:740
void GPU_shader_free_builtin_shaders(void)
void GPU_shader_uniform_1f(GPUShader *sh, const char *name, float value)
Definition: gpu_shader.cc:668
GPUShader * GPU_shader_create_ex(const char *vertcode, const char *fragcode, const char *geomcode, const char *libcode, const char *defines, const eGPUShaderTFBType tf_type, const char **tf_names, const int tf_count, const char *shname)
Definition: gpu_shader.cc:290
void GPU_shader_uniform_vector(GPUShader *shader, int location, int length, int arraysize, const float *value)
Definition: gpu_shader.cc:617
void GPU_shader_uniform_3fv(GPUShader *sh, const char *name, const float data[3])
Definition: gpu_shader.cc:680
int GPU_shader_get_attribute(GPUShader *shader, const char *name)
Definition: gpu_shader.cc:592
bool GPU_shader_transform_feedback_enable(GPUShader *shader, struct GPUVertBuf *vertbuf)
Definition: gpu_shader.cc:535
const GPUShaderConfigData GPU_shader_cfg_data[GPU_SHADER_CFG_LEN]
void GPU_shader_uniform_4fv_array(GPUShader *sh, const char *name, int len, const float(*val)[4])
Definition: gpu_shader.cc:704
void GPU_shader_uniform_int(GPUShader *shader, int location, int value)
Definition: gpu_shader.cc:629
int GPU_shader_get_builtin_block(GPUShader *shader, int builtin)
Definition: gpu_shader.cc:564
struct GPUShaderConfigData GPUShaderConfigData
eGPUShaderTFBType
Definition: GPU_shader.h:35
@ GPU_SHADER_TFB_TRIANGLES
Definition: GPU_shader.h:39
@ GPU_SHADER_TFB_NONE
Definition: GPU_shader.h:36
@ GPU_SHADER_TFB_LINES
Definition: GPU_shader.h:38
@ GPU_SHADER_TFB_POINTS
Definition: GPU_shader.h:37
int GPU_shader_get_uniform_block_binding(GPUShader *shader, const char *name)
Definition: gpu_shader.cc:578
GPUShader * GPU_shader_create_from_python(const char *vertcode, const char *fragcode, const char *geomcode, const char *libcode, const char *defines)
Definition: gpu_shader.cc:387
void GPU_shader_transform_feedback_disable(GPUShader *shader)
Definition: gpu_shader.cc:540
int GPU_shader_get_program(GPUShader *shader)
Definition: gpu_shader.cc:606
GPUShader * GPU_shader_get_builtin_shader(eGPUBuiltinShader shader)
void GPU_shader_bind(GPUShader *shader)
Definition: gpu_shader.cc:494
void GPU_shader_uniform_1b(GPUShader *sh, const char *name, bool value)
Definition: gpu_shader.cc:645
GPUUniformBuiltin
Definition: GPU_shader.h:88
@ GPU_UNIFORM_VIEWPROJECTION_INV
Definition: GPU_shader.h:100
@ GPU_UNIFORM_PROJECTION
Definition: GPU_shader.h:92
@ GPU_UNIFORM_RESOURCE_ID
Definition: GPU_shader.h:109
@ GPU_UNIFORM_ORCO
Definition: GPU_shader.h:103
@ GPU_UNIFORM_VIEWPROJECTION
Definition: GPU_shader.h:93
@ GPU_UNIFORM_SRGB_TRANSFORM
Definition: GPU_shader.h:110
@ GPU_UNIFORM_VIEW
Definition: GPU_shader.h:90
@ GPU_UNIFORM_MODEL
Definition: GPU_shader.h:89
@ GPU_UNIFORM_MODELVIEW
Definition: GPU_shader.h:91
@ GPU_UNIFORM_BASE_INSTANCE
Definition: GPU_shader.h:107
@ GPU_UNIFORM_VIEW_INV
Definition: GPU_shader.h:97
@ GPU_UNIFORM_MODEL_INV
Definition: GPU_shader.h:96
@ GPU_UNIFORM_PROJECTION_INV
Definition: GPU_shader.h:99
@ GPU_UNIFORM_CLIPPLANES
Definition: GPU_shader.h:104
@ GPU_UNIFORM_COLOR
Definition: GPU_shader.h:106
@ GPU_UNIFORM_MODELVIEW_INV
Definition: GPU_shader.h:98
@ GPU_UNIFORM_NORMAL
Definition: GPU_shader.h:102
@ GPU_UNIFORM_RESOURCE_CHUNK
Definition: GPU_shader.h:108
@ GPU_NUM_UNIFORMS
Definition: GPU_shader.h:112
@ GPU_UNIFORM_MVP
Definition: GPU_shader.h:94
void GPU_shader_get_builtin_shader_code(eGPUBuiltinShader shader, const char **r_vert, const char **r_frag, const char **r_geom, const char **r_defines)
void GPU_shader_uniform_4fv(GPUShader *sh, const char *name, const float data[4])
Definition: gpu_shader.cc:686
void GPU_shader_uniform_4f(GPUShader *sh, const char *name, float x, float y, float z, float w)
Definition: gpu_shader.cc:662
int GPU_shader_get_uniform_block(GPUShader *shader, const char *name)
Definition: gpu_shader.cc:571
eGPUBuiltinShader
Definition: GPU_shader.h:159
@ GPU_SHADER_2D_DIAG_STRIPES
Definition: GPU_shader.h:192
@ GPU_SHADER_2D_POINT_VARYING_SIZE_VARYING_COLOR
Definition: GPU_shader.h:309
@ GPU_SHADER_3D_SMOOTH_COLOR
Definition: GPU_shader.h:215
@ GPU_SHADER_2D_UV_EDGES
Definition: GPU_shader.h:382
@ GPU_SHADER_GPENCIL_STROKE
Definition: GPU_shader.h:370
@ GPU_SHADER_2D_AREA_EDGES
Definition: GPU_shader.h:372
@ GPU_SHADER_2D_NODELINK_INST
Definition: GPU_shader.h:377
@ GPU_SHADER_3D_LINE_DASHED_UNIFORM_COLOR
Definition: GPU_shader.h:366
@ GPU_SHADER_3D_POLYLINE_SMOOTH_COLOR
Definition: GPU_shader.h:240
@ GPU_SHADER_3D_POINT_VARYING_SIZE_VARYING_COLOR
Definition: GPU_shader.h:363
@ GPU_SHADER_2D_LINE_DASHED_UNIFORM_COLOR
Definition: GPU_shader.h:365
@ GPU_SHADER_2D_UV_FACES
Definition: GPU_shader.h:384
@ GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR
Definition: GPU_shader.h:223
@ GPU_SHADER_2D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_AA
Definition: GPU_shader.h:278
@ GPU_SHADER_2D_IMAGE_DESATURATE_COLOR
Definition: GPU_shader.h:188
@ GPU_SHADER_2D_POINT_UNIFORM_SIZE_VARYING_COLOR_OUTLINE_AA
Definition: GPU_shader.h:300
@ GPU_SHADER_3D_DEPTH_ONLY
Definition: GPU_shader.h:247
@ GPU_SHADER_TEXT
Definition: GPU_shader.h:161
@ GPU_SHADER_3D_CLIPPED_UNIFORM_COLOR
Definition: GPU_shader.h:201
@ GPU_SHADER_2D_UV_UNIFORM_COLOR
Definition: GPU_shader.h:379
@ GPU_SHADER_3D_IMAGE_MODULATE_ALPHA
Definition: GPU_shader.h:260
@ GPU_SHADER_2D_CHECKER
Definition: GPU_shader.h:191
@ GPU_SHADER_3D_POINT_FIXED_SIZE_UNIFORM_COLOR
Definition: GPU_shader.h:317
@ GPU_SHADER_3D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_AA
Definition: GPU_shader.h:334
@ GPU_SHADER_2D_IMAGE_MULTI_RECT_COLOR
Definition: GPU_shader.h:190
@ GPU_SHADER_2D_SMOOTH_COLOR
Definition: GPU_shader.h:185
@ GPU_SHADER_2D_UNIFORM_COLOR
Definition: GPU_shader.h:171
@ GPU_SHADER_3D_POINT_FIXED_SIZE_VARYING_COLOR
Definition: GPU_shader.h:325
@ GPU_SHADER_3D_UNIFORM_COLOR
Definition: GPU_shader.h:200
@ GPU_SHADER_2D_IMAGE_RECT_COLOR
Definition: GPU_shader.h:189
@ GPU_SHADER_3D_FLAT_COLOR
Definition: GPU_shader.h:208
@ GPU_SHADER_3D_POINT_VARYING_SIZE_UNIFORM_COLOR
Definition: GPU_shader.h:354
@ GPU_SHADER_2D_UV_VERTS
Definition: GPU_shader.h:380
@ GPU_SHADER_2D_WIDGET_BASE_INST
Definition: GPU_shader.h:374
@ GPU_SHADER_2D_IMAGE_SHUFFLE_COLOR
Definition: GPU_shader.h:251
@ GPU_SHADER_2D_IMAGE_OVERLAYS_STEREO_MERGE
Definition: GPU_shader.h:250
@ GPU_SHADER_2D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_OUTLINE_AA
Definition: GPU_shader.h:289
@ GPU_SHADER_2D_IMAGE
Definition: GPU_shader.h:186
@ GPU_SHADER_3D_POLYLINE_FLAT_COLOR
Definition: GPU_shader.h:232
@ GPU_SHADER_INSTANCE_VARIYING_COLOR_VARIYING_SIZE
Definition: GPU_shader.h:368
@ GPU_SHADER_SIMPLE_LIGHTING
Definition: GPU_shader.h:163
@ GPU_SHADER_2D_UV_FACEDOTS
Definition: GPU_shader.h:381
@ GPU_SHADER_KEYFRAME_DIAMOND
Definition: GPU_shader.h:162
@ GPU_SHADER_2D_IMAGE_COLOR
Definition: GPU_shader.h:187
@ GPU_SHADER_2D_WIDGET_SHADOW
Definition: GPU_shader.h:375
@ GPU_SHADER_2D_FLAT_COLOR
Definition: GPU_shader.h:178
@ GPU_SHADER_2D_POINT_FIXED_SIZE_UNIFORM_COLOR
Definition: GPU_shader.h:269
@ GPU_SHADER_2D_WIDGET_BASE
Definition: GPU_shader.h:373
@ GPU_SHADER_3D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_OUTLINE_AA
Definition: GPU_shader.h:345
@ GPU_SHADER_3D_POLYLINE_CLIPPED_UNIFORM_COLOR
Definition: GPU_shader.h:224
@ GPU_SHADER_2D_IMAGE_OVERLAYS_MERGE
Definition: GPU_shader.h:249
@ GPU_SHADER_2D_UV_EDGES_SMOOTH
Definition: GPU_shader.h:383
@ GPU_SHADER_2D_NODELINK
Definition: GPU_shader.h:376
@ GPU_SHADER_2D_UV_FACES_STRETCH_ANGLE
Definition: GPU_shader.h:386
@ GPU_SHADER_2D_UV_FACES_STRETCH_AREA
Definition: GPU_shader.h:385
void GPU_shader_uniform_mat4(GPUShader *sh, const char *name, const float data[4][4])
Definition: gpu_shader.cc:692
int GPU_shader_get_texture_binding(GPUShader *shader, const char *name)
Definition: gpu_shader.cc:585
int GPU_shader_get_builtin_uniform(GPUShader *shader, int builtin)
Definition: gpu_shader.cc:558
void GPU_shader_free(GPUShader *shader)
Definition: gpu_shader.cc:365
void GPU_shader_uniform_float(GPUShader *shader, int location, float value)
Definition: gpu_shader.cc:634
#define GPU_SHADER_CFG_LEN
Definition: GPU_shader.h:395
struct GPUShader * GPU_shader_create_from_arrays_impl(const struct GPU_ShaderCreateFromArray_Params *params, const char *func, int line)
Definition: gpu_shader.cc:461
GPUUniformBlockBuiltin
Definition: GPU_shader.h:115
@ GPU_NUM_UNIFORM_BLOCKS
Definition: GPU_shader.h:120
@ GPU_UNIFORM_BLOCK_MODEL
Definition: GPU_shader.h:117
@ GPU_UNIFORM_BLOCK_VIEW
Definition: GPU_shader.h:116
@ GPU_UNIFORM_BLOCK_INFO
Definition: GPU_shader.h:118
struct GPUVertBuf GPUVertBuf
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition: btQuadWord.h:119
SIMD_FORCE_INLINE btScalar length(const btQuaternion &q)
Return the length of a quaternion.
Definition: btQuaternion.h:895
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
void KERNEL_FUNCTION_FULL_NAME() shader(KernelGlobals *kg, uint4 *input, float4 *output, int type, int filter, int i, int offset, int sample)
const char * lib
Definition: GPU_shader.h:398
const char * def
Definition: GPU_shader.h:399
uint len