|
Blender
V2.93
|
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 |
Variables | |
| const GPUShaderConfigData | GPU_shader_cfg_data [GPU_SHADER_CFG_LEN] |
| #define GPU_MAX_ATTR 15 |
Definition at line 420 of file GPU_shader.h.
| #define GPU_MAX_UNIFORM_ATTR 8 |
Definition at line 423 of file GPU_shader.h.
| #define GPU_SHADER_BUILTIN_LEN (GPU_SHADER_2D_UV_FACES_STRETCH_ANGLE + 1) |
Definition at line 388 of file GPU_shader.h.
| #define GPU_SHADER_CFG_LEN (GPU_SHADER_CFG_CLIPPED + 1) |
Definition at line 395 of file GPU_shader.h.
| #define GPU_shader_create_from_arrays | ( | ... | ) |
Definition at line 69 of file GPU_shader.h.
| #define GPU_shader_create_from_arrays_named | ( | name, | |
| ... | |||
| ) |
Definition at line 73 of file GPU_shader.h.
| typedef enum eGPUBuiltinShader eGPUBuiltinShader |
| typedef enum eGPUShaderConfig eGPUShaderConfig |
Support multiple configurations.
| typedef enum eGPUShaderTFBType eGPUShaderTFBType |
Opaque type hiding blender::gpu::Shader
Definition at line 1 of file GPU_shader.h.
| typedef struct GPUShaderConfigData GPUShaderConfigData |
| enum eGPUBuiltinShader |
Definition at line 159 of file GPU_shader.h.
| enum eGPUShaderConfig |
Support multiple configurations.
| Enumerator | |
|---|---|
| GPU_SHADER_CFG_DEFAULT | |
| GPU_SHADER_CFG_CLIPPED | |
Definition at line 391 of file GPU_shader.h.
| enum 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.
| 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.
| enum 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.
| void GPU_shader_bind | ( | GPUShader * | shader | ) |
Definition at line 494 of file gpu_shader.cc.
References blender::gpu::Context::get(), GPU_matrix_bind(), GPU_matrix_dirty_get(), GPU_shader_set_srgb_uniform(), gpu_shader_srgb_uniform_dirty_get(), shader(), blender::gpu::Context::shader, and blender::gpu::unwrap().
Referenced by createGPUShader(), draw_filled_lasso(), draw_shgroup(), blender::gpu::GLImmediate::end(), GPU_batch_draw(), GPU_batch_draw_instanced(), GPU_batch_draw_range(), GPU_batch_set_shader(), icon_draw_cache_texture_flush_ex(), icon_draw_texture(), immBindShader(), pygpu_batch_program_use_begin(), pygpu_shader_bind(), and wm_draw_region_blend().
| GPUShader* GPU_shader_create | ( | const char * | vertcode, |
| const char * | fragcode, | ||
| const char * | geomcode, | ||
| const char * | libcode, | ||
| const char * | defines, | ||
| const char * | shname | ||
| ) |
Definition at line 376 of file gpu_shader.cc.
References GPU_shader_create_ex(), and GPU_SHADER_TFB_NONE.
Referenced by createGPUShader(), DRW_shader_create_ex(), DRW_shader_create_fullscreen_ex(), DRW_shader_create_fullscreen_with_shaderlib_ex(), DRW_shader_create_with_lib_ex(), DRW_shader_create_with_shaderlib_ex(), GPU_pass_compile(), and GPU_shader_create_from_arrays_impl().
| 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 at line 290 of file gpu_shader.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), BLI_assert, blender::gpu::GPUBackend::get(), GPU_SHADER_TFB_NONE, shader(), blender::gpu::GPUBackend::shader_alloc(), standard_defines(), and blender::gpu::wrap().
Referenced by DRW_shader_create_with_transform_feedback(), GPU_shader_create(), and GPU_shader_create_from_python().
| 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.
| params | NULL terminated arrays of strings. |
Example:
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().
| GPUShader* GPU_shader_create_from_python | ( | const char * | vertcode, |
| const char * | fragcode, | ||
| const char * | geomcode, | ||
| const char * | libcode, | ||
| const char * | defines | ||
| ) |
Definition at line 387 of file gpu_shader.cc.
References BLI_strdupcat(), datatoc_gpu_shader_colorspace_lib_glsl, GPU_shader_create_ex(), GPU_SHADER_TFB_NONE, and MEM_SAFE_FREE.
Referenced by pygpu_shader__tp_new().
| void GPU_shader_free | ( | GPUShader * | shader | ) |
Definition at line 365 of file gpu_shader.cc.
References shader(), and blender::gpu::unwrap().
Referenced by DRW_shader_free(), GPU_pass_compile(), gpu_pass_free(), GPU_shader_free_builtin_shaders(), pygpu_shader__tp_dealloc(), and OCIO_GPUShader::~OCIO_GPUShader().
| void GPU_shader_free_builtin_shaders | ( | void | ) |
Definition at line 591 of file gpu_shader_builtin.c.
References builtin_shaders, GPU_SHADER_BUILTIN_LEN, GPU_SHADER_CFG_LEN, GPU_shader_free(), and NULL.
Referenced by gpu_codegen_exit(), and wm_main_playanim_intern().
| 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().
| 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().
| GPUShader* GPU_shader_get_builtin_shader | ( | eGPUBuiltinShader | shader | ) |
Definition at line 573 of file gpu_shader_builtin.c.
References GPU_SHADER_CFG_DEFAULT, GPU_shader_get_builtin_shader_with_config(), and shader().
Referenced by DRW_draw_cursor(), DRW_draw_cursor_2d(), icon_draw_cache_texture_flush_ex(), icon_draw_texture(), immBindBuiltinProgram(), immDrawPixelsTexSetup(), pygpu_shader_from_builtin(), and wm_draw_region_blend().
| 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 | ||
| ) |
Definition at line 578 of file gpu_shader_builtin.c.
References builtin_shader_stages, GPUShaderStages::defs, GPUShaderStages::frag, GPUShaderStages::geom, shader(), and GPUShaderStages::vert.
Referenced by pygpu_shader_code_from_builtin().
| GPUShader* GPU_shader_get_builtin_shader_with_config | ( | eGPUBuiltinShader | shader, |
| eGPUShaderConfig | sh_cfg | ||
| ) |
Definition at line 521 of file gpu_shader_builtin.c.
References BLI_assert, builtin_shader_stages, builtin_shaders, datatoc_gpu_shader_cfg_world_clip_lib_glsl, ELEM, GPU_SHADER_3D_DEPTH_ONLY, GPU_SHADER_3D_FLAT_COLOR, GPU_SHADER_3D_LINE_DASHED_UNIFORM_COLOR, GPU_SHADER_3D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_AA, GPU_SHADER_3D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_OUTLINE_AA, GPU_SHADER_3D_SMOOTH_COLOR, GPU_SHADER_3D_UNIFORM_COLOR, GPU_SHADER_BUILTIN_LEN, GPU_SHADER_CFG_CLIPPED, GPU_SHADER_CFG_DEFAULT, GPU_SHADER_CFG_LEN, GPU_shader_create_from_arrays_named, GPU_SHADER_INSTANCE_VARIYING_COLOR_VARIYING_SIZE, GPUShaderStages::name, NULL, and shader().
Referenced by GPU_batch_program_set_builtin_with_config(), and GPU_shader_get_builtin_shader().
| int GPU_shader_get_builtin_uniform | ( | GPUShader * | shader, |
| int | builtin | ||
| ) |
Definition at line 558 of file gpu_shader.cc.
References blender::gpu::ShaderInterface::uniform_builtin().
Referenced by drw_shgroup_init(), GPU_matrix_bind(), GPU_shader_set_srgb_uniform(), icon_draw_texture(), immUniformColor4f(), and wm_draw_region_blend().
| 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().
| int GPU_shader_get_texture_binding | ( | GPUShader * | shader, |
| const char * | name | ||
| ) |
Definition at line 585 of file gpu_shader.cc.
References tex.
Referenced by DRW_shgroup_uniform_image(), DRW_shgroup_uniform_image_ref(), DRW_shgroup_uniform_texture_ex(), DRW_shgroup_uniform_texture_ref_ex(), icon_draw_cache_texture_flush_ex(), icon_draw_texture(), immBindTexture(), immBindTextureSampler(), pygpu_shader_uniform_sampler(), and wm_draw_region_blend().
| int GPU_shader_get_uniform | ( | GPUShader * | shader, |
| const char * | name | ||
| ) |
Definition at line 551 of file gpu_shader.cc.
References blender::gpu::ShaderInput::location.
Referenced by count_active_texture_sampler(), createGPUShader(), draw_filled_lasso(), draw_image_buffer(), drw_shgroup_uniform(), DRW_shgroup_uniform_vec4_array_copy(), ED_mask_draw_region(), GPU_shader_uniform_1f(), GPU_shader_uniform_1i(), GPU_shader_uniform_2fv(), GPU_shader_uniform_2fv_array(), GPU_shader_uniform_3fv(), GPU_shader_uniform_4fv(), GPU_shader_uniform_4fv_array(), GPU_shader_uniform_mat4(), icon_draw_cache_texture_flush_ex(), icon_draw_texture(), immDrawPixelsTexScaled_clipping(), pygpu_shader_uniform_location_get(), sima_draw_zbuf_pixels(), sima_draw_zbuffloat_pixels(), and wm_draw_region_blend().
| int GPU_shader_get_uniform_block | ( | GPUShader * | shader, |
| const char * | name | ||
| ) |
Definition at line 571 of file gpu_shader.cc.
References blender::gpu::ShaderInput::location.
Referenced by pygpu_shader_uniform_block(), and pygpu_shader_uniform_block_from_name().
| int GPU_shader_get_uniform_block_binding | ( | GPUShader * | shader, |
| const char * | name | ||
| ) |
Definition at line 578 of file gpu_shader.cc.
References blender::gpu::ShaderInput::binding.
Referenced by createGPUShader(), DRW_shgroup_add_material_resources(), DRW_shgroup_uniform_block(), and DRW_shgroup_uniform_block_ref().
| void GPU_shader_set_framebuffer_srgb_target | ( | int | use_srgb_to_linear | ) |
Definition at line 740 of file gpu_shader.cc.
References g_shader_builtin_srgb_is_dirty, and g_shader_builtin_srgb_transform.
Referenced by blender::gpu::GLFrameBuffer::bind().
| void GPU_shader_set_srgb_uniform | ( | GPUShader * | shader | ) |
Definition at line 731 of file gpu_shader.cc.
References g_shader_builtin_srgb_is_dirty, g_shader_builtin_srgb_transform, GPU_shader_get_builtin_uniform(), GPU_shader_uniform_vector_int(), GPU_UNIFORM_SRGB_TRANSFORM, and shader().
Referenced by GPU_shader_bind(), and immBindShader().
| 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().
| 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().
| void GPU_shader_unbind | ( | void | ) |
Definition at line 516 of file gpu_shader.cc.
References blender::gpu::Context::get(), blender::gpu::Context::shader, and blender::gpu::Shader::unbind().
Referenced by draw_filled_lasso(), draw_shgroup(), drw_draw_pass_ex(), immUnbindProgram(), and pygpu_shader_unbind().
| 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().
Definition at line 668 of file gpu_shader.cc.
References GPU_shader_get_uniform(), and GPU_shader_uniform_float().
Referenced by createGPUShader(), and immUniform1f().
| void GPU_shader_uniform_1i | ( | GPUShader * | sh, |
| const char * | name, | ||
| int | value | ||
| ) |
Definition at line 639 of file gpu_shader.cc.
References GPU_shader_get_uniform(), and GPU_shader_uniform_int().
Referenced by GPU_shader_uniform_1b(), immUniform1i(), pygpu_shader_uniform_block(), and pygpu_shader_uniform_sampler().
Definition at line 650 of file gpu_shader.cc.
References data, GPU_shader_uniform_2fv(), x, and y.
Referenced by immUniform2f().
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().
| 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.
Definition at line 656 of file gpu_shader.cc.
References data, GPU_shader_uniform_3fv(), x, y, and z.
Referenced by createGPUShader(), and immUniform3f().
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().
| 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().
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().
| 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().
Definition at line 634 of file gpu_shader.cc.
References GPU_shader_uniform_vector(), and shader().
Referenced by GPU_shader_uniform_1f().
| void GPU_shader_uniform_int | ( | GPUShader * | shader, |
| int | location, | ||
| int | value | ||
| ) |
Definition at line 629 of file gpu_shader.cc.
References GPU_shader_uniform_vector_int(), and shader().
Referenced by createGPUShader(), draw_call_resource_bind(), draw_update_uniforms(), and GPU_shader_uniform_1i().
Definition at line 692 of file gpu_shader.cc.
References data, GPU_shader_get_uniform(), and GPU_shader_uniform_vector().
Referenced by immUniformMatrix4fv().
| void GPU_shader_uniform_vector | ( | GPUShader * | shader, |
| int | location, | ||
| int | length, | ||
| int | arraysize, | ||
| const float * | value | ||
| ) |
Definition at line 617 of file gpu_shader.cc.
References len, shader(), and blender::gpu::unwrap().
Referenced by createGPUShader(), draw_filled_lasso(), draw_image_buffer(), draw_legacy_matrix_update(), draw_update_uniforms(), ED_mask_draw_region(), GPU_matrix_bind(), GPU_shader_uniform_2fv(), GPU_shader_uniform_2fv_array(), GPU_shader_uniform_3fv(), GPU_shader_uniform_4fv(), GPU_shader_uniform_4fv_array(), GPU_shader_uniform_float(), GPU_shader_uniform_mat4(), icon_draw_cache_texture_flush_ex(), icon_draw_texture(), immUniformColor4f(), pygpu_shader_uniform_float(), pygpu_shader_uniform_vector_float(), sima_draw_zbuf_pixels(), sima_draw_zbuffloat_pixels(), and wm_draw_region_blend().
| void GPU_shader_uniform_vector_int | ( | GPUShader * | shader, |
| int | location, | ||
| int | length, | ||
| int | arraysize, | ||
| const int * | value | ||
| ) |
Definition at line 623 of file gpu_shader.cc.
References len, shader(), and blender::gpu::unwrap().
Referenced by createGPUShader(), draw_geometry_execute(), draw_update_uniforms(), GPU_shader_set_srgb_uniform(), GPU_shader_uniform_int(), pygpu_shader_uniform_bool(), pygpu_shader_uniform_int(), and pygpu_shader_uniform_vector_int().
|
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().