Blender  V3.3
GPU_shader.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2005 Blender Foundation. All rights reserved. */
3 
8 #pragma once
9 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
14 struct GPUIndexBuf;
15 struct GPUVertBuf;
16 
20 typedef struct GPUShader GPUShader;
21 
22 typedef enum eGPUShaderTFBType {
23  GPU_SHADER_TFB_NONE = 0, /* Transform feedback unsupported. */
28 
29 GPUShader *GPU_shader_create(const char *vertcode,
30  const char *fragcode,
31  const char *geomcode,
32  const char *libcode,
33  const char *defines,
34  const char *shname);
35 GPUShader *GPU_shader_create_compute(const char *computecode,
36  const char *libcode,
37  const char *defines,
38  const char *shname);
39 GPUShader *GPU_shader_create_from_python(const char *vertcode,
40  const char *fragcode,
41  const char *geomcode,
42  const char *libcode,
43  const char *defines,
44  const char *name);
45 GPUShader *GPU_shader_create_ex(const char *vertcode,
46  const char *fragcode,
47  const char *geomcode,
48  const char *computecode,
49  const char *libcode,
50  const char *defines,
51  eGPUShaderTFBType tf_type,
52  const char **tf_names,
53  int tf_count,
54  const char *shname);
56 GPUShader *GPU_shader_create_from_info_name(const char *info_name);
57 
58 const GPUShaderCreateInfo *GPU_shader_create_info_get(const char *info_name);
59 bool GPU_shader_create_info_check_error(const GPUShaderCreateInfo *_info, char r_error[128]);
60 
62  const char **vert, **geom, **frag, **defs;
63 };
85  const struct GPU_ShaderCreateFromArray_Params *params, const char *func, int line);
86 
87 #define GPU_shader_create_from_arrays(...) \
88  GPU_shader_create_from_arrays_impl( \
89  &(const struct GPU_ShaderCreateFromArray_Params)__VA_ARGS__, __func__, __LINE__)
90 
91 #define GPU_shader_create_from_arrays_named(name, ...) \
92  GPU_shader_create_from_arrays_impl( \
93  &(const struct GPU_ShaderCreateFromArray_Params)__VA_ARGS__, name, 0)
94 
95 void GPU_shader_free(GPUShader *shader);
96 
97 void GPU_shader_bind(GPUShader *shader);
98 void GPU_shader_unbind(void);
99 
100 const char *GPU_shader_get_name(GPUShader *shader);
101 
105 bool GPU_shader_transform_feedback_enable(GPUShader *shader, struct GPUVertBuf *vertbuf);
107 
109 int GPU_shader_get_program(GPUShader *shader);
110 
111 typedef enum {
112  GPU_UNIFORM_MODEL = 0, /* mat4 ModelMatrix */
113  GPU_UNIFORM_VIEW, /* mat4 ViewMatrix */
114  GPU_UNIFORM_MODELVIEW, /* mat4 ModelViewMatrix */
115  GPU_UNIFORM_PROJECTION, /* mat4 ProjectionMatrix */
116  GPU_UNIFORM_VIEWPROJECTION, /* mat4 ViewProjectionMatrix */
117  GPU_UNIFORM_MVP, /* mat4 ModelViewProjectionMatrix */
118 
119  GPU_UNIFORM_MODEL_INV, /* mat4 ModelMatrixInverse */
120  GPU_UNIFORM_VIEW_INV, /* mat4 ViewMatrixInverse */
121  GPU_UNIFORM_MODELVIEW_INV, /* mat4 ModelViewMatrixInverse */
122  GPU_UNIFORM_PROJECTION_INV, /* mat4 ProjectionMatrixInverse */
123  GPU_UNIFORM_VIEWPROJECTION_INV, /* mat4 ViewProjectionMatrixInverse */
124 
125  GPU_UNIFORM_NORMAL, /* mat3 NormalMatrix */
126  GPU_UNIFORM_ORCO, /* vec4 OrcoTexCoFactors[] */
127  GPU_UNIFORM_CLIPPLANES, /* vec4 WorldClipPlanes[] */
128 
129  GPU_UNIFORM_COLOR, /* vec4 color */
130  GPU_UNIFORM_BASE_INSTANCE, /* int baseInstance */
131  GPU_UNIFORM_RESOURCE_CHUNK, /* int resourceChunk */
132  GPU_UNIFORM_RESOURCE_ID, /* int resourceId */
133  GPU_UNIFORM_SRGB_TRANSFORM, /* bool srgbTarget */
134 
135  GPU_NUM_UNIFORMS, /* Special value, denotes number of builtin uniforms. */
137 
138 typedef enum {
140  GPU_UNIFORM_BLOCK_VIEW = 0, /* viewBlock */
141  GPU_UNIFORM_BLOCK_MODEL, /* modelBlock */
142  GPU_UNIFORM_BLOCK_INFO, /* infoBlock */
147 
148  GPU_NUM_UNIFORM_BLOCKS, /* Special value, denotes number of builtin uniforms block. */
150 
152 
153 int GPU_shader_get_uniform(GPUShader *shader, const char *name);
154 int GPU_shader_get_builtin_uniform(GPUShader *shader, int builtin);
155 int GPU_shader_get_builtin_block(GPUShader *shader, int builtin);
157 int GPU_shader_get_uniform_block(GPUShader *shader, const char *name);
158 int GPU_shader_get_ssbo(GPUShader *shader, const char *name);
159 
160 int GPU_shader_get_uniform_block_binding(GPUShader *shader, const char *name);
161 int GPU_shader_get_texture_binding(GPUShader *shader, const char *name);
162 
164  GPUShader *shader, int location, int length, int arraysize, const float *value);
166  GPUShader *shader, int location, int length, int arraysize, const int *value);
167 
168 void GPU_shader_uniform_float(GPUShader *shader, int location, float value);
169 void GPU_shader_uniform_int(GPUShader *shader, int location, int value);
170 
171 void GPU_shader_uniform_1i(GPUShader *sh, const char *name, int value);
172 void GPU_shader_uniform_1b(GPUShader *sh, const char *name, bool value);
173 void GPU_shader_uniform_1f(GPUShader *sh, const char *name, float value);
174 void GPU_shader_uniform_2f(GPUShader *sh, const char *name, float x, float y);
175 void GPU_shader_uniform_3f(GPUShader *sh, const char *name, float x, float y, float z);
176 void GPU_shader_uniform_4f(GPUShader *sh, const char *name, float x, float y, float z, float w);
177 void GPU_shader_uniform_2fv(GPUShader *sh, const char *name, const float data[2]);
178 void GPU_shader_uniform_3fv(GPUShader *sh, const char *name, const float data[3]);
179 void GPU_shader_uniform_4fv(GPUShader *sh, const char *name, const float data[4]);
180 void GPU_shader_uniform_mat4(GPUShader *sh, const char *name, const float data[4][4]);
181 void GPU_shader_uniform_2fv_array(GPUShader *sh, const char *name, int len, const float (*val)[2]);
182 void GPU_shader_uniform_4fv_array(GPUShader *sh, const char *name, int len, const float (*val)[4]);
183 
184 int GPU_shader_get_attribute(GPUShader *shader, const char *name);
185 
186 void GPU_shader_set_framebuffer_srgb_target(int use_srgb_to_linear);
187 
188 /* Builtin/Non-generated shaders */
189 typedef enum eGPUBuiltinShader {
190  /* specialized drawing */
194  /* for simple 2D drawing */
223  /* for simple 3D drawing */
278  /* basic image drawing */
301  /* points */
348  /* lines */
351  /* grease pencil drawing */
353  /* specialized for widget drawing */
361 #define GPU_SHADER_BUILTIN_LEN (GPU_SHADER_2D_NODELINK_INST + 1)
362 
364 typedef enum eGPUShaderConfig {
368 #define GPU_SHADER_CFG_LEN (GPU_SHADER_CFG_CLIPPED + 1)
369 
370 typedef struct GPUShaderConfigData {
371  const char *lib;
372  const char *def;
374 /* gpu_shader.c */
375 
377 
379  eGPUShaderConfig sh_cfg);
381 
383 
384 /* Vertex attributes for shaders */
385 
386 /* Hardware limit is 16. Position attribute is always needed so we reduce to 15.
387  * This makes sure the GPUVertexFormat name buffer does not overflow. */
388 #define GPU_MAX_ATTR 15
389 
390 /* Determined by the maximum uniform buffer size divided by chunk size. */
391 #define GPU_MAX_UNIFORM_ATTR 8
392 
393 typedef enum eGPUKeyframeShapes {
403 #define GPU_KEYFRAME_SHAPE_SQUARE \
404  (GPU_KEYFRAME_SHAPE_CLIPPED_VERTICAL | GPU_KEYFRAME_SHAPE_CLIPPED_HORIZONTAL)
405 
406 #ifdef __cplusplus
407 }
408 #endif
struct GPUIndexBuf GPUIndexBuf
_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:211
void GPU_shader_unbind(void)
Definition: gpu_shader.cc:513
int GPU_shader_get_uniform(GPUShader *shader, const char *name)
Definition: gpu_shader.cc:559
void GPU_shader_uniform_2fv(GPUShader *sh, const char *name, const float data[2])
Definition: gpu_shader.cc:687
void GPU_shader_uniform_vector_int(GPUShader *shader, int location, int length, int arraysize, const int *value)
Definition: gpu_shader.cc:636
void GPU_shader_set_srgb_uniform(GPUShader *shader)
Definition: gpu_shader.cc:744
GPUShader * GPU_shader_create_from_python(const char *vertcode, const char *fragcode, const char *geomcode, const char *libcode, const char *defines, const char *name)
Definition: gpu_shader.cc:399
struct GPUShader GPUShader
Definition: GPU_shader.h:20
void GPU_shader_uniform_1i(GPUShader *sh, const char *name, int value)
Definition: gpu_shader.cc:652
void GPU_shader_uniform_3f(GPUShader *sh, const char *name, float x, float y, float z)
Definition: gpu_shader.cc:669
eGPUShaderConfig
Definition: GPU_shader.h:364
@ GPU_SHADER_CFG_DEFAULT
Definition: GPU_shader.h:365
@ GPU_SHADER_CFG_CLIPPED
Definition: GPU_shader.h:366
void GPU_shader_uniform_2f(GPUShader *sh, const char *name, float x, float y)
Definition: gpu_shader.cc:663
void GPU_shader_uniform_2fv_array(GPUShader *sh, const char *name, int len, const float(*val)[2])
Definition: gpu_shader.cc:711
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:753
void GPU_shader_free_builtin_shaders(void)
void GPU_shader_uniform_1f(GPUShader *sh, const char *name, float value)
Definition: gpu_shader.cc:681
void GPU_shader_uniform_vector(GPUShader *shader, int location, int length, int arraysize, const float *value)
Definition: gpu_shader.cc:630
void GPU_shader_uniform_3fv(GPUShader *sh, const char *name, const float data[3])
Definition: gpu_shader.cc:693
GPUShader * GPU_shader_create_from_info_name(const char *info_name)
Definition: gpu_shader.cc:265
GPUShader * GPU_shader_create_ex(const char *vertcode, const char *fragcode, const char *geomcode, const char *computecode, const char *libcode, const char *defines, eGPUShaderTFBType tf_type, const char **tf_names, int tf_count, const char *shname)
Definition: gpu_shader.cc:107
int GPU_shader_get_attribute(GPUShader *shader, const char *name)
Definition: gpu_shader.cc:606
bool GPU_shader_transform_feedback_enable(GPUShader *shader, struct GPUVertBuf *vertbuf)
Definition: gpu_shader.cc:543
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:717
void GPU_shader_uniform_int(GPUShader *shader, int location, int value)
Definition: gpu_shader.cc:642
int GPU_shader_get_builtin_block(GPUShader *shader, int builtin)
Definition: gpu_shader.cc:572
struct GPUShaderConfigData GPUShaderConfigData
eGPUShaderTFBType
Definition: GPU_shader.h:22
@ GPU_SHADER_TFB_TRIANGLES
Definition: GPU_shader.h:26
@ GPU_SHADER_TFB_NONE
Definition: GPU_shader.h:23
@ GPU_SHADER_TFB_LINES
Definition: GPU_shader.h:25
@ GPU_SHADER_TFB_POINTS
Definition: GPU_shader.h:24
int GPU_shader_get_uniform_block_binding(GPUShader *shader, const char *name)
Definition: gpu_shader.cc:592
void GPU_shader_transform_feedback_disable(GPUShader *shader)
Definition: gpu_shader.cc:548
int GPU_shader_get_program(GPUShader *shader)
Definition: gpu_shader.cc:619
GPUShader * GPU_shader_get_builtin_shader(eGPUBuiltinShader shader)
void GPU_shader_bind(GPUShader *shader)
Definition: gpu_shader.cc:491
void GPU_shader_uniform_1b(GPUShader *sh, const char *name, bool value)
Definition: gpu_shader.cc:658
GPUUniformBuiltin
Definition: GPU_shader.h:111
@ GPU_UNIFORM_VIEWPROJECTION_INV
Definition: GPU_shader.h:123
@ GPU_UNIFORM_PROJECTION
Definition: GPU_shader.h:115
@ GPU_UNIFORM_RESOURCE_ID
Definition: GPU_shader.h:132
@ GPU_UNIFORM_ORCO
Definition: GPU_shader.h:126
@ GPU_UNIFORM_VIEWPROJECTION
Definition: GPU_shader.h:116
@ GPU_UNIFORM_SRGB_TRANSFORM
Definition: GPU_shader.h:133
@ GPU_UNIFORM_VIEW
Definition: GPU_shader.h:113
@ GPU_UNIFORM_MODEL
Definition: GPU_shader.h:112
@ GPU_UNIFORM_MODELVIEW
Definition: GPU_shader.h:114
@ GPU_UNIFORM_BASE_INSTANCE
Definition: GPU_shader.h:130
@ GPU_UNIFORM_VIEW_INV
Definition: GPU_shader.h:120
@ GPU_UNIFORM_MODEL_INV
Definition: GPU_shader.h:119
@ GPU_UNIFORM_PROJECTION_INV
Definition: GPU_shader.h:122
@ GPU_UNIFORM_CLIPPLANES
Definition: GPU_shader.h:127
@ GPU_UNIFORM_COLOR
Definition: GPU_shader.h:129
@ GPU_UNIFORM_MODELVIEW_INV
Definition: GPU_shader.h:121
@ GPU_UNIFORM_NORMAL
Definition: GPU_shader.h:125
@ GPU_UNIFORM_RESOURCE_CHUNK
Definition: GPU_shader.h:131
@ GPU_NUM_UNIFORMS
Definition: GPU_shader.h:135
@ GPU_UNIFORM_MVP
Definition: GPU_shader.h:117
const char * GPU_shader_get_name(GPUShader *shader)
Definition: gpu_shader.cc:530
void GPU_shader_uniform_4fv(GPUShader *sh, const char *name, const float data[4])
Definition: gpu_shader.cc:699
GPUShader * GPU_shader_create_compute(const char *computecode, const char *libcode, const char *defines, const char *shname)
Definition: gpu_shader.cc:230
void GPU_shader_uniform_4f(GPUShader *sh, const char *name, float x, float y, float z, float w)
Definition: gpu_shader.cc:675
int GPU_shader_get_uniform_block(GPUShader *shader, const char *name)
Definition: gpu_shader.cc:585
eGPUBuiltinShader
Definition: GPU_shader.h:189
@ GPU_SHADER_2D_DIAG_STRIPES
Definition: GPU_shader.h:222
@ GPU_SHADER_3D_SMOOTH_COLOR
Definition: GPU_shader.h:245
@ GPU_SHADER_GPENCIL_STROKE
Definition: GPU_shader.h:352
@ GPU_SHADER_2D_NODELINK_INST
Definition: GPU_shader.h:359
@ GPU_SHADER_3D_LINE_DASHED_UNIFORM_COLOR
Definition: GPU_shader.h:350
@ GPU_SHADER_3D_POLYLINE_SMOOTH_COLOR
Definition: GPU_shader.h:270
@ GPU_SHADER_3D_POINT_VARYING_SIZE_VARYING_COLOR
Definition: GPU_shader.h:347
@ GPU_SHADER_2D_LINE_DASHED_UNIFORM_COLOR
Definition: GPU_shader.h:349
@ GPU_SHADER_KEYFRAME_SHAPE
Definition: GPU_shader.h:192
@ GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR
Definition: GPU_shader.h:253
@ GPU_SHADER_2D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_AA
Definition: GPU_shader.h:310
@ GPU_SHADER_2D_IMAGE_DESATURATE_COLOR
Definition: GPU_shader.h:218
@ GPU_SHADER_3D_DEPTH_ONLY
Definition: GPU_shader.h:277
@ GPU_SHADER_TEXT
Definition: GPU_shader.h:191
@ GPU_SHADER_3D_CLIPPED_UNIFORM_COLOR
Definition: GPU_shader.h:231
@ GPU_SHADER_3D_IMAGE_MODULATE_ALPHA
Definition: GPU_shader.h:300
@ GPU_SHADER_2D_CHECKER
Definition: GPU_shader.h:221
@ GPU_SHADER_3D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_AA
Definition: GPU_shader.h:338
@ GPU_SHADER_2D_IMAGE_MULTI_RECT_COLOR
Definition: GPU_shader.h:220
@ GPU_SHADER_2D_SMOOTH_COLOR
Definition: GPU_shader.h:215
@ GPU_SHADER_2D_UNIFORM_COLOR
Definition: GPU_shader.h:201
@ GPU_SHADER_3D_POINT_FIXED_SIZE_VARYING_COLOR
Definition: GPU_shader.h:329
@ GPU_SHADER_3D_UNIFORM_COLOR
Definition: GPU_shader.h:230
@ GPU_SHADER_2D_IMAGE_RECT_COLOR
Definition: GPU_shader.h:219
@ GPU_SHADER_3D_FLAT_COLOR
Definition: GPU_shader.h:238
@ GPU_SHADER_2D_WIDGET_BASE_INST
Definition: GPU_shader.h:356
@ GPU_SHADER_2D_IMAGE_SHUFFLE_COLOR
Definition: GPU_shader.h:281
@ GPU_SHADER_3D_IMAGE
Definition: GPU_shader.h:291
@ GPU_SHADER_2D_IMAGE_OVERLAYS_STEREO_MERGE
Definition: GPU_shader.h:280
@ GPU_SHADER_2D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_OUTLINE_AA
Definition: GPU_shader.h:321
@ GPU_SHADER_2D_IMAGE
Definition: GPU_shader.h:216
@ GPU_SHADER_3D_POLYLINE_FLAT_COLOR
Definition: GPU_shader.h:262
@ GPU_SHADER_SIMPLE_LIGHTING
Definition: GPU_shader.h:193
@ GPU_SHADER_2D_IMAGE_COLOR
Definition: GPU_shader.h:217
@ GPU_SHADER_2D_WIDGET_SHADOW
Definition: GPU_shader.h:357
@ GPU_SHADER_2D_FLAT_COLOR
Definition: GPU_shader.h:208
@ GPU_SHADER_2D_WIDGET_BASE
Definition: GPU_shader.h:355
@ GPU_SHADER_2D_AREA_BORDERS
Definition: GPU_shader.h:354
@ GPU_SHADER_3D_POLYLINE_CLIPPED_UNIFORM_COLOR
Definition: GPU_shader.h:254
@ GPU_SHADER_2D_IMAGE_OVERLAYS_MERGE
Definition: GPU_shader.h:279
@ GPU_SHADER_2D_NODELINK
Definition: GPU_shader.h:358
struct GPUShaderCreateInfo GPUShaderCreateInfo
Definition: GPU_shader.h:18
void GPU_shader_uniform_mat4(GPUShader *sh, const char *name, const float data[4][4])
Definition: gpu_shader.cc:705
int GPU_shader_get_texture_binding(GPUShader *shader, const char *name)
Definition: gpu_shader.cc:599
int GPU_shader_get_builtin_uniform(GPUShader *shader, int builtin)
Definition: gpu_shader.cc:566
void GPU_shader_free(GPUShader *shader)
Definition: gpu_shader.cc:200
void GPU_shader_uniform_float(GPUShader *shader, int location, float value)
Definition: gpu_shader.cc:647
bool GPU_shader_create_info_check_error(const GPUShaderCreateInfo *_info, char r_error[128])
Definition: gpu_shader.cc:252
#define GPU_SHADER_CFG_LEN
Definition: GPU_shader.h:368
int GPU_shader_get_ssbo(GPUShader *shader, const char *name)
Definition: gpu_shader.cc:578
const GPUShaderCreateInfo * GPU_shader_create_info_get(const char *info_name)
Definition: gpu_shader.cc:247
struct GPUShader * GPU_shader_create_from_arrays_impl(const struct GPU_ShaderCreateFromArray_Params *params, const char *func, int line)
Definition: gpu_shader.cc:458
eGPUKeyframeShapes
Definition: GPU_shader.h:393
@ GPU_KEYFRAME_SHAPE_INNER_DOT
Definition: GPU_shader.h:398
@ GPU_KEYFRAME_SHAPE_CIRCLE
Definition: GPU_shader.h:395
@ GPU_KEYFRAME_SHAPE_CLIPPED_HORIZONTAL
Definition: GPU_shader.h:397
@ GPU_KEYFRAME_SHAPE_ARROW_END_MIXED
Definition: GPU_shader.h:401
@ GPU_KEYFRAME_SHAPE_DIAMOND
Definition: GPU_shader.h:394
@ GPU_KEYFRAME_SHAPE_ARROW_END_MAX
Definition: GPU_shader.h:399
@ GPU_KEYFRAME_SHAPE_ARROW_END_MIN
Definition: GPU_shader.h:400
@ GPU_KEYFRAME_SHAPE_CLIPPED_VERTICAL
Definition: GPU_shader.h:396
GPUUniformBlockBuiltin
Definition: GPU_shader.h:138
@ GPU_UNIFORM_BLOCK_DRW_VIEW
Definition: GPU_shader.h:144
@ GPU_UNIFORM_BLOCK_DRW_MODEL
Definition: GPU_shader.h:145
@ GPU_NUM_UNIFORM_BLOCKS
Definition: GPU_shader.h:148
@ GPU_UNIFORM_BLOCK_MODEL
Definition: GPU_shader.h:141
@ GPU_UNIFORM_BLOCK_VIEW
Definition: GPU_shader.h:140
@ GPU_UNIFORM_BLOCK_DRW_INFOS
Definition: GPU_shader.h:146
@ GPU_UNIFORM_BLOCK_INFO
Definition: GPU_shader.h:142
GPUShader * GPU_shader_create_from_info(const GPUShaderCreateInfo *_info)
Definition: gpu_shader.cc:277
struct GPUVertBuf GPUVertBuf
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition: btQuadWord.h:119
int len
Definition: draw_manager.c:108
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
ccl_gpu_kernel_postfix ccl_global float int int int int sh
T length(const vec_base< T, Size > &a)
const char * lib
Definition: GPU_shader.h:371
const char * def
Definition: GPU_shader.h:372