|
Blender V4.3
|
#include "BLI_span.hh"#include "BLI_vector.hh"#include "GPU_common_types.hh"#include "GPU_shader_builtin.hh"Go to the source code of this file.
Classes | |
| struct | ShaderSpecialization |
Namespaces | |
| namespace | blender |
| namespace | blender::gpu |
Macros | |
| #define | GPU_MAX_ATTR 15 |
| #define | GPU_MAX_UNIFORM_ATTR 8 |
Functions | |
Free | |
| void | GPU_shader_free (GPUShader *shader) |
Binding | |
| void | GPU_shader_bind (GPUShader *shader) |
| void | GPU_shader_unbind () |
| GPUShader * | GPU_shader_get_bound () |
Debugging introspection API. | |
| const char * | GPU_shader_get_name (GPUShader *shader) |
Uniform API. | |
| int | GPU_shader_get_ubo_binding (GPUShader *shader, const char *name) |
| int | GPU_shader_get_ssbo_binding (GPUShader *shader, const char *name) |
| int | GPU_shader_get_sampler_binding (GPUShader *shader, const char *name) |
| int | GPU_shader_get_uniform (GPUShader *shader, const char *name) |
| int | GPU_shader_get_constant (GPUShader *shader, const char *name) |
| void | GPU_shader_uniform_float_ex (GPUShader *shader, int location, int length, int array_size, const float *value) |
| void | GPU_shader_uniform_int_ex (GPUShader *shader, int location, int length, int array_size, const 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_2iv (GPUShader *sh, const char *name, const int data[2]) |
| void | GPU_shader_uniform_mat4 (GPUShader *sh, const char *name, const float data[4][4]) |
| void | GPU_shader_uniform_mat3_as_mat4 (GPUShader *sh, const char *name, const float data[3][3]) |
| void | GPU_shader_uniform_1f_array (GPUShader *sh, const char *name, int len, const float *val) |
| 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]) |
Attribute API. | |
Used to create #GPUVertexFormat from the shader's vertex input layout. | |
| unsigned int | GPU_shader_get_attribute_len (const GPUShader *shader) |
| int | GPU_shader_get_attribute (const GPUShader *shader, const char *name) |
| bool | GPU_shader_get_attribute_info (const GPUShader *shader, int attr_location, char r_name[256], int *r_type) |
Creation | |
| using | BatchHandle = int64_t |
| GPUShader * | GPU_shader_create_from_info (const GPUShaderCreateInfo *_info) |
| GPUShader * | GPU_shader_create_from_info_name (const char *info_name) |
| const GPUShaderCreateInfo * | GPU_shader_create_info_get (const char *info_name) |
| void | GPU_shader_create_info_get_unfinalized_copy (const char *info_name, GPUShaderCreateInfo &r_info) |
| bool | GPU_shader_create_info_check_error (const GPUShaderCreateInfo *_info, char r_error[128]) |
| BatchHandle | GPU_shader_batch_create_from_infos (blender::Span< const GPUShaderCreateInfo * > infos) |
| bool | GPU_shader_batch_is_ready (BatchHandle handle) |
| blender::Vector< GPUShader * > | GPU_shader_batch_finalize (BatchHandle &handle) |
Specialization API. | |
Used to allow specialization constants. IMPORTANT: All constants must be specified before binding a shader that needs specialization. Otherwise, it will produce undefined behavior. | |
| using | SpecializationBatchHandle = int64_t |
| void | GPU_shader_constant_int_ex (GPUShader *sh, int location, int value) |
| void | GPU_shader_constant_uint_ex (GPUShader *sh, int location, unsigned int value) |
| void | GPU_shader_constant_float_ex (GPUShader *sh, int location, float value) |
| void | GPU_shader_constant_bool_ex (GPUShader *sh, int location, bool value) |
| void | GPU_shader_constant_int (GPUShader *sh, const char *name, int value) |
| void | GPU_shader_constant_uint (GPUShader *sh, const char *name, unsigned int value) |
| void | GPU_shader_constant_float (GPUShader *sh, const char *name, float value) |
| void | GPU_shader_constant_bool (GPUShader *sh, const char *name, bool value) |
| SpecializationBatchHandle | GPU_shader_batch_specializations (blender::Span< ShaderSpecialization > specializations) |
| bool | GPU_shader_batch_specializations_is_ready (SpecializationBatchHandle &handle) |
A GPUShader is a container for backend specific shader program.
Definition in file GPU_shader.hh.
| #define GPU_MAX_ATTR 15 |
Definition at line 29 of file GPU_shader.hh.
Referenced by blender::draw::clear_final_data(), blender::draw::discard_attributes(), blender::draw::drw_attributes_add_request(), blender::draw::drw_attributes_merge_requests(), blender::draw::DRW_mesh_batch_cache_create_requested(), blender::draw::ensure_attributes(), blender::draw::mesh_buffer_cache_create_requested_subdiv(), blender::draw::pointcloud_discard_attributes(), and blender::draw::pointcloud_surface_shaded_get().
| #define GPU_MAX_UNIFORM_ATTR 8 |
Definition at line 32 of file GPU_shader.hh.
Referenced by gpu_node_graph_add_uniform_attribute().
| #define GPU_NUM_UNIFORMS (GPU_UNIFORM_SRGB_TRANSFORM + 1) |
Definition at line 382 of file GPU_shader.hh.
Referenced by blender::gpu::GLShaderInterface::GLShaderInterface(), blender::gpu::GLShaderInterface::GLShaderInterface(), blender::gpu::MTLShaderInterface::init(), blender::gpu::VKShaderInterface::init(), blender::gpu::MTLShaderInterface::map_builtins(), and blender::gpu::ShaderInterface::uniform_builtin().
| using BatchHandle = int64_t |
Definition at line 68 of file GPU_shader.hh.
| using SpecializationBatchHandle = int64_t |
Definition at line 226 of file GPU_shader.hh.
| enum eGPUShaderTFBType |
| Enumerator | |
|---|---|
| GPU_SHADER_TFB_NONE | |
| GPU_SHADER_TFB_POINTS | |
| GPU_SHADER_TFB_LINES | |
| GPU_SHADER_TFB_TRIANGLES | |
Definition at line 262 of file GPU_shader.hh.
DEPRECATED: Use hard-coded buffer location instead.
Definition at line 400 of file GPU_shader.hh.
| enum GPUUniformBuiltin |
Indexed commonly used uniform name for faster lookup into the uniform cache.
Definition at line 358 of file GPU_shader.hh.
| BatchHandle GPU_shader_batch_create_from_infos | ( | blender::Span< const GPUShaderCreateInfo * > | infos | ) |
Request the creation of multiple shaders at once, allowing the backend to use multithreaded compilation. Returns a handle that can be used to poll if all shaders have been compiled, and to retrieve the compiled shaders. NOTE: This function is asynchronous on OpenGL, but it's blocking on Vulkan and Metal. WARNING: The GPUShaderCreateInfo pointers should be valid until GPU_shader_batch_finalize has returned.
Definition at line 336 of file gpu_shader.cc.
References blender::gpu::ShaderCompiler::batch_compile(), blender::gpu::Context::compiler, and blender::gpu::Context::get().
Referenced by GPU_pass_begin_async_compilation(), and blender::eevee::ShaderModule::ShaderModule().
| blender::Vector< GPUShader * > GPU_shader_batch_finalize | ( | BatchHandle & | handle | ) |
Retrieve the compiled shaders, in the same order as the GPUShaderCreateInfos. If the compilation has not finished yet, this call will block the thread until all the shaders are ready. Shaders with compilation errors are returned as null pointers. WARNING: The handle will be invalidated by this call, you can't request the same batch twice.
Definition at line 349 of file gpu_shader.cc.
References blender::gpu::ShaderCompiler::batch_finalize(), blender::gpu::Context::compiler, blender::gpu::Context::get(), and result.
Referenced by GPU_pass_async_compilation_try_finalize(), GPU_pass_compile(), and blender::eevee::ShaderModule::is_ready().
| bool GPU_shader_batch_is_ready | ( | BatchHandle | handle | ) |
Returns true if all the shaders from the batch have finished their compilation.
Definition at line 344 of file gpu_shader.cc.
References blender::gpu::ShaderCompiler::batch_is_ready(), blender::gpu::Context::compiler, and blender::gpu::Context::get().
Referenced by GPU_pass_async_compilation_try_finalize(), and blender::eevee::ShaderModule::is_ready().
| SpecializationBatchHandle GPU_shader_batch_specializations | ( | blender::Span< ShaderSpecialization > | specializations | ) |
Request the compilation of multiple specialization constant variations at once, allowing the backend to use multi-threaded compilation. Returns a handle that can be used to poll if all variations have been compiled. A NULL handle indicates no compilation of any variant was possible (likely due to some state being currently available) and so no batch was created. Compilation of the specialized variant will instead occur at draw/dispatch time. NOTE: This function is asynchronous on OpenGL and Metal and a no-op on Vulkan. Batches are processed one by one in FIFO order. WARNING: Binding a specialization before the batch finishes will fail.
Definition at line 534 of file gpu_shader.cc.
References blender::gpu::Context::compiler, blender::gpu::Context::get(), and blender::gpu::ShaderCompiler::precompile_specializations().
Referenced by blender::eevee::ShaderModule::precompile_specializations().
| bool GPU_shader_batch_specializations_is_ready | ( | SpecializationBatchHandle & | handle | ) |
Returns true if all the specializations from the batch have finished their compilation. NOTE: Polling this function is required for the compilation process to keep progressing. WARNING: Invalidates the handle if it returns true.
Definition at line 540 of file gpu_shader.cc.
References blender::gpu::Context::compiler, blender::gpu::Context::get(), and blender::gpu::ShaderCompiler::specialization_batch_is_ready().
Referenced by blender::eevee::ShaderModule::is_ready().
| void GPU_shader_bind | ( | GPUShader * | shader | ) |
Set the given shader as active shader for the active GPU context. It replaces any already bound shader. All following draw-calls and dispatches will use this shader. Uniform functions need to have the shader bound in order to work. (TODO: until we use glProgramUniform)
Definition at line 372 of file gpu_shader.cc.
References blender::gpu::Shader::bind(), blender::gpu::Context::get(), GPU_matrix_bind(), GPU_matrix_dirty_get(), GPU_SHADER_PRINTF_SLOT, GPU_storagebuf_bind(), blender::gpu::Context::printf_buf, blender::gpu::Context::shader, and blender::gpu::unwrap().
Referenced by blender::realtime_compositor::apply_morphological_operator(), blender::nodes::node_composite_glare_cc::GlareOperation::apply_streak_filter(), blender::draw::command::DrawMultiBuf::bind(), BlenderFallbackDisplayShader::bind(), blender::realtime_compositor::blend_neighborhood(), blender::realtime_compositor::blur_pass(), blender::realtime_compositor::BokehKernel::BokehKernel(), blender::realtime_compositor::calculate_blending_weights(), blender::nodes::node_composite_movieclip_cc::MovieClipOperation::compute_alpha(), blender::nodes::node_composite_glare_cc::GlareOperation::compute_base_ghost(), blender::nodes::node_composite_glare_cc::GlareOperation::compute_bloom_downsample_chain(), blender::nodes::node_composite_double_edge_mask_cc::DoubleEdgeMaskOperation::compute_boundary(), blender::realtime_compositor::compute_complete_blocks(), blender::realtime_compositor::compute_complete_x_prologues(), blender::realtime_compositor::compute_complete_y_prologues(), blender::nodes::node_composite_defocus_cc::DefocusOperation::compute_defocus_radius_from_depth(), blender::nodes::node_composite_defocus_cc::DefocusOperation::compute_defocus_radius_from_scale(), blender::nodes::node_composite_double_edge_mask_cc::DoubleEdgeMaskOperation::compute_gradient(), blender::nodes::node_composite_base_cryptomatte_cc::BaseCryptoMatteOperation::compute_image(), blender::nodes::node_composite_keying_cc::KeyingOperation::compute_image(), blender::nodes::node_composite_movieclip_cc::MovieClipOperation::compute_image(), blender::realtime_compositor::compute_incomplete_prologues(), blender::nodes::node_composite_inpaint_cc::InpaintOperation::compute_inpainting_boundary(), blender::nodes::node_composite_inpaint_cc::InpaintOperation::compute_inpainting_region(), blender::nodes::node_composite_zcombine_cc::ZCombineOperation::compute_mask(), blender::nodes::node_composite_base_cryptomatte_cc::BaseCryptoMatteOperation::compute_matte(), blender::nodes::node_composite_keying_cc::KeyingOperation::compute_matte(), blender::nodes::node_composite_vec_blur_cc::VectorBlurOperation::compute_max_tile_velocity(), blender::nodes::node_composite_vec_blur_cc::VectorBlurOperation::compute_motion_blur(), blender::nodes::node_composite_base_cryptomatte_cc::BaseCryptoMatteOperation::compute_pick(), blender::nodes::node_composite_cornerpin_cc::CornerPinOperation::compute_plane(), blender::nodes::node_composite_planetrackdeform_cc::PlaneTrackDeformOperation::compute_plane(), blender::nodes::node_composite_cornerpin_cc::CornerPinOperation::compute_plane_mask(), blender::nodes::node_composite_planetrackdeform_cc::PlaneTrackDeformOperation::compute_plane_mask(), blender::realtime_compositor::compute_preview_from_result(), blender::draw::View::compute_procedural_bounds(), blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::compute_structure_tensor(), blender::nodes::node_composite_keying_cc::KeyingOperation::compute_tweaked_matte(), blender::draw::View::compute_visibility(), blender::realtime_compositor::detect_edges(), blender::nodes::node_composite_vec_blur_cc::VectorBlurOperation::dilate_max_velocity(), draw_filled_lasso(), draw_shgroup(), blender::draw::draw_subdiv_accumulate_normals(), blender::draw::draw_subdiv_build_edge_fac_buffer(), blender::draw::draw_subdiv_build_edituv_stretch_angle_buffer(), blender::draw::draw_subdiv_build_edituv_stretch_area_buffer(), blender::draw::draw_subdiv_build_fdots_buffers(), blender::draw::draw_subdiv_build_lines_buffer(), blender::draw::draw_subdiv_build_lines_loose_buffer(), blender::draw::draw_subdiv_build_lnor_buffer(), blender::draw::draw_subdiv_build_sculpt_data_buffer(), blender::draw::draw_subdiv_build_tris_buffer(), blender::draw::draw_subdiv_extract_pos_nor(), blender::draw::draw_subdiv_extract_uvs(), blender::draw::draw_subdiv_finalize_custom_normals(), blender::draw::draw_subdiv_finalize_normals(), blender::draw::draw_subdiv_interp_custom_data(), blender::gpu::GLImmediate::end(), blender::gpu::MTLImmediate::end(), blender::draw::Manager::end_sync(), blender::draw::command::ShaderBind::execute(), blender::nodes::node_composite_bilateralblur_cc::BilateralBlurOperation::execute(), blender::nodes::node_composite_boxmask_cc::BoxMaskOperation::execute(), blender::nodes::node_composite_defocus_cc::DefocusOperation::execute(), blender::nodes::node_composite_despeckle_cc::DespeckleOperation::execute(), blender::nodes::node_composite_directionalblur_cc::DirectionalBlurOperation::execute(), blender::nodes::node_composite_displace_cc::DisplaceOperation::execute(), blender::nodes::node_composite_ellipsemask_cc::EllipseMaskOperation::execute(), blender::nodes::node_composite_filter_cc::FilterOperation::execute(), blender::nodes::node_composite_flip_cc::FlipOperation::execute(), blender::nodes::node_composite_id_mask_cc::IDMaskOperation::execute(), blender::nodes::node_composite_map_uv_cc::MapUVOperation::execute(), blender::nodes::node_composite_moviedistortion_cc::MovieDistortionOperation::execute(), blender::nodes::node_composite_normalize_cc::NormalizeOperation::execute(), blender::nodes::node_composite_pixelate_cc::PixelateOperation::execute(), blender::nodes::node_composite_split_cc::SplitOperation::execute(), blender::nodes::node_composite_sunbeams_cc::SunBeamsOperation::execute(), blender::realtime_compositor::ConversionOperation::execute(), blender::realtime_compositor::ShaderOperation::execute(), blender::nodes::node_composite_crop_cc::CropOperation::execute_alpha_crop(), blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::execute_anisotropic(), blender::nodes::node_composite_zcombine_cc::ZCombineOperation::execute_anti_aliased(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_bloom(), blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::execute_classic(), blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::execute_classic_summed_area_table(), blender::nodes::node_composite_blur_cc::BlurOperation::execute_constant_size(), blender::nodes::node_composite_bokehblur_cc::BokehBlurOperation::execute_constant_size(), blender::nodes::node_composite_composite_cc::CompositeOperation::execute_copy_gpu(), blender::nodes::node_composite_viewer_cc::ViewerOperation::execute_copy_gpu(), blender::nodes::node_composite_dilate_cc::DilateErodeOperation::execute_distance_threshold(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_ghost(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_highlights(), blender::nodes::node_composite_composite_cc::CompositeOperation::execute_ignore_alpha_gpu(), blender::nodes::node_composite_viewer_cc::ViewerOperation::execute_ignore_alpha_gpu(), blender::nodes::node_composite_crop_cc::CropOperation::execute_image_crop(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_mix(), blender::nodes::node_composite_render_layer_cc::RenderLayerOperation::execute_pass(), blender::nodes::node_composite_tonemap_cc::ToneMapOperation::execute_photoreceptor(), blender::nodes::node_composite_lensdist_cc::LensDistortionOperation::execute_projector_distortion(), blender::nodes::node_composite_lensdist_cc::LensDistortionOperation::execute_screen_distortion(), blender::nodes::node_composite_composite_cc::CompositeOperation::execute_set_alpha_gpu(), blender::nodes::node_composite_viewer_cc::ViewerOperation::execute_set_alpha_gpu(), blender::nodes::node_composite_tonemap_cc::ToneMapOperation::execute_simple(), blender::nodes::node_composite_zcombine_cc::ZCombineOperation::execute_simple(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_simple_star_axis_aligned(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_simple_star_diagonal(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_simple_star_diagonal_pass(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_simple_star_horizontal_pass(), blender::nodes::node_composite_dilate_cc::DilateErodeOperation::execute_step_horizontal_pass(), blender::nodes::node_composite_dilate_cc::DilateErodeOperation::execute_step_vertical_pass(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_streaks(), blender::nodes::node_composite_blur_cc::BlurOperation::execute_variable_size(), blender::nodes::node_composite_bokehblur_cc::BokehBlurOperation::execute_variable_size(), blender::nodes::node_composite_scale_cc::ScaleOperation::execute_variable_size(), blender::realtime_compositor::extract_alpha_gpu(), blender::nodes::node_composite_keying_cc::KeyingOperation::extract_input_chroma(), blender::nodes::node_composite_inpaint_cc::InpaintOperation::fill_inpainting_region(), blender::ed::seq::StripsDrawBatch::flush_batch(), ThumbsDrawBatch::flush_batch(), GPU_batch_bind_as_resources(), GPU_batch_draw(), GPU_batch_draw_instance_range(), GPU_batch_draw_range(), GPU_batch_set_shader(), GPU_compute_dispatch(), GPU_compute_dispatch_indirect(), GPU_indexbuf_build_curves_on_device(), GPU_shader_get_builtin_shader_with_config(), blender::realtime_compositor::horizontal_pass(), blender::realtime_compositor::horizontal_pass(), blender::realtime_compositor::horizontal_pass(), immBindShader(), blender::gpu::tests::Shader::init_shader(), blender::realtime_compositor::jump_flooding_pass(), blender::realtime_compositor::KeyingScreen::KeyingScreen(), blender::realtime_compositor::maximum_float(), blender::realtime_compositor::maximum_float_in_range(), blender::realtime_compositor::maximum_luminance(), blender::realtime_compositor::minimum_float(), blender::realtime_compositor::minimum_float_in_range(), blender::realtime_compositor::minimum_luminance(), blender::realtime_compositor::morphological_distance(), pygpu_batch_program_use_begin(), pygpu_shader_bind(), pygpu_shader_image(), pygpu_shader_uniform_block(), pygpu_shader_uniform_bool(), pygpu_shader_uniform_float(), pygpu_shader_uniform_int(), pygpu_shader_uniform_sampler(), pygpu_shader_uniform_vector_float(), pygpu_shader_uniform_vector_int(), blender::realtime_compositor::realize_on_domain(), blender::render::hydra::ViewportEngine::render(), blender::nodes::node_composite_keying_cc::KeyingOperation::replace_input_chroma(), blender::realtime_compositor::sum_blue(), blender::realtime_compositor::sum_blue_squared_difference(), blender::realtime_compositor::sum_causal_and_non_causal_results(), blender::realtime_compositor::sum_causal_and_non_causal_results(), blender::realtime_compositor::sum_color(), blender::realtime_compositor::sum_green(), blender::realtime_compositor::sum_green_squared_difference(), blender::realtime_compositor::sum_log_luminance(), blender::realtime_compositor::sum_luminance(), blender::realtime_compositor::sum_luminance_squared_difference(), blender::realtime_compositor::sum_red(), blender::realtime_compositor::sum_red_squared_difference(), blender::gpu::tests::test_buffer_texture(), blender::gpu::tests::test_compute_direct(), blender::gpu::tests::test_compute_indirect(), blender::gpu::tests::test_shader_compute_1d(), blender::gpu::tests::test_shader_compute_2d(), blender::gpu::tests::test_shader_compute_ibo(), blender::gpu::tests::test_shader_compute_ssbo(), blender::gpu::tests::test_shader_compute_vbo(), blender::realtime_compositor::vertical_pass(), blender::realtime_compositor::vertical_pass(), blender::realtime_compositor::vertical_pass(), and wm_draw_region_blend().
| void GPU_shader_cache_dir_clear_old | ( | ) |
Definition at line 361 of file gpu_shader.cc.
References blender::gpu::GPUBackend::get(), and blender::gpu::GPUBackend::shader_cache_dir_clear_old().
Referenced by WM_exit_ex().
| void GPU_shader_compile_static | ( | ) |
Compile all statically defined shaders and print a report to the console.
This is used for platform support, where bug reports can list all failing shaders.
Definition at line 355 of file gpu_shader.cc.
References gpu_shader_create_info_compile(), and printf.
Referenced by WM_init_gpu().
| void GPU_shader_constant_bool | ( | GPUShader * | sh, |
| const char * | name, | ||
| bool | value ) |
Definition at line 529 of file gpu_shader.cc.
References GPU_shader_constant_bool_ex(), and blender::gpu::unwrap().
Referenced by blender::gpu::tests::ShaderSpecializationConst::ShaderSpecializationConst().
Definition at line 509 of file gpu_shader.cc.
References blender::assign_if_different(), BLI_assert, blender::gpu::shader::BOOL, and blender::gpu::unwrap().
Referenced by blender::draw::command::SpecializeConstant::execute(), and GPU_shader_constant_bool().
Definition at line 525 of file gpu_shader.cc.
References GPU_shader_constant_float_ex(), and blender::gpu::unwrap().
Referenced by blender::gpu::tests::ShaderSpecializationConst::ShaderSpecializationConst().
Definition at line 503 of file gpu_shader.cc.
References blender::assign_if_different(), BLI_assert, blender::gpu::shader::FLOAT, and blender::gpu::unwrap().
Referenced by blender::draw::command::SpecializeConstant::execute(), and GPU_shader_constant_float().
Definition at line 517 of file gpu_shader.cc.
References GPU_shader_constant_int_ex(), and blender::gpu::unwrap().
Referenced by blender::gpu::tests::ShaderSpecializationConst::ShaderSpecializationConst().
Definition at line 491 of file gpu_shader.cc.
References blender::assign_if_different(), BLI_assert, blender::gpu::shader::INT, and blender::gpu::unwrap().
Referenced by blender::draw::command::SpecializeConstant::execute(), and GPU_shader_constant_int().
Definition at line 521 of file gpu_shader.cc.
References GPU_shader_constant_uint_ex(), and blender::gpu::unwrap().
Referenced by blender::gpu::tests::ShaderSpecializationConst::ShaderSpecializationConst().
Definition at line 497 of file gpu_shader.cc.
References blender::assign_if_different(), BLI_assert, blender::gpu::shader::UINT, and blender::gpu::unwrap().
Referenced by blender::draw::command::SpecializeConstant::execute(), and GPU_shader_constant_uint().
| 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 223 of file gpu_shader.cc.
References GPU_shader_create_ex(), and GPU_SHADER_TFB_NONE.
| GPUShader * GPU_shader_create_compute | ( | const char * | computecode, |
| const char * | libcode, | ||
| const char * | defines, | ||
| const char * | shname ) |
Definition at line 242 of file gpu_shader.cc.
References GPU_shader_create_ex(), and GPU_SHADER_TFB_NONE.
Referenced by blender::draw::get_patch_evaluation_shader(), blender::draw::get_subdiv_custom_data_shader(), and blender::draw::get_subdiv_shader().
| 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 at line 119 of file gpu_shader.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), BLI_assert, blender::gpu::GPUBackend::get(), GPU_SHADER_TFB_NONE, blender::gpu::GPUBackend::shader_alloc(), standard_defines(), and blender::gpu::wrap().
Referenced by GPU_shader_create(), GPU_shader_create_compute(), and GPU_shader_create_from_python().
| GPUShader * GPU_shader_create_from_info | ( | const GPUShaderCreateInfo * | _info | ) |
Create a shader using the given #GPUShaderCreateInfo. Can return a null pointer if compilation fails.
Definition at line 295 of file gpu_shader.cc.
References blender::gpu::Context::get(), and blender::gpu::wrap().
Referenced by blender::realtime_compositor::CachedShader::CachedShader(), createGPUShader(), GPU_pass_compile(), GPU_shader_create_from_info_name(), gpu_shader_create_info_compile(), blender::gpu::tests::gpu_shader_lib_test(), pygpu_shader_create_from_info(), blender::gpu::tests::test_framebuffer_multi_viewport(), and blender::gpu::tests::test_framebuffer_subpass_input().
| GPUShader * GPU_shader_create_from_info_name | ( | const char * | info_name | ) |
Create a shader using a named #GPUShaderCreateInfo registered at startup. These are declared inside *_info.hh files using the GPU_SHADER_CREATE_INFO() macro. They are also expected to have been flagged using do_static_compilation. Can return a null pointer if compilation fails.
Definition at line 283 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(), compile_fallback_shader(), DRW_shader_debug_draw_display_get(), DRW_shader_debug_print_display_get(), DRW_shader_draw_command_generate_get(), DRW_shader_draw_resource_finalize_get(), DRW_shader_draw_view_finalize_get(), DRW_shader_draw_visibility_compute_get(), external_engine_init(), blender::workbench::StaticShader::get(), 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(), blender::draw::image_engine::IMAGE_shader_depth_get(), blender::draw::image_engine::IMAGE_shader_image_get(), blender::gpu::tests::Shader::init_shader(), blender::gpu::tests::ShaderSpecializationConst::init_shader(), 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_curves_handle(), 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_depth(), 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_cage(), OVERLAY_shader_sculpt_curves_selection(), OVERLAY_shader_sculpt_mask(), OVERLAY_shader_uniform_color(), OVERLAY_shader_uniform_color_pointcloud(), OVERLAY_shader_viewer_attribute_curve(), OVERLAY_shader_viewer_attribute_curves(), OVERLAY_shader_viewer_attribute_mesh(), OVERLAY_shader_viewer_attribute_pointcloud(), OVERLAY_shader_volume_gridlines(), OVERLAY_shader_volume_velocity(), OVERLAY_shader_wireframe(), OVERLAY_shader_wireframe_select(), OVERLAY_shader_xray_fade(), blender::eevee::Precompute::Precompute(), select_debug_engine_init(), select_engine_init(), blender::eevee::ShaderModule::static_shader_get(), blender::gpu::tests::test_buffer_texture(), blender::gpu::tests::test_compute_direct(), blender::gpu::tests::test_compute_indirect(), blender::draw::test_eevee_shadow_finalize(), blender::draw::test_eevee_shadow_free(), blender::draw::test_eevee_shadow_page_mask_ex(), blender::draw::test_eevee_shadow_shift(), blender::draw::test_eevee_shadow_shift_clear(), blender::draw::test_eevee_shadow_tag_update(), blender::draw::test_eevee_shadow_tilemap_amend(), blender::draw::test_eevee_surfel_list(), blender::gpu::tests::test_shader_compute_1d(), blender::gpu::tests::test_shader_compute_2d(), blender::gpu::tests::test_shader_compute_ibo(), blender::gpu::tests::test_shader_compute_ssbo(), blender::gpu::tests::test_shader_compute_vbo(), blender::gpu::tests::test_shader_ssbo_binding(), blender::draw::TestAlloc::TestAlloc(), and blender::draw::TestDefrag::TestDefrag().
| 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 at line 302 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().
| bool GPU_shader_create_info_check_error | ( | const GPUShaderCreateInfo * | _info, |
| char | r_error[128] ) |
Error checking for user created shaders.
Definition at line 270 of file gpu_shader.cc.
References BLI_strncpy(), blender::gpu::shader::ShaderCreateInfo::check_error(), and error().
Referenced by pygpu_shader_create_from_info().
| const GPUShaderCreateInfo * GPU_shader_create_info_get | ( | const char * | info_name | ) |
Fetch a named #GPUShaderCreateInfo registered at startup. These are declared inside *_info.hh files using the GPU_SHADER_CREATE_INFO() macro. Can return a null pointer if no match is found.
Definition at line 259 of file gpu_shader.cc.
References gpu_shader_create_info_get().
Referenced by blender::realtime_compositor::CachedShader::CachedShader(), and blender::eevee::ShaderModule::ShaderModule().
| void GPU_shader_create_info_get_unfinalized_copy | ( | const char * | info_name, |
| GPUShaderCreateInfo & | r_info ) |
Definition at line 264 of file gpu_shader.cc.
References gpu_shader_create_info_get_unfinalized_copy().
| void GPU_shader_free | ( | GPUShader * | shader | ) |
Definition at line 212 of file gpu_shader.cc.
References blender::gpu::unwrap().
Referenced by blender::gpu::MTLContextTextureUtils::cleanup(), BlenderFallbackDisplayShader::destroy_shader(), DRW_shader_free(), blender::draw::DRW_subdiv_free(), GPU_pass_finalize_compilation(), gpu_pass_free(), gpu_shader_create_info_compile(), GPU_shader_free_builtin_shaders(), blender::gpu::tests::gpu_shader_lib_test(), blender::eevee::Precompute::Precompute(), pygpu_shader__tp_dealloc(), blender::gpu::tests::test_buffer_texture(), blender::gpu::tests::test_compute_direct(), blender::gpu::tests::test_compute_indirect(), blender::draw::test_eevee_shadow_finalize(), blender::draw::test_eevee_shadow_free(), blender::draw::test_eevee_shadow_page_mask_ex(), blender::draw::test_eevee_shadow_shift(), blender::draw::test_eevee_shadow_shift_clear(), blender::draw::test_eevee_shadow_tag_update(), blender::draw::test_eevee_shadow_tilemap_amend(), blender::draw::test_eevee_surfel_list(), blender::gpu::tests::test_framebuffer_multi_viewport(), blender::gpu::tests::test_framebuffer_subpass_input(), blender::gpu::tests::test_shader_compute_1d(), blender::gpu::tests::test_shader_compute_2d(), blender::gpu::tests::test_shader_compute_ibo(), blender::gpu::tests::test_shader_compute_ssbo(), blender::gpu::tests::test_shader_compute_vbo(), blender::gpu::tests::test_shader_ssbo_binding(), blender::draw::TestAlloc::TestAlloc(), blender::draw::TestDefrag::TestDefrag(), blender::realtime_compositor::CachedShader::~CachedShader(), OCIO_GPUShader::~OCIO_GPUShader(), blender::gpu::tests::Shader::~Shader(), and blender::gpu::tests::ShaderSpecializationConst::~ShaderSpecializationConst().
Definition at line 611 of file gpu_shader.cc.
References blender::gpu::ShaderInput::location.
Referenced by BlenderDisplayShader::get_position_attrib_location(), BlenderDisplayShader::get_tex_coord_attrib_location(), and pygpu_shader_attr_from_name().
| bool GPU_shader_get_attribute_info | ( | const GPUShader * | shader, |
| int | attr_location, | ||
| char | r_name[256], | ||
| int * | r_type ) |
Definition at line 618 of file gpu_shader.cc.
References BLI_strncpy().
Referenced by GPU_vertformat_from_shader(), and pygpu_shader_attrs_info_get().
Definition at line 605 of file gpu_shader.cc.
References blender::gpu::ShaderInterface::attr_len_.
Referenced by GPU_vertformat_from_shader(), and pygpu_shader_attrs_info_get().
| GPUShader * GPU_shader_get_bound | ( | ) |
Return the currently bound shader to the active GPU context.
Definition at line 415 of file gpu_shader.cc.
References blender::gpu::Context::get(), blender::gpu::Context::shader, and blender::gpu::wrap().
Referenced by BlenderDisplaySpaceShader::bind(), and BlenderDisplaySpaceShader::get_shader_program().
DEPRECATED: Use hard-coded buffer location instead.
Definition at line 571 of file gpu_shader.cc.
References blender::gpu::ShaderInterface::ubo_builtin().
Referenced by drw_shgroup_init().
TODO: To be moved as private API. Not really used outside of gpu_matrix.cc and doesn't really offer a noticeable performance boost.
Definition at line 565 of file gpu_shader.cc.
References blender::gpu::ShaderInterface::uniform_builtin().
Referenced by drw_shgroup_init(), GPU_matrix_bind(), immUniformColor4f(), blender::gpu::Shader::set_srgb_uniform(), and wm_draw_region_blend().
Returns specialization constant location.
Definition at line 558 of file gpu_shader.cc.
References blender::gpu::ShaderInput::location.
Referenced by blender::draw::detail::PassBase< DrawCommandBufType >::specialize_constant(), blender::draw::detail::PassBase< DrawCommandBufType >::specialize_constant(), blender::draw::detail::PassBase< DrawCommandBufType >::specialize_constant(), blender::draw::detail::PassBase< DrawCommandBufType >::specialize_constant(), blender::draw::detail::PassBase< DrawCommandBufType >::specialize_constant(), blender::draw::detail::PassBase< DrawCommandBufType >::specialize_constant(), blender::draw::detail::PassBase< DrawCommandBufType >::specialize_constant(), and blender::draw::detail::PassBase< DrawCommandBufType >::specialize_constant().
| const char * GPU_shader_get_name | ( | GPUShader * | shader | ) |
Definition at line 430 of file gpu_shader.cc.
References blender::gpu::unwrap().
Referenced by pygpu_shader_name(), and blender::draw::command::ShaderBind::serialize().
DEPRECATED: Kept only because of BGL API.
Definition at line 641 of file gpu_shader.cc.
References blender::gpu::unwrap().
Referenced by pygpu_shader_program_get().
Definition at line 598 of file gpu_shader.cc.
References tex.
Referenced by blender::realtime_compositor::SMAAPrecomputedTextures::bind_area_texture(), blender::realtime_compositor::Result::bind_as_image(), blender::realtime_compositor::DistortionGrid::bind_as_texture(), blender::realtime_compositor::KeyingScreen::bind_as_texture(), blender::realtime_compositor::Result::bind_as_texture(), blender::realtime_compositor::SymmetricBlurWeights::bind_as_texture(), blender::realtime_compositor::SymmetricSeparableBlurWeights::bind_as_texture(), blender::realtime_compositor::MorphologicalDistanceFeatherWeights::bind_distance_falloffs_as_texture(), blender::draw::detail::PassBase< DrawCommandBufType >::bind_image(), blender::draw::detail::PassBase< DrawCommandBufType >::bind_image(), blender::realtime_compositor::SMAAPrecomputedTextures::bind_search_texture(), blender::draw::detail::PassBase< DrawCommandBufType >::bind_texture(), blender::draw::detail::PassBase< DrawCommandBufType >::bind_texture(), blender::draw::detail::PassBase< DrawCommandBufType >::bind_texture(), blender::draw::detail::PassBase< DrawCommandBufType >::bind_texture(), blender::realtime_compositor::MorphologicalDistanceFeatherWeights::bind_weights_as_texture(), blender::nodes::node_composite_movieclip_cc::MovieClipOperation::compute_alpha(), blender::nodes::node_composite_movieclip_cc::MovieClipOperation::compute_image(), blender::nodes::node_composite_base_cryptomatte_cc::BaseCryptoMatteOperation::compute_matte(), blender::nodes::node_composite_base_cryptomatte_cc::BaseCryptoMatteOperation::compute_pick(), blender::render::hydra::DrawTexture::draw(), DRW_shgroup_buffer_texture(), DRW_shgroup_buffer_texture_ref(), DRW_shgroup_uniform_image(), DRW_shgroup_uniform_image_ref(), DRW_shgroup_uniform_texture_ex(), DRW_shgroup_uniform_texture_ref_ex(), blender::nodes::node_composite_render_layer_cc::RenderLayerOperation::execute_pass(), immBindTexture(), immBindTextureSampler(), blender::realtime_compositor::KeyingScreen::KeyingScreen(), blender::realtime_compositor::parallel_reduction_dispatch(), pygpu_shader_image(), pygpu_shader_uniform_sampler(), blender::gpu::tests::test_buffer_texture(), blender::gpu::tests::test_compute_direct(), blender::gpu::tests::test_compute_indirect(), blender::gpu::tests::test_shader_compute_1d(), blender::gpu::tests::test_shader_compute_2d(), ThumbsDrawBatch::ThumbsDrawBatch(), and wm_draw_region_blend().
Definition at line 577 of file gpu_shader.cc.
References blender::gpu::ShaderInput::location.
Referenced by blender::draw::command::DrawMultiBuf::bind(), blender::gpu::tests::Shader::bind(), blender::draw::detail::PassBase< DrawCommandBufType >::bind_ssbo(), blender::draw::detail::PassBase< DrawCommandBufType >::bind_ssbo(), blender::draw::detail::PassBase< DrawCommandBufType >::bind_ssbo(), blender::draw::detail::PassBase< DrawCommandBufType >::bind_ssbo(), blender::draw::detail::PassBase< DrawCommandBufType >::bind_ssbo(), blender::draw::detail::PassBase< DrawCommandBufType >::bind_ssbo(), blender::draw::detail::PassBase< DrawCommandBufType >::bind_ssbo(), blender::draw::detail::PassBase< DrawCommandBufType >::bind_ssbo(), blender::nodes::node_composite_vec_blur_cc::VectorBlurOperation::compute_motion_blur(), blender::draw::View::compute_procedural_bounds(), blender::draw::View::compute_visibility(), blender::nodes::node_composite_vec_blur_cc::VectorBlurOperation::dilate_max_velocity(), DRW_shgroup_storage_block_ex(), DRW_shgroup_storage_block_ref_ex(), DRW_shgroup_vertex_buffer_ex(), DRW_shgroup_vertex_buffer_ref_ex(), blender::draw::Manager::end_sync(), GPU_indexbuf_build_curves_on_device(), blender::realtime_compositor::KeyingScreen::KeyingScreen(), blender::gpu::tests::ShaderSpecializationConst::ShaderSpecializationConst(), blender::gpu::tests::test_buffer_texture(), blender::gpu::tests::test_shader_compute_ibo(), blender::gpu::tests::test_shader_compute_ssbo(), blender::gpu::tests::test_shader_compute_vbo(), and blender::gpu::tests::test_shader_ssbo_binding().
SSBO Vertex-fetch is used as an alternative path to geometry shaders wherein the vertex count is expanded up-front. This function fetches the number of specified output vertices per input primitive.
Definition at line 646 of file gpu_shader.cc.
References blender::gpu::unwrap().
Referenced by blender::draw::command::DrawMultiBuf::bind().
Returns binding point location. Binding location are given to be set at shader compile time and immutable.
Definition at line 591 of file gpu_shader.cc.
References blender::gpu::ShaderInput::binding.
Referenced by blender::draw::detail::PassBase< DrawCommandBufType >::bind_ubo(), blender::draw::detail::PassBase< DrawCommandBufType >::bind_ubo(), blender::nodes::node_composite_planetrackdeform_cc::PlaneTrackDeformOperation::compute_plane(), blender::nodes::node_composite_planetrackdeform_cc::PlaneTrackDeformOperation::compute_plane_mask(), blender::draw::draw_subdiv_ubo_update_and_bind(), DRW_shgroup_add_material_resources(), DRW_shgroup_uniform_block_ex(), DRW_shgroup_uniform_block_ref_ex(), immBindUniformBuf(), pygpu_shader_uniform_block(), blender::ed::seq::StripsDrawBatch::StripsDrawBatch(), and ThumbsDrawBatch::ThumbsDrawBatch().
Returns uniform location. If cached, it is faster than querying the interface for each uniform assignment.
Definition at line 551 of file gpu_shader.cc.
References blender::gpu::ShaderInput::location.
Referenced by count_active_texture_sampler(), BlenderFallbackDisplayShader::create_shader_if_needed(), draw_filled_lasso(), drw_shgroup_uniform(), DRW_shgroup_uniform_mat4_copy(), ED_mask_draw_region(), GPU_shader_uniform_1f(), GPU_shader_uniform_1f_array(), GPU_shader_uniform_1i(), GPU_shader_uniform_2fv(), GPU_shader_uniform_2fv_array(), GPU_shader_uniform_2iv(), GPU_shader_uniform_3fv(), GPU_shader_uniform_4fv(), GPU_shader_uniform_4fv_array(), GPU_shader_uniform_mat4(), immDrawPixelsTexScaledFullSize(), immDrawPixelsTexTiled_scaling_clipping(), blender::draw::detail::PassBase< DrawCommandBufType >::push_constant_offset(), pygpu_shader_uniform_location_get(), blender::draw::test_draw_pass_all_commands(), and wm_draw_region_blend().
DEPRECATED: Kept only because of Python GPU API.
Definition at line 584 of file gpu_shader.cc.
References blender::gpu::ShaderInput::location.
Referenced by pygpu_shader_uniform_block_from_name().
Definition at line 441 of file gpu_shader.cc.
References BLI_assert, blender::gpu::Shader::parent_set(), and blender::gpu::unwrap().
Referenced by gpu_material_finalize(), and GPU_material_optimize().
| void GPU_shader_transform_feedback_disable | ( | GPUShader * | shader | ) |
Definition at line 470 of file gpu_shader.cc.
References blender::gpu::unwrap().
Referenced by draw_shgroup().
| bool GPU_shader_transform_feedback_enable | ( | GPUShader * | shader, |
| blender::gpu::VertBuf * | vertbuf ) |
Returns true if transform feedback was successfully enabled.
Definition at line 465 of file gpu_shader.cc.
References blender::gpu::unwrap().
Referenced by draw_update_uniforms().
| void GPU_shader_unbind | ( | ) |
Unbind the active shader.
Definition at line 404 of file gpu_shader.cc.
References blender::gpu::Context::get(), blender::gpu::Context::shader, and blender::gpu::Shader::unbind().
Referenced by blender::realtime_compositor::apply_morphological_operator(), blender::nodes::node_composite_glare_cc::GlareOperation::apply_streak_filter(), blender::realtime_compositor::blend_neighborhood(), blender::realtime_compositor::blur_pass(), blender::realtime_compositor::BokehKernel::BokehKernel(), blender::realtime_compositor::calculate_blending_weights(), blender::nodes::node_composite_movieclip_cc::MovieClipOperation::compute_alpha(), blender::nodes::node_composite_glare_cc::GlareOperation::compute_base_ghost(), blender::nodes::node_composite_glare_cc::GlareOperation::compute_bloom_downsample_chain(), blender::nodes::node_composite_double_edge_mask_cc::DoubleEdgeMaskOperation::compute_boundary(), blender::realtime_compositor::compute_complete_blocks(), blender::realtime_compositor::compute_complete_x_prologues(), blender::realtime_compositor::compute_complete_y_prologues(), blender::nodes::node_composite_defocus_cc::DefocusOperation::compute_defocus_radius_from_depth(), blender::nodes::node_composite_defocus_cc::DefocusOperation::compute_defocus_radius_from_scale(), blender::nodes::node_composite_double_edge_mask_cc::DoubleEdgeMaskOperation::compute_gradient(), blender::nodes::node_composite_base_cryptomatte_cc::BaseCryptoMatteOperation::compute_image(), blender::nodes::node_composite_keying_cc::KeyingOperation::compute_image(), blender::nodes::node_composite_movieclip_cc::MovieClipOperation::compute_image(), blender::realtime_compositor::compute_incomplete_prologues(), blender::nodes::node_composite_inpaint_cc::InpaintOperation::compute_inpainting_boundary(), blender::nodes::node_composite_inpaint_cc::InpaintOperation::compute_inpainting_region(), blender::nodes::node_composite_zcombine_cc::ZCombineOperation::compute_mask(), blender::nodes::node_composite_base_cryptomatte_cc::BaseCryptoMatteOperation::compute_matte(), blender::nodes::node_composite_keying_cc::KeyingOperation::compute_matte(), blender::nodes::node_composite_vec_blur_cc::VectorBlurOperation::compute_max_tile_velocity(), blender::nodes::node_composite_vec_blur_cc::VectorBlurOperation::compute_motion_blur(), blender::nodes::node_composite_base_cryptomatte_cc::BaseCryptoMatteOperation::compute_pick(), blender::nodes::node_composite_cornerpin_cc::CornerPinOperation::compute_plane(), blender::nodes::node_composite_planetrackdeform_cc::PlaneTrackDeformOperation::compute_plane(), blender::nodes::node_composite_cornerpin_cc::CornerPinOperation::compute_plane_mask(), blender::nodes::node_composite_planetrackdeform_cc::PlaneTrackDeformOperation::compute_plane_mask(), blender::realtime_compositor::compute_preview_from_result(), blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::compute_structure_tensor(), blender::nodes::node_composite_keying_cc::KeyingOperation::compute_tweaked_matte(), blender::realtime_compositor::detect_edges(), blender::nodes::node_composite_vec_blur_cc::VectorBlurOperation::dilate_max_velocity(), draw_filled_lasso(), draw_shgroup(), blender::draw::draw_subdiv_accumulate_normals(), blender::draw::draw_subdiv_build_edge_fac_buffer(), blender::draw::draw_subdiv_build_edituv_stretch_angle_buffer(), blender::draw::draw_subdiv_build_edituv_stretch_area_buffer(), blender::draw::draw_subdiv_build_fdots_buffers(), blender::draw::draw_subdiv_build_lines_buffer(), blender::draw::draw_subdiv_build_lines_loose_buffer(), blender::draw::draw_subdiv_build_lnor_buffer(), blender::draw::draw_subdiv_build_sculpt_data_buffer(), blender::draw::draw_subdiv_build_tris_buffer(), blender::draw::draw_subdiv_extract_pos_nor(), blender::draw::draw_subdiv_extract_uvs(), blender::draw::draw_subdiv_finalize_custom_normals(), blender::draw::draw_subdiv_finalize_normals(), blender::draw::draw_subdiv_interp_custom_data(), drw_draw_pass_ex(), blender::nodes::node_composite_bilateralblur_cc::BilateralBlurOperation::execute(), blender::nodes::node_composite_boxmask_cc::BoxMaskOperation::execute(), blender::nodes::node_composite_defocus_cc::DefocusOperation::execute(), blender::nodes::node_composite_despeckle_cc::DespeckleOperation::execute(), blender::nodes::node_composite_directionalblur_cc::DirectionalBlurOperation::execute(), blender::nodes::node_composite_displace_cc::DisplaceOperation::execute(), blender::nodes::node_composite_ellipsemask_cc::EllipseMaskOperation::execute(), blender::nodes::node_composite_filter_cc::FilterOperation::execute(), blender::nodes::node_composite_flip_cc::FlipOperation::execute(), blender::nodes::node_composite_id_mask_cc::IDMaskOperation::execute(), blender::nodes::node_composite_map_uv_cc::MapUVOperation::execute(), blender::nodes::node_composite_moviedistortion_cc::MovieDistortionOperation::execute(), blender::nodes::node_composite_normalize_cc::NormalizeOperation::execute(), blender::nodes::node_composite_pixelate_cc::PixelateOperation::execute(), blender::nodes::node_composite_split_cc::SplitOperation::execute(), blender::nodes::node_composite_sunbeams_cc::SunBeamsOperation::execute(), blender::realtime_compositor::ConversionOperation::execute(), blender::realtime_compositor::ShaderOperation::execute(), blender::nodes::node_composite_crop_cc::CropOperation::execute_alpha_crop(), blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::execute_anisotropic(), blender::nodes::node_composite_zcombine_cc::ZCombineOperation::execute_anti_aliased(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_bloom(), blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::execute_classic(), blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::execute_classic_summed_area_table(), blender::nodes::node_composite_blur_cc::BlurOperation::execute_constant_size(), blender::nodes::node_composite_bokehblur_cc::BokehBlurOperation::execute_constant_size(), blender::nodes::node_composite_composite_cc::CompositeOperation::execute_copy_gpu(), blender::nodes::node_composite_viewer_cc::ViewerOperation::execute_copy_gpu(), blender::nodes::node_composite_dilate_cc::DilateErodeOperation::execute_distance_threshold(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_ghost(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_highlights(), blender::nodes::node_composite_composite_cc::CompositeOperation::execute_ignore_alpha_gpu(), blender::nodes::node_composite_viewer_cc::ViewerOperation::execute_ignore_alpha_gpu(), blender::nodes::node_composite_crop_cc::CropOperation::execute_image_crop(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_mix(), blender::nodes::node_composite_render_layer_cc::RenderLayerOperation::execute_pass(), blender::nodes::node_composite_tonemap_cc::ToneMapOperation::execute_photoreceptor(), blender::nodes::node_composite_lensdist_cc::LensDistortionOperation::execute_projector_distortion(), blender::nodes::node_composite_lensdist_cc::LensDistortionOperation::execute_screen_distortion(), blender::nodes::node_composite_composite_cc::CompositeOperation::execute_set_alpha_gpu(), blender::nodes::node_composite_viewer_cc::ViewerOperation::execute_set_alpha_gpu(), blender::nodes::node_composite_tonemap_cc::ToneMapOperation::execute_simple(), blender::nodes::node_composite_zcombine_cc::ZCombineOperation::execute_simple(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_simple_star_axis_aligned(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_simple_star_diagonal(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_simple_star_diagonal_pass(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_simple_star_horizontal_pass(), blender::nodes::node_composite_dilate_cc::DilateErodeOperation::execute_step_horizontal_pass(), blender::nodes::node_composite_dilate_cc::DilateErodeOperation::execute_step_vertical_pass(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_streaks(), blender::nodes::node_composite_blur_cc::BlurOperation::execute_variable_size(), blender::nodes::node_composite_bokehblur_cc::BokehBlurOperation::execute_variable_size(), blender::nodes::node_composite_scale_cc::ScaleOperation::execute_variable_size(), blender::realtime_compositor::extract_alpha_gpu(), blender::nodes::node_composite_keying_cc::KeyingOperation::extract_input_chroma(), blender::nodes::node_composite_inpaint_cc::InpaintOperation::fill_inpainting_region(), GPU_indexbuf_build_curves_on_device(), blender::gpu::tests::gpu_shader_lib_test(), blender::realtime_compositor::horizontal_pass(), blender::realtime_compositor::horizontal_pass(), blender::realtime_compositor::horizontal_pass(), immUnbindProgram(), blender::realtime_compositor::jump_flooding_pass(), blender::realtime_compositor::KeyingScreen::KeyingScreen(), blender::realtime_compositor::maximum_float(), blender::realtime_compositor::maximum_float_in_range(), blender::realtime_compositor::maximum_luminance(), blender::realtime_compositor::minimum_float(), blender::realtime_compositor::minimum_float_in_range(), blender::realtime_compositor::minimum_luminance(), blender::realtime_compositor::morphological_distance(), pygpu_batch_program_use_end(), pygpu_shader_unbind(), blender::realtime_compositor::realize_on_domain(), blender::render::hydra::ViewportEngine::render(), blender::nodes::node_composite_keying_cc::KeyingOperation::replace_input_chroma(), blender::realtime_compositor::sum_blue(), blender::realtime_compositor::sum_blue_squared_difference(), blender::realtime_compositor::sum_causal_and_non_causal_results(), blender::realtime_compositor::sum_causal_and_non_causal_results(), blender::realtime_compositor::sum_color(), blender::realtime_compositor::sum_green(), blender::realtime_compositor::sum_green_squared_difference(), blender::realtime_compositor::sum_log_luminance(), blender::realtime_compositor::sum_luminance(), blender::realtime_compositor::sum_luminance_squared_difference(), blender::realtime_compositor::sum_red(), blender::realtime_compositor::sum_red_squared_difference(), blender::gpu::tests::test_buffer_texture(), blender::gpu::tests::test_compute_direct(), blender::gpu::tests::test_compute_indirect(), blender::gpu::tests::test_shader_compute_1d(), blender::gpu::tests::test_shader_compute_2d(), blender::gpu::tests::test_shader_compute_ibo(), blender::gpu::tests::test_shader_compute_ssbo(), blender::gpu::tests::test_shader_compute_vbo(), BlenderFallbackDisplayShader::unbind(), blender::realtime_compositor::vertical_pass(), blender::realtime_compositor::vertical_pass(), blender::realtime_compositor::vertical_pass(), blender::gpu::tests::Shader::~Shader(), and blender::gpu::tests::ShaderSpecializationConst::~ShaderSpecializationConst().
| void GPU_shader_uniform_1b | ( | GPUShader * | sh, |
| const char * | name, | ||
| bool | value ) |
Definition at line 680 of file gpu_shader.cc.
References GPU_shader_uniform_1i().
Referenced by blender::draw::command::DrawMultiBuf::bind(), blender::nodes::node_composite_double_edge_mask_cc::DoubleEdgeMaskOperation::compute_boundary(), blender::nodes::node_composite_vec_blur_cc::VectorBlurOperation::compute_max_tile_velocity(), blender::nodes::node_composite_keying_cc::KeyingOperation::compute_tweaked_matte(), blender::nodes::node_composite_defocus_cc::DefocusOperation::execute(), blender::nodes::node_composite_flip_cc::FlipOperation::execute(), blender::nodes::node_composite_zcombine_cc::ZCombineOperation::execute_anti_aliased(), blender::nodes::node_composite_blur_cc::BlurOperation::execute_constant_size(), blender::nodes::node_composite_bokehblur_cc::BokehBlurOperation::execute_constant_size(), blender::nodes::node_composite_zcombine_cc::ZCombineOperation::execute_simple(), blender::nodes::node_composite_blur_cc::BlurOperation::execute_variable_size(), GPU_batch_bind_as_resources(), blender::realtime_compositor::horizontal_pass(), blender::realtime_compositor::horizontal_pass(), blender::realtime_compositor::parallel_reduction_dispatch(), blender::realtime_compositor::vertical_pass(), and blender::realtime_compositor::vertical_pass().
Definition at line 703 of file gpu_shader.cc.
References GPU_shader_get_uniform(), and GPU_shader_uniform_float_ex().
Referenced by blender::nodes::node_composite_glare_cc::GlareOperation::apply_streak_filter(), blender::realtime_compositor::blur_pass(), blender::realtime_compositor::BokehKernel::BokehKernel(), blender::nodes::node_composite_defocus_cc::DefocusOperation::compute_defocus_radius_from_depth(), blender::nodes::node_composite_defocus_cc::DefocusOperation::compute_defocus_radius_from_scale(), blender::nodes::node_composite_keying_cc::KeyingOperation::compute_image(), blender::nodes::node_composite_keying_cc::KeyingOperation::compute_matte(), blender::nodes::node_composite_vec_blur_cc::VectorBlurOperation::compute_motion_blur(), blender::nodes::node_composite_keying_cc::KeyingOperation::compute_tweaked_matte(), blender::realtime_compositor::detect_edges(), blender::nodes::node_composite_vec_blur_cc::VectorBlurOperation::dilate_max_velocity(), blender::nodes::node_composite_bilateralblur_cc::BilateralBlurOperation::execute(), blender::nodes::node_composite_boxmask_cc::BoxMaskOperation::execute(), blender::nodes::node_composite_despeckle_cc::DespeckleOperation::execute(), blender::nodes::node_composite_directionalblur_cc::DirectionalBlurOperation::execute(), blender::nodes::node_composite_ellipsemask_cc::EllipseMaskOperation::execute(), blender::nodes::node_composite_map_uv_cc::MapUVOperation::execute(), blender::nodes::node_composite_normalize_cc::NormalizeOperation::execute(), blender::nodes::node_composite_split_cc::SplitOperation::execute(), blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::execute_anisotropic(), blender::nodes::node_composite_dilate_cc::DilateErodeOperation::execute_distance_threshold(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_highlights(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_mix(), blender::nodes::node_composite_tonemap_cc::ToneMapOperation::execute_photoreceptor(), blender::nodes::node_composite_lensdist_cc::LensDistortionOperation::execute_projector_distortion(), blender::nodes::node_composite_lensdist_cc::LensDistortionOperation::execute_screen_distortion(), blender::nodes::node_composite_tonemap_cc::ToneMapOperation::execute_simple(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_simple_star_axis_aligned(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_simple_star_diagonal(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_simple_star_diagonal_pass(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_simple_star_horizontal_pass(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_streaks(), blender::nodes::node_composite_bokehblur_cc::BokehBlurOperation::execute_variable_size(), immUniform1f(), blender::realtime_compositor::KeyingScreen::KeyingScreen(), blender::realtime_compositor::maximum_float_in_range(), blender::realtime_compositor::minimum_float_in_range(), blender::realtime_compositor::sum_blue_squared_difference(), blender::realtime_compositor::sum_green_squared_difference(), blender::realtime_compositor::sum_luminance_squared_difference(), blender::realtime_compositor::sum_red_squared_difference(), and blender::gpu::tests::Shader::update_push_constants().
Definition at line 746 of file gpu_shader.cc.
References GPU_shader_get_uniform(), GPU_shader_uniform_float_ex(), and len.
Referenced by blender::nodes::node_composite_base_cryptomatte_cc::BaseCryptoMatteOperation::compute_matte().
Sets a generic push constant (a.k.a. uniform). length and array_size should match the create info push_constant declaration. These functions need to have the shader bound in order to work. (TODO: until we use glProgramUniform)
Definition at line 674 of file gpu_shader.cc.
References GPU_shader_get_uniform(), and GPU_shader_uniform_int_ex().
Referenced by blender::draw::command::DrawMultiBuf::bind(), blender::realtime_compositor::calculate_blending_weights(), blender::nodes::node_composite_inpaint_cc::InpaintOperation::compute_inpainting_region(), blender::nodes::node_composite_base_cryptomatte_cc::BaseCryptoMatteOperation::compute_matte(), blender::nodes::node_composite_vec_blur_cc::VectorBlurOperation::compute_motion_blur(), blender::nodes::node_composite_planetrackdeform_cc::PlaneTrackDeformOperation::compute_plane(), blender::nodes::node_composite_planetrackdeform_cc::PlaneTrackDeformOperation::compute_plane_mask(), blender::nodes::node_composite_keying_cc::KeyingOperation::compute_tweaked_matte(), blender::draw::View::compute_visibility(), blender::render::hydra::DrawTexture::draw(), blender::draw::Manager::end_sync(), blender::nodes::node_composite_bilateralblur_cc::BilateralBlurOperation::execute(), blender::nodes::node_composite_defocus_cc::DefocusOperation::execute(), blender::nodes::node_composite_directionalblur_cc::DirectionalBlurOperation::execute(), blender::nodes::node_composite_id_mask_cc::IDMaskOperation::execute(), blender::nodes::node_composite_pixelate_cc::PixelateOperation::execute(), blender::nodes::node_composite_sunbeams_cc::SunBeamsOperation::execute(), blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::execute_classic(), blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::execute_classic_summed_area_table(), blender::nodes::node_composite_bokehblur_cc::BokehBlurOperation::execute_constant_size(), blender::nodes::node_composite_dilate_cc::DilateErodeOperation::execute_distance_threshold(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_simple_star_axis_aligned(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_simple_star_diagonal(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_simple_star_diagonal_pass(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_simple_star_horizontal_pass(), blender::nodes::node_composite_dilate_cc::DilateErodeOperation::execute_step_horizontal_pass(), blender::nodes::node_composite_dilate_cc::DilateErodeOperation::execute_step_vertical_pass(), blender::nodes::node_composite_bokehblur_cc::BokehBlurOperation::execute_variable_size(), blender::nodes::node_composite_inpaint_cc::InpaintOperation::fill_inpainting_region(), GPU_batch_bind_as_resources(), GPU_indexbuf_build_curves_on_device(), GPU_shader_get_builtin_shader_with_config(), GPU_shader_uniform_1b(), immUniform1i(), blender::realtime_compositor::jump_flooding_pass(), blender::realtime_compositor::KeyingScreen::KeyingScreen(), blender::realtime_compositor::morphological_distance(), and pygpu_shader_uniform_sampler().
Definition at line 685 of file gpu_shader.cc.
References GPU_shader_uniform_2fv(), and x.
Referenced by immUniform2f().
Definition at line 709 of file gpu_shader.cc.
References GPU_shader_get_uniform(), and GPU_shader_uniform_float_ex().
Referenced by blender::nodes::node_composite_glare_cc::GlareOperation::apply_streak_filter(), blender::realtime_compositor::blur_pass(), blender::nodes::node_composite_boxmask_cc::BoxMaskOperation::execute(), blender::nodes::node_composite_directionalblur_cc::DirectionalBlurOperation::execute(), blender::nodes::node_composite_ellipsemask_cc::EllipseMaskOperation::execute(), blender::nodes::node_composite_sunbeams_cc::SunBeamsOperation::execute(), GPU_shader_uniform_2f(), immUniform2fv(), and blender::gpu::tests::Shader::update_push_constants().
| void GPU_shader_uniform_2fv_array | ( | GPUShader * | sh, |
| const char * | name, | ||
| int | len, | ||
| const float(*) | val[2] ) |
Definition at line 752 of file gpu_shader.cc.
References GPU_shader_get_uniform(), GPU_shader_uniform_float_ex(), and len.
Definition at line 727 of file gpu_shader.cc.
References GPU_shader_get_uniform(), and GPU_shader_uniform_int_ex().
Referenced by bind_attribute_as_ssbo(), blender::nodes::node_composite_movieclip_cc::MovieClipOperation::compute_alpha(), blender::nodes::node_composite_movieclip_cc::MovieClipOperation::compute_image(), blender::nodes::node_composite_base_cryptomatte_cc::BaseCryptoMatteOperation::compute_matte(), blender::nodes::node_composite_base_cryptomatte_cc::BaseCryptoMatteOperation::compute_pick(), blender::nodes::node_composite_boxmask_cc::BoxMaskOperation::execute(), blender::nodes::node_composite_ellipsemask_cc::EllipseMaskOperation::execute(), blender::nodes::node_composite_crop_cc::CropOperation::execute_alpha_crop(), blender::nodes::node_composite_composite_cc::CompositeOperation::execute_copy_gpu(), blender::nodes::node_composite_viewer_cc::ViewerOperation::execute_copy_gpu(), blender::nodes::node_composite_composite_cc::CompositeOperation::execute_ignore_alpha_gpu(), blender::nodes::node_composite_viewer_cc::ViewerOperation::execute_ignore_alpha_gpu(), blender::nodes::node_composite_crop_cc::CropOperation::execute_image_crop(), blender::nodes::node_composite_render_layer_cc::RenderLayerOperation::execute_pass(), blender::nodes::node_composite_composite_cc::CompositeOperation::execute_set_alpha_gpu(), and blender::nodes::node_composite_viewer_cc::ViewerOperation::execute_set_alpha_gpu().
Definition at line 691 of file gpu_shader.cc.
References GPU_shader_uniform_3fv(), x, y, and z().
Referenced by immUniform3f().
Definition at line 715 of file gpu_shader.cc.
References GPU_shader_get_uniform(), and GPU_shader_uniform_float_ex().
Referenced by blender::nodes::node_composite_glare_cc::GlareOperation::apply_streak_filter(), blender::nodes::node_composite_tonemap_cc::ToneMapOperation::execute_photoreceptor(), blender::nodes::node_composite_lensdist_cc::LensDistortionOperation::execute_screen_distortion(), GPU_shader_uniform_3f(), immUniform3fv(), blender::realtime_compositor::maximum_luminance(), blender::realtime_compositor::minimum_luminance(), blender::realtime_compositor::set_shader_luminance_coefficients(), blender::realtime_compositor::sum_log_luminance(), blender::realtime_compositor::sum_luminance(), blender::realtime_compositor::sum_luminance_squared_difference(), and blender::gpu::tests::Shader::update_push_constants().
| void GPU_shader_uniform_4f | ( | GPUShader * | sh, |
| const char * | name, | ||
| float | x, | ||
| float | y, | ||
| float | z, | ||
| float | w ) |
Definition at line 697 of file gpu_shader.cc.
References GPU_shader_uniform_4fv(), w(), x, y, and z().
Referenced by button2d_draw_intern(), and immUniform4f().
Definition at line 721 of file gpu_shader.cc.
References GPU_shader_get_uniform(), and GPU_shader_uniform_float_ex().
Referenced by blender::realtime_compositor::blur_pass(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_ghost(), blender::nodes::node_composite_tonemap_cc::ToneMapOperation::execute_photoreceptor(), GPU_shader_uniform_4f(), immUniform4fv(), and blender::gpu::tests::Shader::update_push_constants().
| void GPU_shader_uniform_4fv_array | ( | GPUShader * | sh, |
| const char * | name, | ||
| int | len, | ||
| const float(*) | val[4] ) |
Definition at line 758 of file gpu_shader.cc.
References GPU_shader_get_uniform(), GPU_shader_uniform_float_ex(), and len.
Referenced by blender::nodes::node_composite_glare_cc::GlareOperation::execute_ghost(), and immUniformArray4fv().
| void GPU_shader_uniform_float_ex | ( | GPUShader * | shader, |
| int | location, | ||
| int | length, | ||
| int | array_size, | ||
| const float * | value ) |
Sets a generic push constant (a.k.a. uniform). length and array_size should match the create info push_constant declaration.
Definition at line 662 of file gpu_shader.cc.
References len, and blender::gpu::unwrap().
Referenced by BlenderFallbackDisplayShader::bind(), draw_filled_lasso(), draw_legacy_matrix_update(), draw_update_uniforms(), ED_mask_draw_region(), blender::draw::command::PushConstant::execute(), GPU_matrix_bind(), GPU_shader_uniform_1f(), GPU_shader_uniform_1f_array(), 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(), immUniformColor4f(), pygpu_shader_uniform_float(), pygpu_shader_uniform_vector_float(), and wm_draw_region_blend().
| void GPU_shader_uniform_int_ex | ( | GPUShader * | shader, |
| int | location, | ||
| int | length, | ||
| int | array_size, | ||
| const int * | value ) |
Definition at line 668 of file gpu_shader.cc.
References len, and blender::gpu::unwrap().
Referenced by blender::gpu::MTLBatch::bind(), BlenderFallbackDisplayShader::bind(), draw_call_resource_bind(), draw_geometry_execute(), draw_update_uniforms(), blender::gpu::MTLImmediate::end(), blender::draw::command::PushConstant::execute(), GPU_shader_uniform_1i(), GPU_shader_uniform_2iv(), pygpu_shader_uniform_bool(), pygpu_shader_uniform_int(), pygpu_shader_uniform_vector_int(), and blender::gpu::Shader::set_srgb_uniform().
Definition at line 739 of file gpu_shader.cc.
References copy_m4_m3(), and GPU_shader_uniform_mat4().
Referenced by blender::nodes::node_composite_cornerpin_cc::CornerPinOperation::compute_plane(), blender::nodes::node_composite_cornerpin_cc::CornerPinOperation::compute_plane_mask(), blender::nodes::node_composite_filter_cc::FilterOperation::execute(), and blender::realtime_compositor::realize_on_domain().
Definition at line 733 of file gpu_shader.cc.
References GPU_shader_get_uniform(), and GPU_shader_uniform_float_ex().
Referenced by GPU_shader_uniform_mat3_as_mat4(), and immUniformMatrix4fv().
| bool GPU_shader_uses_ssbo_vertex_fetch | ( | GPUShader * | shader | ) |
Definition at line 651 of file gpu_shader.cc.
References blender::gpu::unwrap().
Referenced by blender::draw::detail::PassBase< DrawCommandBufType >::draw(), and blender::draw::detail::PassBase< DrawCommandBufType >::draw_expand().
Shader cache warming. For each shader, rendering APIs perform a two-step compilation:
gpu::Shader::finalize().Shader Cache warming uses the specified parent shader set using GPU_shader_set_parent(..) as a template reference for pre-compiling Render Pipeline State Objects (PSOs) outside of the main render pipeline.
PSOs require descriptors containing information on the render state for a given shader, which includes input vertex data layout and output pixel formats, along with some state such as blend mode and color output masks. As this state information is usually consistent between similar draws, we can assign a parent shader and use this shader's cached pipeline state's to prime compilations.
Shaders do not necessarily have to be similar in functionality to be used as a parent, so long as the #GPUVertFormt and #GPUFrameBuffer which they are used with remain the same. Other bindings such as textures, uniforms and UBOs are all assigned independently as dynamic state.
This function should be called asynchronously, mitigating the impact of run-time stuttering from dynamic compilation of PSOs during normal rendering.
| shader: The shader whose cache to warm. | |
| limit | The maximum number of PSOs to compile within a call. Specifying a limit <= 0 will compile a PSO for all cached PSOs in the parent shader. |
Definition at line 452 of file gpu_shader.cc.
References blender::gpu::unwrap().
Referenced by gpu_material_finalize(), and GPU_material_optimize().