Blender  V2.93
Classes | Macros | Typedefs | Enumerations | Functions | Variables
GPU_shader.h File Reference

Go to the source code of this file.

Classes

struct  GPU_ShaderCreateFromArray_Params
 
struct  GPUShaderConfigData
 

Macros

#define GPU_shader_create_from_arrays(...)
 
#define GPU_shader_create_from_arrays_named(name, ...)
 
#define GPU_SHADER_BUILTIN_LEN   (GPU_SHADER_2D_UV_FACES_STRETCH_ANGLE + 1)
 
#define GPU_SHADER_CFG_LEN   (GPU_SHADER_CFG_CLIPPED + 1)
 
#define GPU_MAX_ATTR   15
 
#define GPU_MAX_UNIFORM_ATTR   8
 

Typedefs

typedef struct GPUShader GPUShader
 
typedef enum eGPUShaderTFBType eGPUShaderTFBType
 
typedef enum eGPUBuiltinShader eGPUBuiltinShader
 
typedef enum eGPUShaderConfig eGPUShaderConfig
 
typedef struct GPUShaderConfigData GPUShaderConfigData
 

Enumerations

enum  eGPUShaderTFBType { GPU_SHADER_TFB_NONE = 0 , GPU_SHADER_TFB_POINTS = 1 , GPU_SHADER_TFB_LINES = 2 , GPU_SHADER_TFB_TRIANGLES = 3 }
 
enum  GPUUniformBuiltin {
  GPU_UNIFORM_MODEL = 0 , GPU_UNIFORM_VIEW , GPU_UNIFORM_MODELVIEW , GPU_UNIFORM_PROJECTION ,
  GPU_UNIFORM_VIEWPROJECTION , GPU_UNIFORM_MVP , GPU_UNIFORM_MODEL_INV , GPU_UNIFORM_VIEW_INV ,
  GPU_UNIFORM_MODELVIEW_INV , GPU_UNIFORM_PROJECTION_INV , GPU_UNIFORM_VIEWPROJECTION_INV , GPU_UNIFORM_NORMAL ,
  GPU_UNIFORM_ORCO , GPU_UNIFORM_CLIPPLANES , GPU_UNIFORM_COLOR , GPU_UNIFORM_BASE_INSTANCE ,
  GPU_UNIFORM_RESOURCE_CHUNK , GPU_UNIFORM_RESOURCE_ID , GPU_UNIFORM_SRGB_TRANSFORM , GPU_NUM_UNIFORMS
}
 
enum  GPUUniformBlockBuiltin { GPU_UNIFORM_BLOCK_VIEW = 0 , GPU_UNIFORM_BLOCK_MODEL , GPU_UNIFORM_BLOCK_INFO , GPU_NUM_UNIFORM_BLOCKS }
 
enum  eGPUBuiltinShader {
  GPU_SHADER_TEXT , GPU_SHADER_KEYFRAME_DIAMOND , GPU_SHADER_SIMPLE_LIGHTING , GPU_SHADER_2D_UNIFORM_COLOR ,
  GPU_SHADER_2D_FLAT_COLOR , GPU_SHADER_2D_SMOOTH_COLOR , GPU_SHADER_2D_IMAGE , GPU_SHADER_2D_IMAGE_COLOR ,
  GPU_SHADER_2D_IMAGE_DESATURATE_COLOR , GPU_SHADER_2D_IMAGE_RECT_COLOR , GPU_SHADER_2D_IMAGE_MULTI_RECT_COLOR , GPU_SHADER_2D_CHECKER ,
  GPU_SHADER_2D_DIAG_STRIPES , GPU_SHADER_3D_UNIFORM_COLOR , GPU_SHADER_3D_CLIPPED_UNIFORM_COLOR , GPU_SHADER_3D_FLAT_COLOR ,
  GPU_SHADER_3D_SMOOTH_COLOR , GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR , GPU_SHADER_3D_POLYLINE_CLIPPED_UNIFORM_COLOR , GPU_SHADER_3D_POLYLINE_FLAT_COLOR ,
  GPU_SHADER_3D_POLYLINE_SMOOTH_COLOR , GPU_SHADER_3D_DEPTH_ONLY , GPU_SHADER_2D_IMAGE_OVERLAYS_MERGE , GPU_SHADER_2D_IMAGE_OVERLAYS_STEREO_MERGE ,
  GPU_SHADER_2D_IMAGE_SHUFFLE_COLOR , GPU_SHADER_3D_IMAGE_MODULATE_ALPHA , GPU_SHADER_2D_POINT_FIXED_SIZE_UNIFORM_COLOR , GPU_SHADER_2D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_AA ,
  GPU_SHADER_2D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_OUTLINE_AA , GPU_SHADER_2D_POINT_UNIFORM_SIZE_VARYING_COLOR_OUTLINE_AA , GPU_SHADER_2D_POINT_VARYING_SIZE_VARYING_COLOR , GPU_SHADER_3D_POINT_FIXED_SIZE_UNIFORM_COLOR ,
  GPU_SHADER_3D_POINT_FIXED_SIZE_VARYING_COLOR , GPU_SHADER_3D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_AA , GPU_SHADER_3D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_OUTLINE_AA , GPU_SHADER_3D_POINT_VARYING_SIZE_UNIFORM_COLOR ,
  GPU_SHADER_3D_POINT_VARYING_SIZE_VARYING_COLOR , GPU_SHADER_2D_LINE_DASHED_UNIFORM_COLOR , GPU_SHADER_3D_LINE_DASHED_UNIFORM_COLOR , GPU_SHADER_INSTANCE_VARIYING_COLOR_VARIYING_SIZE ,
  GPU_SHADER_GPENCIL_STROKE , GPU_SHADER_2D_AREA_EDGES , GPU_SHADER_2D_WIDGET_BASE , GPU_SHADER_2D_WIDGET_BASE_INST ,
  GPU_SHADER_2D_WIDGET_SHADOW , GPU_SHADER_2D_NODELINK , GPU_SHADER_2D_NODELINK_INST , GPU_SHADER_2D_UV_UNIFORM_COLOR ,
  GPU_SHADER_2D_UV_VERTS , GPU_SHADER_2D_UV_FACEDOTS , GPU_SHADER_2D_UV_EDGES , GPU_SHADER_2D_UV_EDGES_SMOOTH ,
  GPU_SHADER_2D_UV_FACES , GPU_SHADER_2D_UV_FACES_STRETCH_AREA , GPU_SHADER_2D_UV_FACES_STRETCH_ANGLE
}
 
enum  eGPUShaderConfig { GPU_SHADER_CFG_DEFAULT = 0 , GPU_SHADER_CFG_CLIPPED = 1 }
 

Functions

GPUShaderGPU_shader_create (const char *vertcode, const char *fragcode, const char *geomcode, const char *libcode, const char *defines, const char *shname)
 
GPUShaderGPU_shader_create_from_python (const char *vertcode, const char *fragcode, const char *geomcode, const char *libcode, const char *defines)
 
GPUShaderGPU_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)
 
struct GPUShaderGPU_shader_create_from_arrays_impl (const struct GPU_ShaderCreateFromArray_Params *params, const char *func, int line)
 
void GPU_shader_free (GPUShader *shader)
 
void GPU_shader_bind (GPUShader *shader)
 
void GPU_shader_unbind (void)
 
bool GPU_shader_transform_feedback_enable (GPUShader *shader, struct GPUVertBuf *vertbuf)
 
void GPU_shader_transform_feedback_disable (GPUShader *shader)
 
int GPU_shader_get_program (GPUShader *shader)
 
void GPU_shader_set_srgb_uniform (GPUShader *shader)
 
int GPU_shader_get_uniform (GPUShader *shader, const char *name)
 
int GPU_shader_get_builtin_uniform (GPUShader *shader, int builtin)
 
int GPU_shader_get_builtin_block (GPUShader *shader, int builtin)
 
int GPU_shader_get_uniform_block (GPUShader *shader, const char *name)
 
int GPU_shader_get_uniform_block_binding (GPUShader *shader, const char *name)
 
int GPU_shader_get_texture_binding (GPUShader *shader, const char *name)
 
void GPU_shader_uniform_vector (GPUShader *shader, int location, int length, int arraysize, const float *value)
 
void GPU_shader_uniform_vector_int (GPUShader *shader, int location, int length, int arraysize, const int *value)
 
void GPU_shader_uniform_float (GPUShader *shader, int location, float value)
 
void GPU_shader_uniform_int (GPUShader *shader, int location, int value)
 
void GPU_shader_uniform_1i (GPUShader *sh, const char *name, int value)
 
void GPU_shader_uniform_1b (GPUShader *sh, const char *name, bool value)
 
void GPU_shader_uniform_1f (GPUShader *sh, const char *name, float value)
 
void GPU_shader_uniform_2f (GPUShader *sh, const char *name, float x, float y)
 
void GPU_shader_uniform_3f (GPUShader *sh, const char *name, float x, float y, float z)
 
void GPU_shader_uniform_4f (GPUShader *sh, const char *name, float x, float y, float z, float w)
 
void GPU_shader_uniform_2fv (GPUShader *sh, const char *name, const float data[2])
 
void GPU_shader_uniform_3fv (GPUShader *sh, const char *name, const float data[3])
 
void GPU_shader_uniform_4fv (GPUShader *sh, const char *name, const float data[4])
 
void GPU_shader_uniform_mat4 (GPUShader *sh, const char *name, const float data[4][4])
 
void GPU_shader_uniform_2fv_array (GPUShader *sh, const char *name, int len, const float(*val)[2])
 
void GPU_shader_uniform_4fv_array (GPUShader *sh, const char *name, int len, const float(*val)[4])
 
int GPU_shader_get_attribute (GPUShader *shader, const char *name)
 
void GPU_shader_set_framebuffer_srgb_target (int use_srgb_to_linear)
 
GPUShaderGPU_shader_get_builtin_shader_with_config (eGPUBuiltinShader shader, eGPUShaderConfig sh_cfg)
 
GPUShaderGPU_shader_get_builtin_shader (eGPUBuiltinShader shader)
 
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_free_builtin_shaders (void)
 

Variables

const GPUShaderConfigData GPU_shader_cfg_data [GPU_SHADER_CFG_LEN]
 

Macro Definition Documentation

◆ GPU_MAX_ATTR

#define GPU_MAX_ATTR   15

Definition at line 420 of file GPU_shader.h.

◆ GPU_MAX_UNIFORM_ATTR

#define GPU_MAX_UNIFORM_ATTR   8

Definition at line 423 of file GPU_shader.h.

◆ GPU_SHADER_BUILTIN_LEN

#define GPU_SHADER_BUILTIN_LEN   (GPU_SHADER_2D_UV_FACES_STRETCH_ANGLE + 1)

Definition at line 388 of file GPU_shader.h.

◆ GPU_SHADER_CFG_LEN

#define GPU_SHADER_CFG_LEN   (GPU_SHADER_CFG_CLIPPED + 1)

Definition at line 395 of file GPU_shader.h.

◆ GPU_shader_create_from_arrays

#define GPU_shader_create_from_arrays (   ...)
Value:
&(const struct GPU_ShaderCreateFromArray_Params)__VA_ARGS__, __func__, __LINE__)
struct GPUShader * GPU_shader_create_from_arrays_impl(const struct GPU_ShaderCreateFromArray_Params *params, const char *func, int line)
Definition: gpu_shader.cc:461

Definition at line 69 of file GPU_shader.h.

◆ GPU_shader_create_from_arrays_named

#define GPU_shader_create_from_arrays_named (   name,
  ... 
)
Value:

Definition at line 73 of file GPU_shader.h.

Typedef Documentation

◆ eGPUBuiltinShader

◆ eGPUShaderConfig

Support multiple configurations.

◆ eGPUShaderTFBType

◆ GPUShader

typedef struct GPUShader GPUShader

Opaque type hiding blender::gpu::Shader

Definition at line 1 of file GPU_shader.h.

◆ GPUShaderConfigData

Enumeration Type Documentation

◆ eGPUBuiltinShader

Enumerator
GPU_SHADER_TEXT 
GPU_SHADER_KEYFRAME_DIAMOND 
GPU_SHADER_SIMPLE_LIGHTING 
GPU_SHADER_2D_UNIFORM_COLOR 

Take a single color for all the vertices and a 2D position for each vertex.

Parameters
coloruniform vec4
posin vec2
GPU_SHADER_2D_FLAT_COLOR 

Take a 2D position and color for each vertex without color interpolation.

Parameters
colorin vec4
posin vec2
GPU_SHADER_2D_SMOOTH_COLOR 

Take a 2D position and color for each vertex with linear interpolation in window space.

Parameters
colorin vec4
posin vec2
GPU_SHADER_2D_IMAGE 
GPU_SHADER_2D_IMAGE_COLOR 
GPU_SHADER_2D_IMAGE_DESATURATE_COLOR 
GPU_SHADER_2D_IMAGE_RECT_COLOR 
GPU_SHADER_2D_IMAGE_MULTI_RECT_COLOR 
GPU_SHADER_2D_CHECKER 
GPU_SHADER_2D_DIAG_STRIPES 
GPU_SHADER_3D_UNIFORM_COLOR 

Take a single color for all the vertices and a 3D position for each vertex.

Parameters
coloruniform vec4
posin vec3
GPU_SHADER_3D_CLIPPED_UNIFORM_COLOR 
GPU_SHADER_3D_FLAT_COLOR 

Take a 3D position and color for each vertex without color interpolation.

Parameters
colorin vec4
posin vec3
GPU_SHADER_3D_SMOOTH_COLOR 

Take a 3D position and color for each vertex with perspective correct interpolation.

Parameters
colorin vec4
posin vec3
GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR 

Take a single color for all the vertices and a 3D position for each vertex. Used for drawing wide lines.

Parameters
coloruniform vec4
posin vec3
GPU_SHADER_3D_POLYLINE_CLIPPED_UNIFORM_COLOR 
GPU_SHADER_3D_POLYLINE_FLAT_COLOR 

Take a 3D position and color for each vertex without color interpolation. Used for drawing wide lines.

Parameters
colorin vec4
posin vec3
GPU_SHADER_3D_POLYLINE_SMOOTH_COLOR 

Take a 3D position and color for each vertex with perspective correct interpolation. Used for drawing wide lines.

Parameters
colorin vec4
posin vec3
GPU_SHADER_3D_DEPTH_ONLY 

Take a 3D position for each vertex and output only depth. Used for drawing wide lines.

Parameters
posin vec3
GPU_SHADER_2D_IMAGE_OVERLAYS_MERGE 
GPU_SHADER_2D_IMAGE_OVERLAYS_STEREO_MERGE 
GPU_SHADER_2D_IMAGE_SHUFFLE_COLOR 
GPU_SHADER_3D_IMAGE_MODULATE_ALPHA 

Draw texture with alpha. Take a 3D position and a 2D texture coordinate for each vertex.

Parameters
alphauniform float
imageuniform sampler2D
texCoordin vec2
posin vec3
GPU_SHADER_2D_POINT_FIXED_SIZE_UNIFORM_COLOR 

Draw round points with a hardcoded size. Take a single color for all the vertices and a 2D position for each vertex.

Parameters
coloruniform vec4
posin vec2
GPU_SHADER_2D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_AA 

Draw round points with a constant size. Take a single color for all the vertices and a 2D position for each vertex.

Parameters
sizeuniform float
coloruniform vec4
posin vec2
GPU_SHADER_2D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_OUTLINE_AA 

Draw round points with a constant size and an outline. Take a single color for all the vertices and a 2D position for each vertex.

Parameters
sizeuniform float
outlineWidthuniform float
coloruniform vec4
outlineColoruniform vec4
posin vec2
GPU_SHADER_2D_POINT_UNIFORM_SIZE_VARYING_COLOR_OUTLINE_AA 

Draw round points with a constant size and an outline. Take a 2D position and a color for each vertex.

Parameters
sizeuniform float
outlineWidthuniform float
outlineColoruniform vec4
colorin vec4
posin vec2
GPU_SHADER_2D_POINT_VARYING_SIZE_VARYING_COLOR 

Draw round points with a constant size and an outline. Take a 2D position and a color for each vertex.

Parameters
sizein float
colorin vec4
posin vec2
GPU_SHADER_3D_POINT_FIXED_SIZE_UNIFORM_COLOR 

Draw round points with a hardcoded size. Take a single color for all the vertices and a 3D position for each vertex.

Parameters
coloruniform vec4
posin vec3
GPU_SHADER_3D_POINT_FIXED_SIZE_VARYING_COLOR 

Draw round points with a hardcoded size. Take a single color for all the vertices and a 3D position for each vertex.

Parameters
coloruniform vec4
posin vec3
GPU_SHADER_3D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_AA 

Draw round points with a constant size. Take a single color for all the vertices and a 3D position for each vertex.

Parameters
sizeuniform float
coloruniform vec4
posin vec3
GPU_SHADER_3D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_OUTLINE_AA 

Draw round points with a constant size and an outline. Take a single color for all the vertices and a 3D position for each vertex.

Parameters
sizeuniform float
outlineWidthuniform float
coloruniform vec4
outlineColoruniform vec4
posin vec3
GPU_SHADER_3D_POINT_VARYING_SIZE_UNIFORM_COLOR 

Draw round points with a constant size and an outline. Take a single color for all the vertices and a 3D position for each vertex.

Parameters
coloruniform vec4
sizein float
posin vec3
GPU_SHADER_3D_POINT_VARYING_SIZE_VARYING_COLOR 

Draw round points with a constant size and an outline. Take a 3D position and a color for each vertex.

Parameters
sizein float
colorin vec4
posin vec3
GPU_SHADER_2D_LINE_DASHED_UNIFORM_COLOR 
GPU_SHADER_3D_LINE_DASHED_UNIFORM_COLOR 
GPU_SHADER_INSTANCE_VARIYING_COLOR_VARIYING_SIZE 
GPU_SHADER_GPENCIL_STROKE 
GPU_SHADER_2D_AREA_EDGES 
GPU_SHADER_2D_WIDGET_BASE 
GPU_SHADER_2D_WIDGET_BASE_INST 
GPU_SHADER_2D_WIDGET_SHADOW 
GPU_SHADER_2D_NODELINK 
GPU_SHADER_2D_NODELINK_INST 
GPU_SHADER_2D_UV_UNIFORM_COLOR 
GPU_SHADER_2D_UV_VERTS 
GPU_SHADER_2D_UV_FACEDOTS 
GPU_SHADER_2D_UV_EDGES 
GPU_SHADER_2D_UV_EDGES_SMOOTH 
GPU_SHADER_2D_UV_FACES 
GPU_SHADER_2D_UV_FACES_STRETCH_AREA 
GPU_SHADER_2D_UV_FACES_STRETCH_ANGLE 

Definition at line 159 of file GPU_shader.h.

◆ eGPUShaderConfig

Support multiple configurations.

Enumerator
GPU_SHADER_CFG_DEFAULT 
GPU_SHADER_CFG_CLIPPED 

Definition at line 391 of file GPU_shader.h.

◆ eGPUShaderTFBType

Enumerator
GPU_SHADER_TFB_NONE 
GPU_SHADER_TFB_POINTS 
GPU_SHADER_TFB_LINES 
GPU_SHADER_TFB_TRIANGLES 

Definition at line 35 of file GPU_shader.h.

◆ GPUUniformBlockBuiltin

Enumerator
GPU_UNIFORM_BLOCK_VIEW 
GPU_UNIFORM_BLOCK_MODEL 
GPU_UNIFORM_BLOCK_INFO 
GPU_NUM_UNIFORM_BLOCKS 

Definition at line 115 of file GPU_shader.h.

◆ GPUUniformBuiltin

Enumerator
GPU_UNIFORM_MODEL 
GPU_UNIFORM_VIEW 
GPU_UNIFORM_MODELVIEW 
GPU_UNIFORM_PROJECTION 
GPU_UNIFORM_VIEWPROJECTION 
GPU_UNIFORM_MVP 
GPU_UNIFORM_MODEL_INV 
GPU_UNIFORM_VIEW_INV 
GPU_UNIFORM_MODELVIEW_INV 
GPU_UNIFORM_PROJECTION_INV 
GPU_UNIFORM_VIEWPROJECTION_INV 
GPU_UNIFORM_NORMAL 
GPU_UNIFORM_ORCO 
GPU_UNIFORM_CLIPPLANES 
GPU_UNIFORM_COLOR 
GPU_UNIFORM_BASE_INSTANCE 
GPU_UNIFORM_RESOURCE_CHUNK 
GPU_UNIFORM_RESOURCE_ID 
GPU_UNIFORM_SRGB_TRANSFORM 
GPU_NUM_UNIFORMS 

Definition at line 88 of file GPU_shader.h.

Function Documentation

◆ GPU_shader_bind()

void GPU_shader_bind ( GPUShader shader)

◆ GPU_shader_create()

GPUShader* GPU_shader_create ( const char *  vertcode,
const char *  fragcode,
const char *  geomcode,
const char *  libcode,
const char *  defines,
const char *  shname 
)

◆ GPU_shader_create_ex()

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 
)

◆ GPU_shader_create_from_arrays_impl()

struct GPUShader* GPU_shader_create_from_arrays_impl ( const struct GPU_ShaderCreateFromArray_Params params,
const char *  func,
int  line 
)

Use via GPU_shader_create_from_arrays macro (avoids passing in param).

Similar to DRW_shader_create_with_lib with the ability to include libs for each type of shader.

It has the advantage that each item can be conditionally included without having to build the string inline, then free it.

Parameters
paramsNULL terminated arrays of strings.

Example:

.vert = (const char *[]){shader_lib_glsl, shader_vert_glsl, NULL},
.geom = (const char *[]){shader_geom_glsl, NULL},
.frag = (const char *[]){shader_frag_glsl, NULL},
.defs = (const char *[]){"#define DEFINE\n", test ? "#define OTHER_DEFINE\n" : "", NULL},
});
#define GPU_shader_create_from_arrays(...)
Definition: GPU_shader.h:69

Definition at line 461 of file gpu_shader.cc.

References ARRAY_SIZE, BLI_snprintf(), GPU_shader_create(), MEM_freeN, params, str, and string_join_array_maybe_alloc().

◆ GPU_shader_create_from_python()

GPUShader* GPU_shader_create_from_python ( const char *  vertcode,
const char *  fragcode,
const char *  geomcode,
const char *  libcode,
const char *  defines 
)

◆ GPU_shader_free()

void GPU_shader_free ( GPUShader shader)

◆ GPU_shader_free_builtin_shaders()

void GPU_shader_free_builtin_shaders ( void  )

◆ GPU_shader_get_attribute()

int GPU_shader_get_attribute ( GPUShader shader,
const char *  name 
)

Definition at line 592 of file gpu_shader.cc.

References blender::gpu::ShaderInput::location.

Referenced by pygpu_shader_attr_from_name().

◆ GPU_shader_get_builtin_block()

int GPU_shader_get_builtin_block ( GPUShader shader,
int  builtin 
)

Definition at line 564 of file gpu_shader.cc.

References blender::gpu::ShaderInterface::ubo_builtin().

Referenced by drw_shgroup_init().

◆ GPU_shader_get_builtin_shader()

GPUShader* GPU_shader_get_builtin_shader ( eGPUBuiltinShader  shader)

◆ GPU_shader_get_builtin_shader_code()

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 
)

◆ GPU_shader_get_builtin_shader_with_config()

GPUShader* GPU_shader_get_builtin_shader_with_config ( eGPUBuiltinShader  shader,
eGPUShaderConfig  sh_cfg 
)

◆ GPU_shader_get_builtin_uniform()

int GPU_shader_get_builtin_uniform ( GPUShader shader,
int  builtin 
)

◆ GPU_shader_get_program()

int GPU_shader_get_program ( GPUShader shader)

Definition at line 606 of file gpu_shader.cc.

References shader(), and blender::gpu::unwrap().

Referenced by pygpu_shader_program_get().

◆ GPU_shader_get_texture_binding()

int GPU_shader_get_texture_binding ( GPUShader shader,
const char *  name 
)

◆ GPU_shader_get_uniform()

int GPU_shader_get_uniform ( GPUShader shader,
const char *  name 
)

◆ GPU_shader_get_uniform_block()

int GPU_shader_get_uniform_block ( GPUShader shader,
const char *  name 
)

◆ GPU_shader_get_uniform_block_binding()

int GPU_shader_get_uniform_block_binding ( GPUShader shader,
const char *  name 
)

◆ GPU_shader_set_framebuffer_srgb_target()

void GPU_shader_set_framebuffer_srgb_target ( int  use_srgb_to_linear)

◆ GPU_shader_set_srgb_uniform()

void GPU_shader_set_srgb_uniform ( GPUShader shader)

◆ GPU_shader_transform_feedback_disable()

void GPU_shader_transform_feedback_disable ( GPUShader shader)

Definition at line 540 of file gpu_shader.cc.

References shader(), and blender::gpu::unwrap().

Referenced by draw_shgroup().

◆ GPU_shader_transform_feedback_enable()

bool GPU_shader_transform_feedback_enable ( GPUShader shader,
struct GPUVertBuf vertbuf 
)

Definition at line 535 of file gpu_shader.cc.

References shader(), and blender::gpu::unwrap().

Referenced by draw_update_uniforms().

◆ GPU_shader_unbind()

void GPU_shader_unbind ( void  )

◆ GPU_shader_uniform_1b()

void GPU_shader_uniform_1b ( GPUShader sh,
const char *  name,
bool  value 
)

Definition at line 645 of file gpu_shader.cc.

References GPU_shader_uniform_1i().

◆ GPU_shader_uniform_1f()

void GPU_shader_uniform_1f ( GPUShader sh,
const char *  name,
float  value 
)

Definition at line 668 of file gpu_shader.cc.

References GPU_shader_get_uniform(), and GPU_shader_uniform_float().

Referenced by createGPUShader(), and immUniform1f().

◆ GPU_shader_uniform_1i()

void GPU_shader_uniform_1i ( GPUShader sh,
const char *  name,
int  value 
)

◆ GPU_shader_uniform_2f()

void GPU_shader_uniform_2f ( GPUShader sh,
const char *  name,
float  x,
float  y 
)

Definition at line 650 of file gpu_shader.cc.

References data, GPU_shader_uniform_2fv(), x, and y.

Referenced by immUniform2f().

◆ GPU_shader_uniform_2fv()

void GPU_shader_uniform_2fv ( GPUShader sh,
const char *  name,
const float  data[2] 
)

Definition at line 674 of file gpu_shader.cc.

References data, GPU_shader_get_uniform(), and GPU_shader_uniform_vector().

Referenced by GPU_shader_uniform_2f(), and immUniform2fv().

◆ GPU_shader_uniform_2fv_array()

void GPU_shader_uniform_2fv_array ( GPUShader sh,
const char *  name,
int  len,
const float(*)  val[2] 
)

Definition at line 698 of file gpu_shader.cc.

References GPU_shader_get_uniform(), GPU_shader_uniform_vector(), and len.

◆ GPU_shader_uniform_3f()

void GPU_shader_uniform_3f ( GPUShader sh,
const char *  name,
float  x,
float  y,
float  z 
)

Definition at line 656 of file gpu_shader.cc.

References data, GPU_shader_uniform_3fv(), x, y, and z.

Referenced by createGPUShader(), and immUniform3f().

◆ GPU_shader_uniform_3fv()

void GPU_shader_uniform_3fv ( GPUShader sh,
const char *  name,
const float  data[3] 
)

Definition at line 680 of file gpu_shader.cc.

References data, GPU_shader_get_uniform(), and GPU_shader_uniform_vector().

Referenced by GPU_shader_uniform_3f(), and immUniform3fv().

◆ GPU_shader_uniform_4f()

void GPU_shader_uniform_4f ( GPUShader sh,
const char *  name,
float  x,
float  y,
float  z,
float  w 
)

Definition at line 662 of file gpu_shader.cc.

References data, GPU_shader_uniform_4fv(), w(), x, y, and z.

Referenced by button2d_draw_intern(), and immUniform4f().

◆ GPU_shader_uniform_4fv()

void GPU_shader_uniform_4fv ( GPUShader sh,
const char *  name,
const float  data[4] 
)

Definition at line 686 of file gpu_shader.cc.

References data, GPU_shader_get_uniform(), and GPU_shader_uniform_vector().

Referenced by GPU_shader_uniform_4f(), and immUniform4fv().

◆ GPU_shader_uniform_4fv_array()

void GPU_shader_uniform_4fv_array ( GPUShader sh,
const char *  name,
int  len,
const float(*)  val[4] 
)

Definition at line 704 of file gpu_shader.cc.

References GPU_shader_get_uniform(), GPU_shader_uniform_vector(), and len.

Referenced by immUniformArray4fv().

◆ GPU_shader_uniform_float()

void GPU_shader_uniform_float ( GPUShader shader,
int  location,
float  value 
)

Definition at line 634 of file gpu_shader.cc.

References GPU_shader_uniform_vector(), and shader().

Referenced by GPU_shader_uniform_1f().

◆ GPU_shader_uniform_int()

void GPU_shader_uniform_int ( GPUShader shader,
int  location,
int  value 
)

◆ GPU_shader_uniform_mat4()

void GPU_shader_uniform_mat4 ( GPUShader sh,
const char *  name,
const float  data[4][4] 
)

Definition at line 692 of file gpu_shader.cc.

References data, GPU_shader_get_uniform(), and GPU_shader_uniform_vector().

Referenced by immUniformMatrix4fv().

◆ GPU_shader_uniform_vector()

void GPU_shader_uniform_vector ( GPUShader shader,
int  location,
int  length,
int  arraysize,
const float value 
)

◆ GPU_shader_uniform_vector_int()

void GPU_shader_uniform_vector_int ( GPUShader shader,
int  location,
int  length,
int  arraysize,
const int *  value 
)

Variable Documentation

◆ GPU_shader_cfg_data

const GPUShaderConfigData GPU_shader_cfg_data[GPU_SHADER_CFG_LEN]
extern

Definition at line 134 of file gpu_shader_builtin.c.

Referenced by basic_engine_init(), external_engine_init(), OVERLAY_shader_armature_degrees_of_freedom_solid(), OVERLAY_shader_armature_degrees_of_freedom_wire(), OVERLAY_shader_armature_envelope(), OVERLAY_shader_armature_shape(), OVERLAY_shader_armature_shape_wire(), OVERLAY_shader_armature_sphere(), OVERLAY_shader_armature_stick(), OVERLAY_shader_armature_wire(), OVERLAY_shader_clipbound(), OVERLAY_shader_depth_only(), OVERLAY_shader_edit_curve_handle(), OVERLAY_shader_edit_curve_point(), OVERLAY_shader_edit_curve_wire(), OVERLAY_shader_edit_gpencil_point(), OVERLAY_shader_edit_gpencil_wire(), OVERLAY_shader_edit_lattice_point(), OVERLAY_shader_edit_lattice_wire(), OVERLAY_shader_edit_mesh_analysis(), OVERLAY_shader_edit_mesh_edge(), OVERLAY_shader_edit_mesh_face(), OVERLAY_shader_edit_mesh_facedot(), OVERLAY_shader_edit_mesh_normal(), OVERLAY_shader_edit_mesh_skin_root(), OVERLAY_shader_edit_mesh_vert(), OVERLAY_shader_edit_particle_point(), OVERLAY_shader_edit_particle_strand(), OVERLAY_shader_extra(), OVERLAY_shader_extra_grid(), OVERLAY_shader_extra_groundline(), OVERLAY_shader_extra_loose_point(), OVERLAY_shader_extra_point(), OVERLAY_shader_extra_wire(), OVERLAY_shader_facing(), OVERLAY_shader_image(), OVERLAY_shader_motion_path_line(), OVERLAY_shader_motion_path_vert(), OVERLAY_shader_outline_prepass(), OVERLAY_shader_outline_prepass_gpencil(), OVERLAY_shader_outline_prepass_pointcloud(), OVERLAY_shader_paint_face(), OVERLAY_shader_paint_point(), OVERLAY_shader_paint_texture(), OVERLAY_shader_paint_vertcol(), OVERLAY_shader_paint_weight(), OVERLAY_shader_paint_wire(), OVERLAY_shader_particle_dot(), OVERLAY_shader_particle_shape(), OVERLAY_shader_sculpt_mask(), OVERLAY_shader_uniform_color(), OVERLAY_shader_wireframe(), OVERLAY_shader_wireframe_select(), select_engine_init(), and workbench_shader_get_ex().