|
Blender V5.0
|
#include <mutex>#include <optional>#include "BLI_span.hh"#include "BLI_string_ref.hh"#include "BLI_vector.hh"#include "GPU_common_types.hh"#include "GPU_shader_builtin.hh"#include "BLI_utility_mixins.hh"#include <atomic>Go to the source code of this file.
Classes | |
| struct | ShaderSpecialization |
| class | blender::gpu::StaticShader |
| class | blender::gpu::StaticShaderCache< T > |
Namespaces | |
| namespace | blender |
| namespace | blender::gpu |
Macros | |
| #define | GPU_SHADER_FREE_SAFE(shader) |
Variables | |
| static constexpr int | GPU_MAX_ATTR = 15 |
| static constexpr int | GPU_MAX_UNIFORM_ATTR = 8 |
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 |
| const blender::gpu::shader::SpecializationConstants & | GPU_shader_get_default_constant_state (blender::gpu::Shader *sh) |
| SpecializationBatchHandle | GPU_shader_batch_specializations (blender::Span< ShaderSpecialization > specializations, CompilationPriority priority=CompilationPriority::High) |
| bool | GPU_shader_batch_specializations_is_ready (SpecializationBatchHandle &handle) |
| void | GPU_shader_batch_specializations_cancel (SpecializationBatchHandle &handle) |
A blender::gpu::Shader is a container for backend specific shader program.
Definition in file GPU_shader.hh.
| #define GPU_NUM_UNIFORMS (GPU_UNIFORM_SCENE_LINEAR_XFORM + 1) |
Definition at line 381 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().
| #define GPU_SHADER_FREE_SAFE | ( | shader | ) |
Definition at line 417 of file GPU_shader.hh.
Referenced by blender::gpu::VKDevice::deinit(), blender::draw::edit_select::Engine::free_static(), blender::draw::test_draw_curves_interpolate_attributes(), blender::draw::test_draw_curves_interpolate_position(), blender::draw::test_draw_curves_lib(), blender::draw::test_draw_curves_topology(), GPUPass::~GPUPass(), and blender::gpu::StaticShader::~StaticShader().
| using BatchHandle = int64_t |
Definition at line 82 of file GPU_shader.hh.
| using SpecializationBatchHandle = int64_t |
Definition at line 269 of file GPU_shader.hh.
|
strong |
| Enumerator | |
|---|---|
| Low | |
| Medium | |
| High | |
Definition at line 80 of file GPU_shader.hh.
DEPRECATED: Use hard-coded buffer location instead.
Definition at line 399 of file GPU_shader.hh.
| enum GPUUniformBuiltin |
Indexed commonly used uniform name for faster lookup into the uniform cache.
Definition at line 357 of file GPU_shader.hh.
| void GPU_shader_batch_cancel | ( | BatchHandle & | handle | ) |
Cancel the compilation of the batch. WARNING: The handle will be invalidated by this call.
Definition at line 222 of file gpu_shader.cc.
References blender::gpu::ShaderCompiler::batch_cancel(), blender::gpu::GPUBackend::get(), and blender::gpu::GPUBackend::get_compiler().
Referenced by GPUPass::~GPUPass(), and blender::gpu::StaticShader::~StaticShader().
| BatchHandle GPU_shader_batch_create_from_infos | ( | blender::Span< const GPUShaderCreateInfo * > | infos, |
| CompilationPriority | priority = CompilationPriority::High ) |
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. WARNING: The GPUShaderCreateInfo pointers should be valid until GPU_shader_batch_finalize has returned.
Definition at line 202 of file gpu_shader.cc.
References blender::gpu::ShaderCompiler::batch_compile(), blender::gpu::GPUBackend::get(), and blender::gpu::GPUBackend::get_compiler().
Referenced by blender::gpu::StaticShader::ensure_compile_async(), gpu_shader_create_info_compile(), GPUPass::GPUPass(), and GPUPass::update_compilation().
| blender::Vector< blender::gpu::Shader * > 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 216 of file gpu_shader.cc.
References blender::gpu::ShaderCompiler::batch_finalize(), blender::gpu::GPUBackend::get(), blender::gpu::GPUBackend::get_compiler(), and result.
Referenced by blender::gpu::StaticShader::ensure_compile_async(), GPUPass::finalize_compilation(), blender::gpu::StaticShader::get(), and gpu_shader_create_info_compile().
| bool GPU_shader_batch_is_compiling | ( | ) |
Returns true if there's any batch still being compiled.
Definition at line 227 of file gpu_shader.cc.
References blender::gpu::GPUBackend::get(), blender::gpu::GPUBackend::get_compiler(), and blender::gpu::ShaderCompiler::is_compiling().
Referenced by bpy_app_is_job_running().
| bool GPU_shader_batch_is_ready | ( | BatchHandle | handle | ) |
Returns true if all the shaders from the batch have finished their compilation.
Definition at line 211 of file gpu_shader.cc.
References blender::gpu::ShaderCompiler::batch_is_ready(), blender::gpu::GPUBackend::get(), and blender::gpu::GPUBackend::get_compiler().
Referenced by blender::gpu::StaticShader::ensure_compile_async(), and GPUPass::update_compilation().
| SpecializationBatchHandle GPU_shader_batch_specializations | ( | blender::Span< ShaderSpecialization > | specializations, |
| CompilationPriority | priority = CompilationPriority::High ) |
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 370 of file gpu_shader.cc.
References blender::gpu::GPUBackend::get(), blender::gpu::GPUBackend::get_compiler(), and blender::gpu::ShaderCompiler::precompile_specializations().
Referenced by blender::eevee::ShaderModule::request_specializations().
| void GPU_shader_batch_specializations_cancel | ( | SpecializationBatchHandle & | handle | ) |
Cancel the specialization batch. WARNING: The handle will be invalidated by this call.
Definition at line 381 of file gpu_shader.cc.
References blender::gpu::ShaderCompiler::batch_cancel(), blender::gpu::GPUBackend::get(), and blender::gpu::GPUBackend::get_compiler().
Referenced by blender::eevee::ShaderModule::~ShaderModule().
| 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 376 of file gpu_shader.cc.
References blender::gpu::GPUBackend::get(), blender::gpu::GPUBackend::get_compiler(), and blender::gpu::ShaderCompiler::specialization_batch_is_ready().
Referenced by blender::eevee::ShaderModule::request_specializations().
| void GPU_shader_batch_wait_for_all | ( | ) |
Wait until all the requested batches have been compiled.
Definition at line 232 of file gpu_shader.cc.
References blender::gpu::GPUBackend::get(), blender::gpu::GPUBackend::get_compiler(), and blender::gpu::ShaderCompiler::wait_for_all().
Referenced by GPU_pass_cache_wait_for_all().
| void GPU_shader_bind | ( | blender::gpu::Shader * | shader, |
| const blender::gpu::shader::SpecializationConstants * | constants_state = nullptr ) |
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 254 of file gpu_shader.cc.
References BLI_assert_msg, 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::Shader::set_scene_linear_to_xyz_uniform(), blender::gpu::Shader::set_srgb_uniform(), blender::gpu::Context::shader, and blender::gpu::Context::shader_builtin_srgb_is_dirty.
Referenced by blender::nodes::node_composite_glare_cc::GlareOperation::accumulate_ghosts_gpu(), blender::nodes::node_composite_glare_cc::GlareOperation::accumulate_streak_gpu(), blender::compositor::apply_morphological_operator_gpu(), blender::nodes::node_composite_glare_cc::GlareOperation::apply_streak_filter_gpu(), BlenderFallbackDisplayShader::bind(), blender::compositor::blend_neighborhood_gpu(), blender::compositor::blur_pass_gpu(), blender::compositor::blur_pass_gpu(), blender::compositor::calculate_blending_weights_gpu(), blender::nodes::node_composite_glare_cc::GlareOperation::compute_base_ghost_gpu(), blender::nodes::node_composite_glare_cc::GlareOperation::compute_bloom_downsample_gpu(), blender::nodes::node_composite_glare_cc::GlareOperation::compute_bloom_upsample_gpu(), blender::nodes::node_composite_double_edge_mask_cc::DoubleEdgeMaskOperation::compute_boundary_gpu(), blender::compositor::compute_complete_blocks(), blender::compositor::compute_complete_x_prologues(), blender::compositor::compute_complete_y_prologues(), blender::nodes::node_composite_defocus_cc::DefocusOperation::compute_defocus_radius_from_depth_gpu(), blender::nodes::node_composite_defocus_cc::DefocusOperation::compute_defocus_radius_from_scale_gpu(), blender::nodes::node_composite_double_edge_mask_cc::DoubleEdgeMaskOperation::compute_gradient_gpu(), blender::nodes::node_composite_base_cryptomatte_cc::BaseCryptoMatteOperation::compute_image_gpu(), blender::nodes::node_composite_keying_cc::KeyingOperation::compute_image_gpu(), blender::compositor::compute_incomplete_prologues(), blender::nodes::node_composite_inpaint_cc::InpaintOperation::compute_inpainting_boundary_gpu(), blender::nodes::node_composite_inpaint_cc::InpaintOperation::compute_inpainting_region_gpu(), blender::nodes::node_composite_zcombine_cc::ZCombineOperation::compute_mask_gpu(), blender::nodes::node_composite_base_cryptomatte_cc::BaseCryptoMatteOperation::compute_matte_gpu(), blender::nodes::node_composite_keying_cc::KeyingOperation::compute_matte_gpu(), 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_gpu(), blender::nodes::node_composite_cornerpin_cc::CornerPinOperation::compute_plane_gpu(), blender::nodes::node_composite_planetrackdeform_cc::PlaneTrackDeformOperation::compute_plane_gpu(), blender::nodes::node_composite_cornerpin_cc::CornerPinOperation::compute_plane_mask_gpu(), blender::nodes::node_composite_planetrackdeform_cc::PlaneTrackDeformOperation::compute_plane_mask_gpu(), blender::compositor::compute_preview_gpu(), blender::draw::View::compute_procedural_bounds(), blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::compute_structure_tensor_gpu(), blender::nodes::node_composite_keying_cc::KeyingOperation::compute_tweaked_matte_gpu(), blender::draw::View::compute_visibility(), blender::compositor::detect_edges_gpu(), blender::nodes::node_composite_vec_blur_cc::VectorBlurOperation::dilate_max_velocity(), draw_filled_lasso(), 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_paint_overlay_flag_buffer(), blender::draw::draw_subdiv_build_sculpt_data_buffer(), blender::draw::draw_subdiv_build_tris_buffer(), blender::draw::draw_subdiv_extract_pos(), blender::draw::draw_subdiv_extract_uvs(), blender::draw::draw_subdiv_interp_corner_normals(), blender::draw::draw_subdiv_interp_custom_data(), blender::gpu::GLImmediate::end(), blender::gpu::MTLImmediate::end(), blender::draw::Manager::end_sync(), blender::compositor::ConversionOperation::execute(), blender::compositor::ShaderOperation::execute(), blender::draw::command::ShaderBind::execute(), blender::nodes::node_composite_crop_cc::CropOperation::execute_alpha_crop_gpu(), blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::execute_anisotropic_gpu(), blender::nodes::node_composite_zcombine_cc::ZCombineOperation::execute_anti_aliased_depth_gpu(), blender::nodes::node_composite_zcombine_cc::ZCombineOperation::execute_anti_aliased_image_gpu(), blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::execute_classic_convolution_gpu(), blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::execute_classic_summed_area_table_gpu(), blender::nodes::node_composite_blur_cc::BlurOperation::execute_constant_size_gpu(), blender::nodes::node_composite_bokehblur_cc::BokehBlurOperation::execute_constant_size_gpu(), blender::nodes::node_composite_group_output_cc::GroupOutputOperation::execute_copy_gpu(), blender::nodes::node_composite_viewer_cc::ViewerOperation::execute_copy_gpu(), blender::nodes::node_composite_dilate_cc::DilateErodeOperation::execute_distance_threshold_gpu(), blender::nodes::node_composite_bilateralblur_cc::BilateralBlurOperation::execute_gpu(), blender::nodes::node_composite_boxmask_cc::BoxMaskOperation::execute_gpu(), blender::nodes::node_composite_defocus_cc::DefocusOperation::execute_gpu(), blender::nodes::node_composite_despeckle_cc::DespeckleOperation::execute_gpu(), blender::nodes::node_composite_directionalblur_cc::DirectionalBlurOperation::execute_gpu(), blender::nodes::node_composite_displace_cc::DisplaceOperation::execute_gpu(), blender::nodes::node_composite_ellipsemask_cc::EllipseMaskOperation::execute_gpu(), blender::nodes::node_composite_filter_cc::FilterOperation::execute_gpu(), blender::nodes::node_composite_flip_cc::FlipOperation::execute_gpu(), blender::nodes::node_composite_id_mask_cc::IDMaskOperation::execute_gpu(), blender::nodes::node_composite_map_uv_cc::MapUVOperation::execute_gpu(), blender::nodes::node_composite_moviedistortion_cc::MovieDistortionOperation::execute_gpu(), blender::nodes::node_composite_normalize_cc::NormalizeOperation::execute_gpu(), blender::nodes::node_composite_pixelate_cc::PixelateOperation::execute_gpu(), blender::nodes::node_composite_split_cc::SplitOperation::execute_gpu(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_highlights_gpu(), blender::nodes::node_composite_lensdist_cc::LensDistortionOperation::execute_horizontal_distortion_gpu(), blender::nodes::node_composite_crop_cc::CropOperation::execute_image_crop_gpu(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_mix_gpu(), blender::nodes::node_composite_group_input_cc::GroupInputOperation::execute_pass_gpu(), blender::nodes::node_composite_render_layer_cc::RenderLayerOperation::execute_pass_gpu(), blender::nodes::node_composite_tonemap_cc::ToneMapOperation::execute_photoreceptor_gpu(), blender::nodes::node_composite_lensdist_cc::LensDistortionOperation::execute_radial_distortion_gpu(), blender::nodes::node_composite_zcombine_cc::ZCombineOperation::execute_simple_depth_gpu(), blender::nodes::node_composite_tonemap_cc::ToneMapOperation::execute_simple_gpu(), blender::nodes::node_composite_zcombine_cc::ZCombineOperation::execute_simple_image_gpu(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_simple_star_anti_diagonal_pass_gpu(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_simple_star_diagonal_pass_gpu(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_simple_star_horizontal_pass_gpu(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_simple_star_vertical_pass_gpu(), blender::nodes::node_composite_dilate_cc::DilateErodeOperation::execute_step_horizontal_pass_gpu(), blender::nodes::node_composite_dilate_cc::DilateErodeOperation::execute_step_vertical_pass_gpu(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_sun_beams_gpu(), blender::nodes::node_composite_blur_cc::BlurOperation::execute_variable_size_gpu(), blender::nodes::node_composite_bokehblur_cc::BokehBlurOperation::execute_variable_size_gpu(), blender::nodes::node_composite_scale_cc::ScaleOperation::execute_variable_size_gpu(), blender::compositor::extract_alpha_gpu(), blender::nodes::node_composite_keying_cc::KeyingOperation::extract_input_chroma_gpu(), blender::nodes::node_composite_inpaint_cc::InpaintOperation::fill_inpainting_region_gpu(), blender::ed::vse::StripsDrawBatch::flush_batch(), blender::ed::vse::ThumbsDrawBatch::flush_batch(), blender::draw::command::DrawMultiBuf::generate_commands(), 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::compositor::horizontal_pass_gpu(), blender::compositor::horizontal_pass_gpu(), blender::compositor::horizontal_pass_gpu(), immBindShader(), blender::gpu::tests::Shader::init_shader(), blender::compositor::jump_flooding_pass_gpu(), blender::compositor::maximum_float2_gpu(), blender::compositor::maximum_float_gpu(), blender::compositor::maximum_float_in_range_gpu(), blender::compositor::maximum_luminance_gpu(), blender::compositor::minimum_float_gpu(), blender::compositor::minimum_float_in_range_gpu(), blender::compositor::minimum_luminance_gpu(), blender::compositor::morphological_distance_gpu(), 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::render::hydra::ViewportEngine::render(), blender::nodes::node_composite_keying_cc::KeyingOperation::replace_input_chroma_gpu(), blender::compositor::sample_pixel_gpu(), blender::ed::vse::sequencer_draw_scopes(), blender::compositor::sum_blue_gpu(), blender::compositor::sum_blue_squared_difference_gpu(), blender::compositor::sum_causal_and_non_causal_results_gpu(), blender::compositor::sum_causal_and_non_causal_results_gpu(), blender::compositor::sum_color_gpu(), blender::compositor::sum_green_gpu(), blender::compositor::sum_green_squared_difference_gpu(), blender::compositor::sum_log_luminance_gpu(), blender::compositor::sum_luminance_gpu(), blender::compositor::sum_luminance_squared_difference_gpu(), blender::compositor::sum_red_gpu(), blender::compositor::sum_red_squared_difference_gpu(), 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::compositor::vertical_pass_gpu(), blender::compositor::vertical_pass_gpu(), blender::compositor::vertical_pass_gpu(), wm_draw_region_blend(), blender::nodes::node_composite_glare_cc::GlareOperation::write_glare_output_gpu(), blender::nodes::node_composite_glare_cc::GlareOperation::write_highlights_output_gpu(), and blender::compositor::zero_pad_gpu().
| void GPU_shader_cache_dir_clear_old | ( | ) |
Definition at line 243 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 237 of file gpu_shader.cc.
References gpu_shader_create_info_compile(), and printf.
Referenced by WM_init_gpu().
| blender::gpu::Shader * 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 160 of file gpu_shader.cc.
References blender::gpu::ShaderCompiler::compile(), blender::gpu::GPUBackend::get(), and blender::gpu::GPUBackend::get_compiler().
Referenced by blender::compositor::CachedShader::CachedShader(), blender::opensubdiv::compile_eval_patches_shader(), blender::opensubdiv::compile_eval_stencil_shader(), blender::ocio::GPUShaderBinder::create_gpu_shader(), GPU_shader_create_from_info_name(), blender::gpu::tests::gpu_shader_lib_test(), GPUPass::GPUPass(), blender::gpu::tests::test_framebuffer_multi_viewport(), and blender::gpu::tests::test_framebuffer_subpass_input().
| blender::gpu::Shader * 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 148 of file gpu_shader.cc.
References ShaderCreateInfo::do_static_compilation_, GPU_shader_create_from_info(), gpu_shader_create_info_get(), and ShaderCreateInfo::name_.
Referenced by compile_fallback_shader(), blender::gpu::StaticShader::get(), blender::draw::edit_select::Instance::init(), blender::gpu::tests::Shader::init_shader(), blender::gpu::tests::ShaderSpecializationConst::init_shader(), blender::eevee::Precompute::Precompute(), blender::gpu::tests::test_buffer_texture(), blender::gpu::tests::test_compute_direct(), blender::gpu::tests::test_compute_indirect(), blender::draw::test_draw_curves_interpolate_attributes(), blender::draw::test_draw_curves_interpolate_position(), blender::draw::test_draw_curves_lib(), blender::draw::test_draw_curves_topology(), 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(), blender::draw::TestDefrag::TestDefrag(), and blender::gpu::VKDevice::vk_backbuffer_blit_sh_get().
| blender::gpu::Shader * GPU_shader_create_from_info_python | ( | const GPUShaderCreateInfo * | _info | ) |
Same as GPU_shader_create_from_info but will run preprocessor on source strings.
Definition at line 176 of file gpu_shader.cc.
References blender::gpu::ShaderCompiler::compile(), ShaderCreateInfo::compute_source_generated, ShaderCreateInfo::fragment_source_generated, ShaderCreateInfo::geometry_source_generated, blender::gpu::GPUBackend::get(), blender::gpu::GPUBackend::get_compiler(), GPU_shader_preprocess_source(), result, and ShaderCreateInfo::vertex_source_generated.
Referenced by pygpu_shader_create_from_info().
| bool GPU_shader_create_info_check_error | ( | const GPUShaderCreateInfo * | _info, |
| char | r_error[128] ) |
Error checking for user created shaders.
Definition at line 135 of file gpu_shader.cc.
References BLI_strncpy(), 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 130 of file gpu_shader.cc.
References gpu_shader_create_info_get().
Referenced by blender::compositor::CachedShader::CachedShader(), blender::gpu::StaticShader::ensure_compile_async(), and blender::eevee::ShaderModule::ShaderModule().
| void GPU_shader_free | ( | blender::gpu::Shader * | shader | ) |
Definition at line 119 of file gpu_shader.cc.
Referenced by blender::gpu::MTLContextTextureUtils::cleanup(), BlenderFallbackDisplayShader::destroy_shader(), gpu_shader_create_info_compile(), 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::compositor::CachedShader::~CachedShader(), blender::ocio::internal::GPUDisplayShader::~GPUDisplayShader(), blender::gpu::tests::Shader::~Shader(), and blender::gpu::tests::ShaderSpecializationConst::~ShaderSpecializationConst().
| int GPU_shader_get_attribute | ( | const blender::gpu::Shader * | shader, |
| const char * | name ) |
Definition at line 452 of file gpu_shader.cc.
References interface, and name.
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 blender::gpu::Shader * | shader, |
| int | attr_location, | ||
| char | r_name[256], | ||
| int * | r_type ) |
Definition at line 459 of file gpu_shader.cc.
References BLI_strncpy(), and interface.
Referenced by GPU_vertformat_from_shader(), and pygpu_shader_attrs_info_get().
| uint GPU_shader_get_attribute_len | ( | const blender::gpu::Shader * | shader | ) |
Definition at line 440 of file gpu_shader.cc.
References interface.
Referenced by GPU_vertformat_from_shader(), and pygpu_shader_attrs_info_get().
| blender::gpu::Shader * GPU_shader_get_bound | ( | ) |
Return the currently bound shader to the active GPU context.
Definition at line 305 of file gpu_shader.cc.
References blender::gpu::Context::get(), and blender::gpu::Context::shader.
Referenced by BlenderDisplaySpaceShader::bind(), and BlenderDisplaySpaceShader::get_shader_program().
| int GPU_shader_get_builtin_uniform | ( | blender::gpu::Shader * | shader, |
| int | builtin ) |
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 406 of file gpu_shader.cc.
References interface.
Referenced by GPU_matrix_bind(), immUniformColor4f(), blender::gpu::Shader::set_scene_linear_to_xyz_uniform(), blender::gpu::Shader::set_srgb_uniform(), and wm_draw_region_blend().
| int GPU_shader_get_constant | ( | blender::gpu::Shader * | shader, |
| const char * | name ) |
Returns specialization constant location.
Definition at line 399 of file gpu_shader.cc.
References interface, and name.
Referenced by blender::eevee::ShaderModule::request_specializations(), blender::gpu::tests::ShaderSpecializationConst::ShaderSpecializationConst(), 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 blender::gpu::shader::SpecializationConstants & GPU_shader_get_default_constant_state | ( | blender::gpu::Shader * | sh | ) |
Definition at line 353 of file gpu_shader.cc.
References blender::gpu::Shader::constants.
Referenced by blender::draw::command::Draw::execute(), blender::draw::command::ShaderBind::execute(), blender::draw::command::SpecializeConstant::execute(), blender::eevee::ShaderModule::request_specializations(), and blender::gpu::tests::ShaderSpecializationConst::ShaderSpecializationConst().
| const char * GPU_shader_get_name | ( | blender::gpu::Shader * | shader | ) |
Definition at line 320 of file gpu_shader.cc.
Referenced by pygpu_shader_name(), and blender::draw::command::ShaderBind::serialize().
| int GPU_shader_get_sampler_binding | ( | blender::gpu::Shader * | shader, |
| const char * | name ) |
Definition at line 433 of file gpu_shader.cc.
References interface, and name.
Referenced by blender::compositor::SMAAPrecomputedTextures::bind_area_texture(), blender::compositor::Result::bind_as_image(), blender::compositor::Result::bind_as_texture(), blender::draw::detail::PassBase< DrawCommandBufType >::bind_image(), blender::draw::detail::PassBase< DrawCommandBufType >::bind_image(), blender::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::draw::detail::PassBase< DrawCommandBufType >::bind_texture(), blender::render::hydra::DrawTexture::draw(), immBindTexture(), immBindTextureSampler(), blender::compositor::parallel_reduction_dispatch(), pygpu_shader_image(), pygpu_shader_uniform_sampler(), blender::ed::vse::sequencer_draw_scopes(), 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::ed::vse::ThumbsDrawBatch::ThumbsDrawBatch(), and wm_draw_region_blend().
| int GPU_shader_get_ssbo_binding | ( | blender::gpu::Shader * | shader, |
| const char * | name ) |
Definition at line 412 of file gpu_shader.cc.
References interface, and name.
Referenced by 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::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(), blender::draw::Manager::end_sync(), blender::draw::command::DrawMultiBuf::generate_commands(), GPU_indexbuf_build_curves_on_device(), pygpu_shader_format_calc(), blender::ed::vse::sequencer_draw_scopes(), 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().
| bool GPU_shader_get_ssbo_input_info | ( | const blender::gpu::Shader * | shader, |
| int | ssbo_location, | ||
| char | r_name[256] ) |
Definition at line 476 of file gpu_shader.cc.
References BLI_strncpy(), and interface.
Referenced by pygpu_shader_attrs_info_get().
| uint GPU_shader_get_ssbo_input_len | ( | const blender::gpu::Shader * | shader | ) |
Definition at line 446 of file gpu_shader.cc.
References interface.
Referenced by pygpu_shader_attrs_info_get().
| int GPU_shader_get_ubo_binding | ( | blender::gpu::Shader * | shader, |
| const char * | name ) |
Returns binding point location. Binding location are given to be set at shader compile time and immutable.
Definition at line 426 of file gpu_shader.cc.
References interface, and name.
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_gpu(), blender::nodes::node_composite_planetrackdeform_cc::PlaneTrackDeformOperation::compute_plane_mask_gpu(), immBindUniformBuf(), pygpu_shader_uniform_block(), blender::ed::vse::StripsDrawBatch::StripsDrawBatch(), and blender::ed::vse::ThumbsDrawBatch::ThumbsDrawBatch().
| int GPU_shader_get_uniform | ( | blender::gpu::Shader * | shader, |
| const char * | name ) |
Returns uniform location. If cached, it is faster than querying the interface for each uniform assignment.
Definition at line 392 of file gpu_shader.cc.
References interface, and name.
Referenced by BlenderFallbackDisplayShader::create_shader_if_needed(), draw_filled_lasso(), 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_3iv(), 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().
| int GPU_shader_get_uniform_block | ( | blender::gpu::Shader * | shader, |
| const char * | name ) |
DEPRECATED: Kept only because of Python GPU API.
Definition at line 419 of file gpu_shader.cc.
References interface, and name.
Referenced by pygpu_shader_uniform_block_from_name().
| std::string GPU_shader_preprocess_source | ( | blender::StringRefNull | original | ) |
Preprocess a raw GLSL source to adhere to our backend compatible shader language. Needed if the string was not part of our build system and is used in a #GPUShaderCreateInfo.
Definition at line 167 of file gpu_shader.cc.
References blender::StringRefBase::is_empty(), and blender::gpu::shader::Preprocessor::process().
Referenced by GPU_shader_create_from_info_python().
| void GPU_shader_set_parent | ( | blender::gpu::Shader * | shader, |
| blender::gpu::Shader * | parent ) |
Definition at line 331 of file gpu_shader.cc.
References BLI_assert, and blender::gpu::Shader::parent_set().
| void GPU_shader_unbind | ( | ) |
Unbind the active shader.
Definition at line 291 of file gpu_shader.cc.
References blender::gpu::Context::get(), blender::gpu::Context::shader, and blender::gpu::Shader::unbind().
Referenced by blender::nodes::node_composite_glare_cc::GlareOperation::accumulate_ghosts_gpu(), blender::nodes::node_composite_glare_cc::GlareOperation::accumulate_streak_gpu(), blender::compositor::apply_morphological_operator_gpu(), blender::nodes::node_composite_glare_cc::GlareOperation::apply_streak_filter_gpu(), blender::compositor::blend_neighborhood_gpu(), blender::compositor::blur_pass_gpu(), blender::compositor::blur_pass_gpu(), blender::compositor::calculate_blending_weights_gpu(), blender::nodes::node_composite_glare_cc::GlareOperation::compute_base_ghost_gpu(), blender::nodes::node_composite_glare_cc::GlareOperation::compute_bloom_downsample_gpu(), blender::nodes::node_composite_glare_cc::GlareOperation::compute_bloom_upsample_gpu(), blender::nodes::node_composite_double_edge_mask_cc::DoubleEdgeMaskOperation::compute_boundary_gpu(), blender::compositor::compute_complete_blocks(), blender::compositor::compute_complete_x_prologues(), blender::compositor::compute_complete_y_prologues(), blender::nodes::node_composite_defocus_cc::DefocusOperation::compute_defocus_radius_from_depth_gpu(), blender::nodes::node_composite_defocus_cc::DefocusOperation::compute_defocus_radius_from_scale_gpu(), blender::nodes::node_composite_double_edge_mask_cc::DoubleEdgeMaskOperation::compute_gradient_gpu(), blender::nodes::node_composite_base_cryptomatte_cc::BaseCryptoMatteOperation::compute_image_gpu(), blender::nodes::node_composite_keying_cc::KeyingOperation::compute_image_gpu(), blender::compositor::compute_incomplete_prologues(), blender::nodes::node_composite_inpaint_cc::InpaintOperation::compute_inpainting_boundary_gpu(), blender::nodes::node_composite_inpaint_cc::InpaintOperation::compute_inpainting_region_gpu(), blender::nodes::node_composite_zcombine_cc::ZCombineOperation::compute_mask_gpu(), blender::nodes::node_composite_base_cryptomatte_cc::BaseCryptoMatteOperation::compute_matte_gpu(), blender::nodes::node_composite_keying_cc::KeyingOperation::compute_matte_gpu(), 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_gpu(), blender::nodes::node_composite_cornerpin_cc::CornerPinOperation::compute_plane_gpu(), blender::nodes::node_composite_planetrackdeform_cc::PlaneTrackDeformOperation::compute_plane_gpu(), blender::nodes::node_composite_cornerpin_cc::CornerPinOperation::compute_plane_mask_gpu(), blender::nodes::node_composite_planetrackdeform_cc::PlaneTrackDeformOperation::compute_plane_mask_gpu(), blender::compositor::compute_preview_gpu(), blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::compute_structure_tensor_gpu(), blender::nodes::node_composite_keying_cc::KeyingOperation::compute_tweaked_matte_gpu(), blender::compositor::detect_edges_gpu(), blender::nodes::node_composite_vec_blur_cc::VectorBlurOperation::dilate_max_velocity(), draw_filled_lasso(), 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_paint_overlay_flag_buffer(), blender::draw::draw_subdiv_build_sculpt_data_buffer(), blender::draw::draw_subdiv_build_tris_buffer(), blender::draw::draw_subdiv_extract_pos(), blender::draw::draw_subdiv_extract_uvs(), blender::draw::draw_subdiv_interp_corner_normals(), blender::draw::draw_subdiv_interp_custom_data(), DRW_shaders_free(), blender::compositor::ConversionOperation::execute(), blender::compositor::ShaderOperation::execute(), blender::nodes::node_composite_crop_cc::CropOperation::execute_alpha_crop_gpu(), blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::execute_anisotropic_gpu(), blender::nodes::node_composite_zcombine_cc::ZCombineOperation::execute_anti_aliased_depth_gpu(), blender::nodes::node_composite_zcombine_cc::ZCombineOperation::execute_anti_aliased_image_gpu(), blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::execute_classic_convolution_gpu(), blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::execute_classic_summed_area_table_gpu(), blender::nodes::node_composite_blur_cc::BlurOperation::execute_constant_size_gpu(), blender::nodes::node_composite_bokehblur_cc::BokehBlurOperation::execute_constant_size_gpu(), blender::nodes::node_composite_group_output_cc::GroupOutputOperation::execute_copy_gpu(), blender::nodes::node_composite_viewer_cc::ViewerOperation::execute_copy_gpu(), blender::nodes::node_composite_dilate_cc::DilateErodeOperation::execute_distance_threshold_gpu(), blender::nodes::node_composite_bilateralblur_cc::BilateralBlurOperation::execute_gpu(), blender::nodes::node_composite_boxmask_cc::BoxMaskOperation::execute_gpu(), blender::nodes::node_composite_defocus_cc::DefocusOperation::execute_gpu(), blender::nodes::node_composite_despeckle_cc::DespeckleOperation::execute_gpu(), blender::nodes::node_composite_directionalblur_cc::DirectionalBlurOperation::execute_gpu(), blender::nodes::node_composite_displace_cc::DisplaceOperation::execute_gpu(), blender::nodes::node_composite_ellipsemask_cc::EllipseMaskOperation::execute_gpu(), blender::nodes::node_composite_filter_cc::FilterOperation::execute_gpu(), blender::nodes::node_composite_flip_cc::FlipOperation::execute_gpu(), blender::nodes::node_composite_id_mask_cc::IDMaskOperation::execute_gpu(), blender::nodes::node_composite_map_uv_cc::MapUVOperation::execute_gpu(), blender::nodes::node_composite_moviedistortion_cc::MovieDistortionOperation::execute_gpu(), blender::nodes::node_composite_normalize_cc::NormalizeOperation::execute_gpu(), blender::nodes::node_composite_pixelate_cc::PixelateOperation::execute_gpu(), blender::nodes::node_composite_split_cc::SplitOperation::execute_gpu(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_highlights_gpu(), blender::nodes::node_composite_lensdist_cc::LensDistortionOperation::execute_horizontal_distortion_gpu(), blender::nodes::node_composite_crop_cc::CropOperation::execute_image_crop_gpu(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_mix_gpu(), blender::nodes::node_composite_group_input_cc::GroupInputOperation::execute_pass_gpu(), blender::nodes::node_composite_render_layer_cc::RenderLayerOperation::execute_pass_gpu(), blender::nodes::node_composite_tonemap_cc::ToneMapOperation::execute_photoreceptor_gpu(), blender::nodes::node_composite_lensdist_cc::LensDistortionOperation::execute_radial_distortion_gpu(), blender::nodes::node_composite_zcombine_cc::ZCombineOperation::execute_simple_depth_gpu(), blender::nodes::node_composite_tonemap_cc::ToneMapOperation::execute_simple_gpu(), blender::nodes::node_composite_zcombine_cc::ZCombineOperation::execute_simple_image_gpu(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_simple_star_anti_diagonal_pass_gpu(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_simple_star_diagonal_pass_gpu(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_simple_star_horizontal_pass_gpu(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_simple_star_vertical_pass_gpu(), blender::nodes::node_composite_dilate_cc::DilateErodeOperation::execute_step_horizontal_pass_gpu(), blender::nodes::node_composite_dilate_cc::DilateErodeOperation::execute_step_vertical_pass_gpu(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_sun_beams_gpu(), blender::nodes::node_composite_blur_cc::BlurOperation::execute_variable_size_gpu(), blender::nodes::node_composite_bokehblur_cc::BokehBlurOperation::execute_variable_size_gpu(), blender::nodes::node_composite_scale_cc::ScaleOperation::execute_variable_size_gpu(), blender::compositor::extract_alpha_gpu(), blender::nodes::node_composite_keying_cc::KeyingOperation::extract_input_chroma_gpu(), blender::nodes::node_composite_inpaint_cc::InpaintOperation::fill_inpainting_region_gpu(), GPU_context_active_set(), GPU_indexbuf_build_curves_on_device(), GPU_shader_free_builtin_shaders(), blender::gpu::tests::gpu_shader_lib_test(), blender::compositor::horizontal_pass_gpu(), blender::compositor::horizontal_pass_gpu(), blender::compositor::horizontal_pass_gpu(), immUnbindProgram(), blender::compositor::jump_flooding_pass_gpu(), blender::compositor::maximum_float2_gpu(), blender::compositor::maximum_float_gpu(), blender::compositor::maximum_float_in_range_gpu(), blender::compositor::maximum_luminance_gpu(), blender::compositor::minimum_float_gpu(), blender::compositor::minimum_float_in_range_gpu(), blender::compositor::minimum_luminance_gpu(), blender::compositor::morphological_distance_gpu(), blender::eevee::Precompute::Precompute(), pygpu_batch_program_use_end(), pygpu_shader_unbind(), blender::render::hydra::ViewportEngine::render(), blender::nodes::node_composite_keying_cc::KeyingOperation::replace_input_chroma_gpu(), blender::compositor::sample_pixel_gpu(), blender::ed::vse::sequencer_draw_scopes(), blender::compositor::sum_blue_gpu(), blender::compositor::sum_blue_squared_difference_gpu(), blender::compositor::sum_causal_and_non_causal_results_gpu(), blender::compositor::sum_causal_and_non_causal_results_gpu(), blender::compositor::sum_color_gpu(), blender::compositor::sum_green_gpu(), blender::compositor::sum_green_squared_difference_gpu(), blender::compositor::sum_log_luminance_gpu(), blender::compositor::sum_luminance_gpu(), blender::compositor::sum_luminance_squared_difference_gpu(), blender::compositor::sum_red_gpu(), blender::compositor::sum_red_squared_difference_gpu(), blender::gpu::tests::test_buffer_texture(), blender::gpu::tests::test_compute_direct(), blender::gpu::tests::test_compute_indirect(), blender::draw::test_draw_curves_interpolate_attributes(), blender::draw::test_draw_curves_interpolate_position(), blender::draw::test_draw_curves_lib(), blender::draw::test_draw_curves_topology(), 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::draw::TestAlloc::TestAlloc(), blender::draw::TestDefrag::TestDefrag(), BlenderFallbackDisplayShader::unbind(), blender::compositor::vertical_pass_gpu(), blender::compositor::vertical_pass_gpu(), blender::compositor::vertical_pass_gpu(), blender::nodes::node_composite_glare_cc::GlareOperation::write_glare_output_gpu(), blender::nodes::node_composite_glare_cc::GlareOperation::write_highlights_output_gpu(), blender::compositor::zero_pad_gpu(), blender::gpu::tests::Shader::~Shader(), and blender::gpu::tests::ShaderSpecializationConst::~ShaderSpecializationConst().
| void GPU_shader_uniform_1b | ( | blender::gpu::Shader * | sh, |
| const char * | name, | ||
| bool | value ) |
Definition at line 515 of file gpu_shader.cc.
References GPU_shader_uniform_1i(), and name.
Referenced by blender::nodes::node_composite_double_edge_mask_cc::DoubleEdgeMaskOperation::compute_boundary_gpu(), blender::nodes::node_composite_vec_blur_cc::VectorBlurOperation::compute_max_tile_velocity(), blender::nodes::node_composite_cornerpin_cc::CornerPinOperation::compute_plane_mask_gpu(), blender::nodes::node_composite_zcombine_cc::ZCombineOperation::execute_anti_aliased_image_gpu(), blender::nodes::node_composite_flip_cc::FlipOperation::execute_gpu(), blender::nodes::node_composite_zcombine_cc::ZCombineOperation::execute_simple_image_gpu(), blender::draw::command::DrawMultiBuf::generate_commands(), GPU_batch_bind_as_resources(), blender::compositor::horizontal_pass_gpu(), blender::compositor::parallel_reduction_dispatch(), blender::gpu::Immediate::polyline_draw_workaround(), polyline_draw_workaround(), blender::ed::vse::sequencer_draw_scopes(), and blender::compositor::vertical_pass_gpu().
| void GPU_shader_uniform_1f | ( | blender::gpu::Shader * | sh, |
| const char * | name, | ||
| float | value ) |
Definition at line 539 of file gpu_shader.cc.
References GPU_shader_get_uniform(), GPU_shader_uniform_float_ex(), and name.
Referenced by blender::nodes::node_composite_glare_cc::GlareOperation::accumulate_streak_gpu(), blender::nodes::node_composite_glare_cc::GlareOperation::apply_streak_filter_gpu(), blender::compositor::blur_pass_gpu(), blender::compositor::blur_pass_gpu(), blender::nodes::node_composite_defocus_cc::DefocusOperation::compute_defocus_radius_from_depth_gpu(), blender::nodes::node_composite_defocus_cc::DefocusOperation::compute_defocus_radius_from_scale_gpu(), blender::nodes::node_composite_keying_cc::KeyingOperation::compute_image_gpu(), blender::nodes::node_composite_keying_cc::KeyingOperation::compute_matte_gpu(), blender::nodes::node_composite_vec_blur_cc::VectorBlurOperation::compute_motion_blur(), blender::nodes::node_composite_keying_cc::KeyingOperation::compute_tweaked_matte_gpu(), blender::compositor::detect_edges_gpu(), blender::nodes::node_composite_vec_blur_cc::VectorBlurOperation::dilate_max_velocity(), blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::execute_anisotropic_gpu(), blender::nodes::node_composite_dilate_cc::DilateErodeOperation::execute_distance_threshold_gpu(), blender::nodes::node_composite_bilateralblur_cc::BilateralBlurOperation::execute_gpu(), blender::nodes::node_composite_boxmask_cc::BoxMaskOperation::execute_gpu(), blender::nodes::node_composite_despeckle_cc::DespeckleOperation::execute_gpu(), blender::nodes::node_composite_directionalblur_cc::DirectionalBlurOperation::execute_gpu(), blender::nodes::node_composite_ellipsemask_cc::EllipseMaskOperation::execute_gpu(), blender::nodes::node_composite_normalize_cc::NormalizeOperation::execute_gpu(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_highlights_gpu(), blender::nodes::node_composite_lensdist_cc::LensDistortionOperation::execute_horizontal_distortion_gpu(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_mix_gpu(), blender::nodes::node_composite_tonemap_cc::ToneMapOperation::execute_photoreceptor_gpu(), blender::nodes::node_composite_lensdist_cc::LensDistortionOperation::execute_radial_distortion_gpu(), blender::nodes::node_composite_tonemap_cc::ToneMapOperation::execute_simple_gpu(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_simple_star_anti_diagonal_pass_gpu(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_simple_star_diagonal_pass_gpu(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_simple_star_horizontal_pass_gpu(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_simple_star_vertical_pass_gpu(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_sun_beams_gpu(), immUniform1f(), blender::compositor::maximum_float_in_range_gpu(), blender::compositor::minimum_float_in_range_gpu(), blender::ed::vse::sequencer_draw_scopes(), blender::compositor::sum_blue_squared_difference_gpu(), blender::compositor::sum_green_squared_difference_gpu(), blender::compositor::sum_luminance_squared_difference_gpu(), blender::compositor::sum_red_squared_difference_gpu(), blender::gpu::VKContext::update_pipeline_data(), blender::gpu::tests::Shader::update_push_constants(), and blender::nodes::node_composite_glare_cc::GlareOperation::write_glare_output_gpu().
| void GPU_shader_uniform_1f_array | ( | blender::gpu::Shader * | sh, |
| const char * | name, | ||
| int | len, | ||
| const float * | val ) |
Definition at line 590 of file gpu_shader.cc.
References GPU_shader_get_uniform(), GPU_shader_uniform_float_ex(), len, and name.
Referenced by blender::nodes::node_composite_base_cryptomatte_cc::BaseCryptoMatteOperation::compute_matte_gpu().
| void GPU_shader_uniform_1i | ( | blender::gpu::Shader * | sh, |
| const char * | name, | ||
| int | value ) |
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 509 of file gpu_shader.cc.
References GPU_shader_get_uniform(), GPU_shader_uniform_int_ex(), and name.
Referenced by bind_attribute_as_ssbo(), blender::compositor::calculate_blending_weights_gpu(), blender::nodes::node_composite_inpaint_cc::InpaintOperation::compute_inpainting_region_gpu(), blender::nodes::node_composite_base_cryptomatte_cc::BaseCryptoMatteOperation::compute_matte_gpu(), blender::nodes::node_composite_vec_blur_cc::VectorBlurOperation::compute_motion_blur(), blender::nodes::node_composite_planetrackdeform_cc::PlaneTrackDeformOperation::compute_plane_gpu(), blender::nodes::node_composite_planetrackdeform_cc::PlaneTrackDeformOperation::compute_plane_mask_gpu(), blender::nodes::node_composite_keying_cc::KeyingOperation::compute_tweaked_matte_gpu(), blender::draw::View::compute_visibility(), blender::render::hydra::DrawTexture::draw(), blender::draw::Manager::end_sync(), blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::execute_classic_convolution_gpu(), blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::execute_classic_summed_area_table_gpu(), blender::nodes::node_composite_bokehblur_cc::BokehBlurOperation::execute_constant_size_gpu(), blender::nodes::node_composite_dilate_cc::DilateErodeOperation::execute_distance_threshold_gpu(), blender::nodes::node_composite_bilateralblur_cc::BilateralBlurOperation::execute_gpu(), blender::nodes::node_composite_defocus_cc::DefocusOperation::execute_gpu(), blender::nodes::node_composite_directionalblur_cc::DirectionalBlurOperation::execute_gpu(), blender::nodes::node_composite_id_mask_cc::IDMaskOperation::execute_gpu(), blender::nodes::node_composite_pixelate_cc::PixelateOperation::execute_gpu(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_highlights_gpu(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_simple_star_anti_diagonal_pass_gpu(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_simple_star_diagonal_pass_gpu(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_simple_star_horizontal_pass_gpu(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_simple_star_vertical_pass_gpu(), blender::nodes::node_composite_dilate_cc::DilateErodeOperation::execute_step_horizontal_pass_gpu(), blender::nodes::node_composite_dilate_cc::DilateErodeOperation::execute_step_vertical_pass_gpu(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_sun_beams_gpu(), blender::nodes::node_composite_bokehblur_cc::BokehBlurOperation::execute_variable_size_gpu(), blender::nodes::node_composite_inpaint_cc::InpaintOperation::fill_inpainting_region_gpu(), blender::draw::command::DrawMultiBuf::generate_commands(), GPU_batch_bind_as_resources(), GPU_indexbuf_build_curves_on_device(), GPU_shader_get_builtin_shader_with_config(), GPU_shader_uniform_1b(), immUniform1i(), blender::compositor::jump_flooding_pass_gpu(), blender::compositor::morphological_distance_gpu(), blender::gpu::Immediate::polyline_draw_workaround(), pygpu_shader_uniform_sampler(), and blender::ed::vse::sequencer_draw_scopes().
| void GPU_shader_uniform_2f | ( | blender::gpu::Shader * | sh, |
| const char * | name, | ||
| float | x, | ||
| float | y ) |
Definition at line 520 of file gpu_shader.cc.
References data, GPU_shader_uniform_2fv(), name, x, and y.
Referenced by immUniform2f().
| void GPU_shader_uniform_2fv | ( | blender::gpu::Shader * | sh, |
| const char * | name, | ||
| const float | data[2] ) |
Definition at line 545 of file gpu_shader.cc.
References data, GPU_shader_get_uniform(), GPU_shader_uniform_float_ex(), and name.
Referenced by blender::nodes::node_composite_glare_cc::GlareOperation::apply_streak_filter_gpu(), blender::compositor::blur_pass_gpu(), blender::nodes::node_composite_boxmask_cc::BoxMaskOperation::execute_gpu(), blender::nodes::node_composite_directionalblur_cc::DirectionalBlurOperation::execute_gpu(), blender::nodes::node_composite_ellipsemask_cc::EllipseMaskOperation::execute_gpu(), blender::nodes::node_composite_split_cc::SplitOperation::execute_gpu(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_sun_beams_gpu(), GPU_shader_uniform_2f(), immUniform2fv(), blender::compositor::sample_pixel_gpu(), and blender::gpu::tests::Shader::update_push_constants().
| void GPU_shader_uniform_2fv_array | ( | blender::gpu::Shader * | sh, |
| const char * | name, | ||
| int | len, | ||
| const float(*) | val[2] ) |
Definition at line 599 of file gpu_shader.cc.
References GPU_shader_get_uniform(), GPU_shader_uniform_float_ex(), len, and name.
| void GPU_shader_uniform_2iv | ( | blender::gpu::Shader * | sh, |
| const char * | name, | ||
| const int | data[2] ) |
Definition at line 563 of file gpu_shader.cc.
References data, GPU_shader_get_uniform(), GPU_shader_uniform_int_ex(), and name.
Referenced by bind_attribute_as_ssbo(), blender::nodes::node_composite_base_cryptomatte_cc::BaseCryptoMatteOperation::compute_matte_gpu(), blender::nodes::node_composite_base_cryptomatte_cc::BaseCryptoMatteOperation::compute_pick_gpu(), blender::nodes::node_composite_crop_cc::CropOperation::execute_alpha_crop_gpu(), blender::nodes::node_composite_group_output_cc::GroupOutputOperation::execute_copy_gpu(), blender::nodes::node_composite_viewer_cc::ViewerOperation::execute_copy_gpu(), blender::nodes::node_composite_boxmask_cc::BoxMaskOperation::execute_gpu(), blender::nodes::node_composite_ellipsemask_cc::EllipseMaskOperation::execute_gpu(), blender::nodes::node_composite_crop_cc::CropOperation::execute_image_crop_gpu(), blender::nodes::node_composite_group_input_cc::GroupInputOperation::execute_pass_gpu(), blender::nodes::node_composite_render_layer_cc::RenderLayerOperation::execute_pass_gpu(), blender::gpu::Immediate::polyline_draw_workaround(), and blender::compositor::zero_pad_gpu().
| void GPU_shader_uniform_3f | ( | blender::gpu::Shader * | sh, |
| const char * | name, | ||
| float | x, | ||
| float | y, | ||
| float | z ) |
Definition at line 526 of file gpu_shader.cc.
References data, GPU_shader_uniform_3fv(), name, x, y, and z().
Referenced by immUniform3f().
| void GPU_shader_uniform_3fv | ( | blender::gpu::Shader * | sh, |
| const char * | name, | ||
| const float | data[3] ) |
Definition at line 551 of file gpu_shader.cc.
References data, GPU_shader_get_uniform(), GPU_shader_uniform_float_ex(), and name.
Referenced by blender::nodes::node_composite_glare_cc::GlareOperation::apply_streak_filter_gpu(), blender::compositor::detect_edges_gpu(), blender::compositor::ConversionOperation::execute(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_mix_gpu(), blender::nodes::node_composite_tonemap_cc::ToneMapOperation::execute_photoreceptor_gpu(), blender::nodes::node_composite_lensdist_cc::LensDistortionOperation::execute_radial_distortion_gpu(), GPU_shader_uniform_3f(), immUniform3fv(), blender::compositor::maximum_luminance_gpu(), blender::compositor::minimum_luminance_gpu(), blender::ed::vse::sequencer_draw_scopes(), blender::compositor::sum_log_luminance_gpu(), blender::compositor::sum_luminance_gpu(), blender::compositor::sum_luminance_squared_difference_gpu(), blender::gpu::tests::Shader::update_push_constants(), and blender::nodes::node_composite_glare_cc::GlareOperation::write_glare_output_gpu().
| void GPU_shader_uniform_3iv | ( | blender::gpu::Shader * | sh, |
| const char * | name, | ||
| const int | data[3] ) |
Definition at line 569 of file gpu_shader.cc.
References data, GPU_shader_get_uniform(), GPU_shader_uniform_int_ex(), and name.
Referenced by blender::gpu::Immediate::polyline_draw_workaround(), and polyline_draw_workaround().
| void GPU_shader_uniform_4f | ( | blender::gpu::Shader * | sh, |
| const char * | name, | ||
| float | x, | ||
| float | y, | ||
| float | z, | ||
| float | w ) |
Definition at line 532 of file gpu_shader.cc.
References data, GPU_shader_uniform_4fv(), name, w(), x, y, and z().
Referenced by button2d_draw_intern(), and immUniform4f().
| void GPU_shader_uniform_4fv | ( | blender::gpu::Shader * | sh, |
| const char * | name, | ||
| const float | data[4] ) |
Definition at line 557 of file gpu_shader.cc.
References data, GPU_shader_get_uniform(), GPU_shader_uniform_float_ex(), and name.
Referenced by blender::nodes::node_composite_glare_cc::GlareOperation::accumulate_ghosts_gpu(), blender::compositor::blur_pass_gpu(), blender::nodes::node_composite_tonemap_cc::ToneMapOperation::execute_photoreceptor_gpu(), GPU_shader_uniform_4f(), immUniform4fv(), and blender::gpu::tests::Shader::update_push_constants().
| void GPU_shader_uniform_4fv_array | ( | blender::gpu::Shader * | sh, |
| const char * | name, | ||
| int | len, | ||
| const float(*) | val[4] ) |
Definition at line 608 of file gpu_shader.cc.
References GPU_shader_get_uniform(), GPU_shader_uniform_float_ex(), len, and name.
Referenced by blender::nodes::node_composite_glare_cc::GlareOperation::accumulate_ghosts_gpu(), and immUniformArray4fv().
| void GPU_shader_uniform_float_ex | ( | blender::gpu::Shader * | 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 497 of file gpu_shader.cc.
References len.
Referenced by BlenderFallbackDisplayShader::bind(), draw_filled_lasso(), 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(), blender::gpu::Shader::set_scene_linear_to_xyz_uniform(), and wm_draw_region_blend().
| void GPU_shader_uniform_int_ex | ( | blender::gpu::Shader * | shader, |
| int | location, | ||
| int | length, | ||
| int | array_size, | ||
| const int * | value ) |
Definition at line 503 of file gpu_shader.cc.
References len.
Referenced by BlenderFallbackDisplayShader::bind(), blender::draw::command::PushConstant::execute(), GPU_shader_uniform_1i(), GPU_shader_uniform_2iv(), GPU_shader_uniform_3iv(), pygpu_shader_uniform_bool(), pygpu_shader_uniform_int(), pygpu_shader_uniform_vector_int(), and blender::gpu::Shader::set_srgb_uniform().
| void GPU_shader_uniform_mat3_as_mat4 | ( | blender::gpu::Shader * | sh, |
| const char * | name, | ||
| const float | data[3][3] ) |
Definition at line 581 of file gpu_shader.cc.
References copy_m4_m3(), data, GPU_shader_uniform_mat4(), and name.
Referenced by blender::nodes::node_composite_cornerpin_cc::CornerPinOperation::compute_plane_gpu(), blender::nodes::node_composite_cornerpin_cc::CornerPinOperation::compute_plane_mask_gpu(), and blender::nodes::node_composite_filter_cc::FilterOperation::execute_gpu().
| void GPU_shader_uniform_mat4 | ( | blender::gpu::Shader * | sh, |
| const char * | name, | ||
| const float | data[4][4] ) |
Definition at line 575 of file gpu_shader.cc.
References data, GPU_shader_get_uniform(), GPU_shader_uniform_float_ex(), and name.
Referenced by GPU_shader_uniform_mat3_as_mat4(), and immUniformMatrix4fv().
| void GPU_shader_warm_cache | ( | blender::gpu::Shader * | shader, |
| int | limit ) |
Shader cache warming. For each shader, rendering APIs perform a two-step compilation:
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 GPUVertFormat and #gpu::FrameBuffer 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 342 of file gpu_shader.cc.
|
staticconstexpr |
Definition at line 33 of file GPU_shader.hh.
Referenced by blender::draw::CurvesEvalCache::discard_attributes(), blender::draw::drw_attributes_add_request(), blender::draw::DRW_mesh_batch_cache_create_requested(), blender::draw::CurvesEvalCache::ensure_attributes(), blender::draw::CurvesEvalCache::ensure_attributes(), blender::draw::mesh_buffer_cache_create_requested_subdiv(), blender::draw::pointcloud_discard_attributes(), and blender::draw::pointcloud_surface_shaded_get().
|
staticconstexpr |
Definition at line 36 of file GPU_shader.hh.
Referenced by gpu_node_graph_add_uniform_attribute().