Blender  V3.3
Namespaces | Variables
gpu_shader.cc File Reference
#include "MEM_guardedalloc.h"
#include "BLI_string_utils.h"
#include "GPU_capabilities.h"
#include "GPU_debug.h"
#include "GPU_matrix.h"
#include "GPU_platform.h"
#include "gpu_backend.hh"
#include "gpu_context_private.hh"
#include "gpu_shader_create_info.hh"
#include "gpu_shader_create_info_private.hh"
#include "gpu_shader_dependency_private.h"
#include "gpu_shader_private.hh"
#include <string>

Go to the source code of this file.

Namespaces

 blender
 
 blender::gpu
 

Functions

Creation / Destruction
static void standard_defines (Vector< const char * > &sources)
 
GPUShaderGPU_shader_create_ex (const char *vertcode, const char *fragcode, const char *geomcode, const char *computecode, const char *libcode, const char *defines, const eGPUShaderTFBType tf_type, const char **tf_names, const int tf_count, const char *shname)
 
void GPU_shader_free (GPUShader *shader)
 
Creation utils
GPUShaderGPU_shader_create (const char *vertcode, const char *fragcode, const char *geomcode, const char *libcode, const char *defines, const char *shname)
 
GPUShaderGPU_shader_create_compute (const char *computecode, const char *libcode, const char *defines, const char *shname)
 
const GPUShaderCreateInfoGPU_shader_create_info_get (const char *info_name)
 
bool GPU_shader_create_info_check_error (const GPUShaderCreateInfo *_info, char r_error[128])
 
GPUShaderGPU_shader_create_from_info_name (const char *info_name)
 
GPUShaderGPU_shader_create_from_info (const GPUShaderCreateInfo *_info)
 
GPUShaderGPU_shader_create_from_python (const char *vertcode, const char *fragcode, const char *geomcode, const char *libcode, const char *defines, const char *name)
 
static const char * string_join_array_maybe_alloc (const char **str_arr, bool *r_is_alloc)
 
struct GPUShaderGPU_shader_create_from_arrays_impl (const struct GPU_ShaderCreateFromArray_Params *params, const char *func, int line)
 
Binding
void GPU_shader_bind (GPUShader *gpu_shader)
 
void GPU_shader_unbind ()
 
Shader name
const char * GPU_shader_get_name (GPUShader *shader)
 
Transform feedback

TODO(fclem): Should be replaced by compute shaders.

bool GPU_shader_transform_feedback_enable (GPUShader *shader, GPUVertBuf *vertbuf)
 
void GPU_shader_transform_feedback_disable (GPUShader *shader)
 
Uniforms / Resource location
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_ssbo (GPUShader *shader, const char *name)
 
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)
 
int GPU_shader_get_attribute (GPUShader *shader, const char *name)
 
Getters
int GPU_shader_get_program (GPUShader *shader)
 
Uniforms setters
void GPU_shader_uniform_vector (GPUShader *shader, int loc, int len, int arraysize, const float *value)
 
void GPU_shader_uniform_vector_int (GPUShader *shader, int loc, int len, int arraysize, const int *value)
 
void GPU_shader_uniform_int (GPUShader *shader, int location, int value)
 
void GPU_shader_uniform_float (GPUShader *shader, int location, float 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_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_1f (GPUShader *sh, const char *name, float value)
 
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])
 

Variables

char datatoc_gpu_shader_colorspace_lib_glsl []
 

sRGB Rendering Workaround

The viewport overlay frame-buffer is sRGB and will expect shaders to output display referred Linear colors. But other frame-buffers (i.e: the area frame-buffers) are not sRGB and require the shader output color to be in sRGB space (assumed display encoded color-space as the time of writing). For this reason we have a uniform to switch the transform on and off depending on the current frame-buffer color-space.

static int g_shader_builtin_srgb_transform = 0
 
static bool g_shader_builtin_srgb_is_dirty = false
 
static bool gpu_shader_srgb_uniform_dirty_get ()
 
void GPU_shader_set_srgb_uniform (GPUShader *shader)
 
void GPU_shader_set_framebuffer_srgb_target (int use_srgb_to_linear)
 

Function Documentation

◆ GPU_shader_bind()

void GPU_shader_bind ( GPUShader gpu_shader)

Definition at line 491 of file gpu_shader.cc.

References blender::gpu::Shader::bind(), blender::gpu::Context::get(), GPU_matrix_bind(), GPU_matrix_dirty_get(), GPU_shader_set_srgb_uniform(), gpu_shader_srgb_uniform_dirty_get(), blender::gpu::Context::shader, and blender::gpu::unwrap().

Referenced by draw_filled_lasso(), draw_shgroup(), draw_subdiv_accumulate_normals(), draw_subdiv_build_edge_fac_buffer(), draw_subdiv_build_edituv_stretch_angle_buffer(), draw_subdiv_build_edituv_stretch_area_buffer(), draw_subdiv_build_fdots_buffers(), draw_subdiv_build_lines_buffer(), draw_subdiv_build_lines_loose_buffer(), draw_subdiv_build_lnor_buffer(), draw_subdiv_build_sculpt_data_buffer(), draw_subdiv_build_tris_buffer(), draw_subdiv_extract_pos_nor(), draw_subdiv_extract_uvs(), draw_subdiv_finalize_custom_normals(), draw_subdiv_finalize_normals(), draw_subdiv_interp_custom_data(), blender::gpu::GLImmediate::end(), GPU_batch_draw(), GPU_batch_draw_instanced(), GPU_batch_draw_range(), GPU_batch_set_shader(), GPU_compute_dispatch(), GPU_compute_dispatch_indirect(), GPU_shader_get_builtin_shader_with_config(), icon_draw_cache_texture_flush_ex(), icon_draw_texture(), immBindShader(), pygpu_batch_program_use_begin(), pygpu_shader_bind(), blender::gpu::tests::test_gpu_shader_compute_1d(), blender::gpu::tests::test_gpu_shader_compute_2d(), blender::gpu::tests::test_gpu_shader_compute_ibo(), blender::gpu::tests::test_gpu_shader_compute_vbo(), blender::gpu::tests::test_gpu_shader_ssbo_binding(), and wm_draw_region_blend().

◆ 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_compute()

GPUShader* GPU_shader_create_compute ( const char *  computecode,
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 *  computecode,
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:87
ccl_gpu_kernel_postfix ccl_global float int int int int sh

Definition at line 458 of file gpu_shader.cc.

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

◆ GPU_shader_create_from_info()

GPUShader* GPU_shader_create_from_info ( const GPUShaderCreateInfo _info)

Definition at line 277 of file gpu_shader.cc.

References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), BLI_assert, blender::StringRefNull::c_str(), blender::gpu::shader::ShaderCreateInfo::check_error(), blender::gpu::Shader::compute_layout_declare(), blender::gpu::Shader::compute_shader_from_glsl(), blender::gpu::shader::ShaderCreateInfo::compute_source_, blender::gpu::Shader::defines_declare(), error(), blender::Vector< T, InlineBufferCapacity, Allocator >::extend(), blender::gpu::Shader::finalize(), blender::gpu::Shader::fragment_shader_from_glsl(), blender::gpu::shader::ShaderCreateInfo::fragment_source_, blender::gpu::Shader::geometry_layout_declare(), blender::gpu::Shader::geometry_shader_from_glsl(), blender::gpu::shader::ShaderCreateInfo::geometry_source_, blender::gpu::GPUBackend::get(), GPU_debug_group_begin(), GPU_debug_group_end(), GPU_DEBUG_SHADER_COMPILATION_GROUP, blender::gpu::shader::gpu_shader_dependency_get_resolved_source(), blender::gpu::shader::gpu_shader_dependency_get_source(), blender::StringRefBase::is_empty(), blender::gpu::shader::ShaderCreateInfo::legacy_resource_location_, blender::gpu::shader::ShaderCreateInfo::name_, blender::gpu::Shader::resources_declare(), blender::gpu::GPUBackend::shader_alloc(), standard_defines(), blender::gpu::shader::ShaderCreateInfo::typedef_source_generated, blender::gpu::shader::ShaderCreateInfo::typedef_sources_, blender::gpu::Shader::vertex_shader_from_glsl(), blender::gpu::shader::ShaderCreateInfo::vertex_source_, and blender::gpu::wrap().

Referenced by createGPUShader(), GPU_pass_compile(), GPU_shader_create_from_info_name(), gpu_shader_create_info_compile_all(), and pygpu_shader_create_from_info().

◆ GPU_shader_create_from_info_name()

GPUShader* GPU_shader_create_from_info_name ( const char *  info_name)

Definition at line 265 of file gpu_shader.cc.

References blender::StringRefNull::c_str(), blender::gpu::shader::ShaderCreateInfo::do_static_compilation_, GPU_shader_create_from_info(), gpu_shader_create_info_get(), and blender::gpu::shader::ShaderCreateInfo::name_.

Referenced by BASIC_shaders_curves_depth_sh_get(), BASIC_shaders_depth_conservative_sh_get(), BASIC_shaders_depth_sh_get(), BASIC_shaders_pointcloud_depth_conservative_sh_get(), BASIC_shaders_pointcloud_depth_sh_get(), external_engine_init(), GPENCIL_shader_antialiasing(), GPENCIL_shader_depth_merge_get(), GPENCIL_shader_fx_blur_get(), GPENCIL_shader_fx_colorize_get(), GPENCIL_shader_fx_composite_get(), GPENCIL_shader_fx_glow_get(), GPENCIL_shader_fx_pixelize_get(), GPENCIL_shader_fx_rim_get(), GPENCIL_shader_fx_shadow_get(), GPENCIL_shader_fx_transform_get(), GPENCIL_shader_geometry_get(), GPENCIL_shader_layer_blend_get(), GPENCIL_shader_mask_invert_get(), GPU_shader_get_builtin_shader_with_config(), hair_refine_shader_compute_create(), hair_refine_shader_transform_feedback_workaround_create(), blender::draw::image_engine::IMAGE_shader_depth_get(), blender::draw::image_engine::IMAGE_shader_image_get(), OVERLAY_shader_antialiasing(), 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_background(), 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_guide_point(), 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_edit_uv_edges_for_edge_select_get(), OVERLAY_shader_edit_uv_edges_get(), OVERLAY_shader_edit_uv_face_dots_get(), OVERLAY_shader_edit_uv_face_get(), OVERLAY_shader_edit_uv_mask_image(), OVERLAY_shader_edit_uv_stencil_image(), OVERLAY_shader_edit_uv_stretching_angle_get(), OVERLAY_shader_edit_uv_stretching_area_get(), OVERLAY_shader_edit_uv_tiled_image_borders_get(), OVERLAY_shader_edit_uv_verts_get(), 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_gpencil_canvas(), OVERLAY_shader_grid(), OVERLAY_shader_grid_background(), OVERLAY_shader_grid_image(), OVERLAY_shader_image(), OVERLAY_shader_motion_path_line(), OVERLAY_shader_motion_path_vert(), OVERLAY_shader_outline_detect(), OVERLAY_shader_outline_prepass(), OVERLAY_shader_outline_prepass_curves(), 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_curves_selection(), OVERLAY_shader_sculpt_mask(), OVERLAY_shader_uniform_color(), OVERLAY_shader_volume_gridlines(), OVERLAY_shader_volume_velocity(), OVERLAY_shader_wireframe(), OVERLAY_shader_wireframe_select(), OVERLAY_shader_xray_fade(), select_engine_init(), blender::eevee::ShaderModule::static_shader_get(), workbench_shader_antialiasing_accumulation_get(), workbench_shader_antialiasing_get(), workbench_shader_cavity_get(), workbench_shader_composite_get(), workbench_shader_depth_of_field_get(), workbench_shader_get_ex(), workbench_shader_merge_infront_get(), workbench_shader_outline_get(), workbench_shader_shadow_pass_get_ex(), workbench_shader_transparent_resolve_get(), and workbench_shader_volume_get().

◆ 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,
const char *  name 
)

◆ GPU_shader_create_info_check_error()

bool GPU_shader_create_info_check_error ( const GPUShaderCreateInfo _info,
char  r_error[128] 
)

◆ GPU_shader_create_info_get()

const GPUShaderCreateInfo* GPU_shader_create_info_get ( const char *  info_name)

Definition at line 247 of file gpu_shader.cc.

References gpu_shader_create_info_get().

Referenced by blender::eevee::ShaderModule::ShaderModule().

◆ GPU_shader_free()

void GPU_shader_free ( GPUShader shader)

◆ GPU_shader_get_attribute()

int GPU_shader_get_attribute ( GPUShader shader,
const char *  name 
)

Definition at line 606 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 572 of file gpu_shader.cc.

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

Referenced by drw_shgroup_init().

◆ GPU_shader_get_builtin_uniform()

int GPU_shader_get_builtin_uniform ( GPUShader shader,
int  builtin 
)

◆ GPU_shader_get_name()

const char* GPU_shader_get_name ( GPUShader shader)

Definition at line 530 of file gpu_shader.cc.

References blender::gpu::unwrap().

Referenced by pygpu_shader_name().

◆ GPU_shader_get_program()

int GPU_shader_get_program ( GPUShader shader)

DEPRECATED: Kept only because of BGL API.

Definition at line 619 of file gpu_shader.cc.

References blender::gpu::unwrap().

Referenced by pygpu_shader_program_get().

◆ GPU_shader_get_ssbo()

int GPU_shader_get_ssbo ( GPUShader shader,
const char *  name 
)

◆ 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 
)

DEPRECATED: Kept only because of Python GPU API.

Definition at line 585 of file gpu_shader.cc.

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

Referenced by pygpu_shader_uniform_block_from_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_srgb_uniform_dirty_get()

static bool gpu_shader_srgb_uniform_dirty_get ( )
static

Definition at line 739 of file gpu_shader.cc.

References g_shader_builtin_srgb_is_dirty.

Referenced by GPU_shader_bind().

◆ GPU_shader_transform_feedback_disable()

void GPU_shader_transform_feedback_disable ( GPUShader shader)

Definition at line 548 of file gpu_shader.cc.

References blender::gpu::unwrap().

Referenced by draw_shgroup().

◆ GPU_shader_transform_feedback_enable()

bool GPU_shader_transform_feedback_enable ( GPUShader shader,
struct GPUVertBuf vertbuf 
)

Returns true if transform feedback was successfully enabled.

Definition at line 543 of file gpu_shader.cc.

References 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 658 of file gpu_shader.cc.

References GPU_shader_uniform_1i(), and sh.

◆ GPU_shader_uniform_1f()

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

Definition at line 681 of file gpu_shader.cc.

References GPU_shader_get_uniform(), GPU_shader_uniform_float(), and sh.

Referenced by 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 663 of file gpu_shader.cc.

References data, GPU_shader_uniform_2fv(), sh, 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 687 of file gpu_shader.cc.

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

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 711 of file gpu_shader.cc.

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

◆ GPU_shader_uniform_3f()

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

Definition at line 669 of file gpu_shader.cc.

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

Referenced by immUniform3f().

◆ GPU_shader_uniform_3fv()

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

Definition at line 693 of file gpu_shader.cc.

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

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 675 of file gpu_shader.cc.

References data, GPU_shader_uniform_4fv(), sh, 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 699 of file gpu_shader.cc.

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

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 717 of file gpu_shader.cc.

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

Referenced by immUniformArray4fv().

◆ GPU_shader_uniform_float()

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

Definition at line 647 of file gpu_shader.cc.

References GPU_shader_uniform_vector().

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 705 of file gpu_shader.cc.

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

Referenced by immUniformMatrix4fv().

◆ GPU_shader_uniform_vector()

void GPU_shader_uniform_vector ( GPUShader shader,
int  loc,
int  len,
int  arraysize,
const float value 
)

◆ GPU_shader_uniform_vector_int()

void GPU_shader_uniform_vector_int ( GPUShader shader,
int  loc,
int  len,
int  arraysize,
const int *  value 
)

◆ standard_defines()

static void standard_defines ( Vector< const char * > &  sources)
static

◆ string_join_array_maybe_alloc()

static const char* string_join_array_maybe_alloc ( const char **  str_arr,
bool r_is_alloc 
)
static

Definition at line 433 of file gpu_shader.cc.

References BLI_string_join_arrayN().

Referenced by GPU_shader_create_from_arrays_impl().

Variable Documentation

◆ datatoc_gpu_shader_colorspace_lib_glsl

char datatoc_gpu_shader_colorspace_lib_glsl[]

Definition at line 26 of file gpu_shader.cc.

Referenced by GPU_shader_create_from_python().

◆ g_shader_builtin_srgb_is_dirty

bool g_shader_builtin_srgb_is_dirty = false
static

◆ g_shader_builtin_srgb_transform

int g_shader_builtin_srgb_transform = 0
static