|
Blender V5.0
|
#include <OCIO_gpu_shader_binder.hh>
Inherited by blender::ocio::FallbackGPUShaderBinder.
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 65 of file OCIO_gpu_shader_binder.hh.
|
explicit |
Definition at line 375 of file gpu_shader_binder.cc.
References config_.
|
virtualdefault |
| void blender::ocio::GPUShaderBinder::clear_caches | ( | ) | const |
Clear caches when configuration changes.
Definition at line 597 of file gpu_shader_binder.cc.
|
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::FallbackGPUShaderBinder.
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::FallbackGPUShaderBinder.
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 457 of file gpu_shader_binder.cc.
References blender::ocio::internal::TextureSlot::CURVE_MAPPING, blender::ocio::internal::UniformBufferSlot::CURVE_MAPPING, blender::Vector< T, InlineBufferCapacity, Allocator >::data(), data, ShaderCreateInfo::define(), blender::ocio::internal::UniformBufferSlot::DISPLAY, float, blender::gpu::shader::float2_t, blender::gpu::shader::float4_t, blender::gpu::shader::float4x4_t, ShaderCreateInfo::fragment_out(), ShaderCreateInfo::fragment_source(), ShaderCreateInfo::fragment_source_generated, GPU_shader_create_from_info(), GPU_texture_dimensions(), 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::ocio::internal::GPUUniform::name, name, blender::ocio::internal::TextureSlot::OVERLAY, ShaderCreateInfo::push_constant(), ShaderCreateInfo::sampler(), blender::ocio::internal::GPUDisplayShader::shader, StageInterfaceInfo::smooth(), blender::StringRefBase::substr(), texture(), blender::ocio::internal::GPUDisplayShader::textures, ShaderCreateInfo::typedef_source(), ShaderCreateInfo::typedef_source_generated, ShaderCreateInfo::uniform_buf(), blender::ocio::internal::GPUTextures::uniforms, blender::ocio::internal::GPUTextures::uniforms_buffer, blender::ocio::internal::GPUDisplayShader::use_curve_mapping, ShaderCreateInfo::vertex_in(), ShaderCreateInfo::vertex_out(), and ShaderCreateInfo::vertex_source().
Referenced by blender::ocio::FallbackGPUShaderBinder::construct_display_shader(), and blender::ocio::FallbackGPUShaderBinder::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 386 of file gpu_shader_binder.cc.
References 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::view, and blender::ocio::internal::GPUDisplayShader::view.
| 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 423 of file gpu_shader_binder.cc.
References BLI_assert, config_, construct_scene_linear_shader(), blender::ocio::GPUDisplayParameters::from_colorspace, blender::ocio::internal::GPUDisplayShader::from_colorspace, blender::ocio::internal::GPUDisplayShader::initialize_common(), and blender::ocio::GPUDisplayParameters::use_predivide.
| 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 452 of file gpu_shader_binder.cc.
References immUnbindProgram().
|
protected |
Definition at line 106 of file OCIO_gpu_shader_binder.hh.
Referenced by display_bind(), GPUShaderBinder(), and to_scene_linear_bind().