|
Blender V5.3
|
#include <OCIO_gpu_shader_binder.hh>
Inherited by blender::ocio::LibOCIOGPUShaderBinder.
Public Member Functions | |
| GPUShaderBinder (const Config &config) | |
| virtual | ~GPUShaderBinder () |
| bool | display_bind (const GPUDisplayParameters &display_parameters) const |
| bool | to_scene_linear_bind (StringRefNull from_colorspace, bool use_predivide) const |
| void | unbind () const |
| void | clear_caches () const |
Protected Member Functions | |
| virtual void | construct_display_shader (internal::GPUDisplayShader &display_shader) const =0 |
| virtual void | construct_scene_linear_shader (internal::GPUDisplayShader &display_shader) const =0 |
Static Protected Member Functions | |
| static bool | create_gpu_shader (internal::GPUDisplayShader &display_shader, StringRefNull fragment_source, Span< std::array< StringRefNull, 2 > > additional_defines) |
Protected Attributes | |
| const Config & | config_ |
Definition at line 71 of file OCIO_gpu_shader_binder.hh.
|
explicit |
Definition at line 396 of file gpu_shader_binder.cc.
References config_.
|
virtualdefault |
References clear_caches(), display_bind(), to_scene_linear_bind(), and unbind().
| void blender::ocio::GPUShaderBinder::clear_caches | ( | ) | const |
Clear caches when configuration changes.
Definition at line 620 of file gpu_shader_binder.cc.
Referenced by ~GPUShaderBinder().
|
protectedpure virtual |
Construct display shader matching requested parameters. The shader has its cache variables (input color space name, view, display, look, whether curve mapping is used or not).
Implemented in blender::ocio::LibOCIOGPUShaderBinder.
Referenced by display_bind().
|
protectedpure virtual |
Construct display shader which will only perform the to-scene-linear part of conversion, leaving the to-display a no-op function.
Implemented in blender::ocio::LibOCIOGPUShaderBinder.
References create_gpu_shader().
Referenced by to_scene_linear_bind().
|
staticprotected |
Create GPU shader for the given display shader. Returns true if the shader was successfully created.
Definition at line 479 of file gpu_shader_binder.cc.
References blender::gpu::shader::ShaderCreateInfo::builtins(), blender::ocio::internal::TextureSlot::CURVE_MAPPING, blender::ocio::internal::UniformBufferSlot::CURVE_MAPPING, blender::data, blender::Vector< T, InlineBufferCapacity, Allocator >::data(), blender::gpu::shader::ShaderCreateInfo::define(), blender::ocio::internal::UniformBufferSlot::DISPLAY, float, blender::gpu::shader::float2_t, blender::gpu::shader::float4_t, blender::gpu::shader::float4x4_t, blender::gpu::shader::ShaderCreateInfo::fragment_out(), blender::gpu::shader::ShaderCreateInfo::fragment_source(), blender::gpu::shader::ShaderCreateInfo::generated_sources, blender::GPU_backend_get_type(), blender::GPU_BACKEND_METAL, blender::GPU_shader_create_from_info(), blender::GPU_texture_dimensions(), blender::GPU_uniformbuf_create_ex(), blender::ocio::internal::TextureSlot::IMAGE, blender::ocio::internal::UniformBufferSlot::LUTS, blender::ocio::internal::GPUTextures::luts, blender::ocio::internal::TextureSlot::LUTS_OFFSET, blender::gpu::shader::NO_BUFFER_TYPE_LINTING, blender::ocio::internal::TextureSlot::OVERLAY, blender::gpu::shader::ShaderCreateInfo::push_constant(), blender::gpu::shader::ShaderCreateInfo::sampler(), blender::ocio::internal::GPUDisplayShader::shader, blender::gpu::shader::StageInterfaceInfo::smooth(), blender::StringRefNull::StringRefNull(), blender::blender::StringRefBase::substr(), texture(), blender::ocio::internal::GPUDisplayShader::textures, blender::gpu::shader::ShaderCreateInfo::typedef_source(), blender::gpu::shader::ShaderCreateInfo::typedef_source_generated, uniform, blender::gpu::shader::ShaderCreateInfo::uniform_buf(), blender::ocio::internal::GPUTextures::uniforms, blender::ocio::internal::GPUTextures::uniforms_buffer, blender::ocio::internal::GPUDisplayShader::use_curve_mapping, blender::gpu::shader::ShaderCreateInfo::vertex_in(), blender::gpu::shader::ShaderCreateInfo::vertex_out(), and blender::gpu::shader::ShaderCreateInfo::vertex_source().
Referenced by construct_scene_linear_shader().
| bool blender::ocio::GPUShaderBinder::display_bind | ( | const GPUDisplayParameters & | display_parameters | ) | const |
Bind GPU shader which performs conversion from the given color space to the display space. Drawing happens in the same immediate mode as when GPU_SHADER_3D_IMAGE_COLOR shader is used.
Returns true if the GPU shader was successfully bound.
Definition at line 407 of file gpu_shader_binder.cc.
References blender::BLI_assert(), config_, construct_display_shader(), blender::ocio::GPUDisplayParameters::curve_mapping, blender::ocio::internal::GPUDisplayShader::curve_mapping, blender::ocio::GPUDisplayParameters::display, blender::ocio::internal::GPUDisplayShader::display, blender::ocio::GPUDisplayParameters::from_colorspace, blender::ocio::internal::GPUDisplayShader::from_colorspace, blender::ocio::internal::GPUDisplayShader::initialize_common(), blender::ocio::internal::GPUDisplayShader::is_valid, blender::ocio::GPUDisplayParameters::look, blender::ocio::internal::GPUDisplayShader::look, blender::ocio::internal::GPUCurveMappping::rasterize(), blender::ocio::internal::GPUDisplayShader::use_curve_mapping, blender::ocio::GPUDisplayParameters::use_display_emulation, blender::ocio::internal::GPUDisplayShader::use_display_emulation, blender::ocio::GPUDisplayParameters::use_hdr_buffer, blender::ocio::internal::GPUDisplayShader::use_hdr_buffer, blender::ocio::GPUDisplayParameters::use_hdr_display, blender::ocio::internal::GPUDisplayShader::use_hdr_display, blender::ocio::GPUDisplayParameters::use_scope_space, blender::ocio::internal::GPUDisplayShader::use_scope_space, blender::ocio::GPUDisplayParameters::view, and blender::ocio::internal::GPUDisplayShader::view.
Referenced by ~GPUShaderBinder().
| bool blender::ocio::GPUShaderBinder::to_scene_linear_bind | ( | StringRefNull | from_colorspace, |
| bool | use_predivide ) const |
Configures and bind GPU shader for conversion from the given space to scene linear. Drawing happens in the same immediate mode as when GPU_SHADER_3D_IMAGE_COLOR shader is used.
Returns true if the GPU shader was successfully bound.
Definition at line 445 of file gpu_shader_binder.cc.
References blender::BLI_assert(), config_, construct_scene_linear_shader(), blender::ocio::GPUDisplayParameters::from_colorspace, and blender::ocio::GPUDisplayParameters::use_predivide.
Referenced by ~GPUShaderBinder().
| void blender::ocio::GPUShaderBinder::unbind | ( | ) | const |
Unbind previously bound GPU shader.
If the shader was not bound by neither display_bind() nor to_scene_linear_bind() the behavior is undefined.
Definition at line 474 of file gpu_shader_binder.cc.
References blender::immUnbindProgram().
Referenced by ~GPUShaderBinder().
|
protected |
Definition at line 112 of file OCIO_gpu_shader_binder.hh.
Referenced by blender::ocio::LibOCIOGPUShaderBinder::construct_display_shader(), blender::ocio::LibOCIOGPUShaderBinder::construct_scene_linear_shader(), display_bind(), GPUShaderBinder(), and to_scene_linear_bind().