Blender
V3.3
|
#include <limits>
#include <list>
#include <sstream>
#include <string.h>
#include <vector>
#include <OpenColorIO/OpenColorIO.h>
#include "GPU_immediate.h"
#include "GPU_shader.h"
#include "GPU_uniform_buffer.h"
#include "gpu_shader_create_info.hh"
#include "MEM_guardedalloc.h"
#include "ocio_impl.h"
#include "ocio_shader_shared.hh"
Go to the source code of this file.
Classes | |
struct | OCIO_GPUShader |
struct | OCIO_GPULutTexture |
struct | OCIO_GPUUniform |
struct | OCIO_GPUTextures |
struct | OCIO_GPUCurveMappping |
struct | OCIO_GPUDisplayShader |
Enumerations | |
enum | OCIO_GPUTextureSlots { TEXTURE_SLOT_IMAGE = 0 , TEXTURE_SLOT_OVERLAY = 1 , TEXTURE_SLOT_CURVE_MAPPING = 2 , TEXTURE_SLOT_LUTS_OFFSET = 3 } |
enum | OCIO_GPUUniformBufSlots { UNIFORMBUF_SLOT_DISPLAY = 0 , UNIFORMBUF_SLOT_CURVEMAP = 1 , UNIFORMBUF_SLOT_LUTS = 2 } |
Functions | |
Shader | |
static bool | createGPUShader (OCIO_GPUShader &shader, OCIO_GPUTextures &textures, const GpuShaderDescRcPtr &shaderdesc_to_scene_linear, const GpuShaderDescRcPtr &shaderdesc_to_display, const bool use_curve_mapping) |
Textures | |
static bool | addGPUUniform (OCIO_GPUTextures &textures, const GpuShaderDescRcPtr &shader_desc, int index) |
static bool | addGPULut1D2D (OCIO_GPUTextures &textures, const GpuShaderDescRcPtr &shader_desc, int index) |
static bool | addGPULut3D (OCIO_GPUTextures &textures, const GpuShaderDescRcPtr &shader_desc, int index) |
static bool | createGPUTextures (OCIO_GPUTextures &textures, const GpuShaderDescRcPtr &shaderdesc_to_scene_linear, const GpuShaderDescRcPtr &shaderdesc_to_display) |
Curve Mapping | |
static bool | createGPUCurveMapping (OCIO_GPUCurveMappping &curvemap, OCIO_CurveMappingSettings *curve_mapping_settings) |
static void | updateGPUCurveMapping (OCIO_GPUCurveMappping &curvemap, OCIO_CurveMappingSettings *curve_mapping_settings) |
static void | updateGPUDisplayParameters (OCIO_GPUShader &shader, float scale, float exponent, float dither, bool use_predivide, bool use_overlay) |
OCIO GPU Shader Implementation | |
static OCIO_GPUDisplayShader & | getGPUDisplayShader (OCIO_ConstConfigRcPtr *config, const char *input, const char *view, const char *display, const char *look, OCIO_CurveMappingSettings *curve_mapping_settings) |
Variables | |
static const int | SHADER_CACHE_MAX_SIZE = 4 |
std::list< OCIO_GPUDisplayShader > | SHADER_CACHE |
enum OCIO_GPUTextureSlots |
Enumerator | |
---|---|
TEXTURE_SLOT_IMAGE | |
TEXTURE_SLOT_OVERLAY | |
TEXTURE_SLOT_CURVE_MAPPING | |
TEXTURE_SLOT_LUTS_OFFSET |
Definition at line 35 of file ocio_impl_glsl.cc.
Enumerator | |
---|---|
UNIFORMBUF_SLOT_DISPLAY | |
UNIFORMBUF_SLOT_CURVEMAP | |
UNIFORMBUF_SLOT_LUTS |
Definition at line 42 of file ocio_impl_glsl.cc.
|
static |
Definition at line 312 of file ocio_impl_glsl.cc.
References GPU_R16F, GPU_RGB16F, GPU_texture_create_1d(), GPU_texture_create_2d(), GPU_texture_filter_mode(), GPU_texture_wrap_mode(), height, OCIO_GPULutTexture::sampler_name, OCIO_GPULutTexture::texture, textures, and width.
Referenced by createGPUTextures().
|
static |
Definition at line 358 of file ocio_impl_glsl.cc.
References GPU_DATA_FLOAT, GPU_RGB16F, GPU_texture_create_3d(), GPU_texture_filter_mode(), GPU_texture_wrap_mode(), OCIO_GPULutTexture::sampler_name, OCIO_GPULutTexture::texture, and textures.
Referenced by createGPUTextures().
|
static |
Definition at line 298 of file ocio_impl_glsl.cc.
References OCIO_GPUUniform::data, OCIO_GPUUniform::name, and textures.
Referenced by createGPUTextures().
|
static |
Definition at line 439 of file ocio_impl_glsl.cc.
References OCIO_GPUCurveMappping::buffer, GPU_RGBA16F, GPU_texture_create_1d(), GPU_texture_filter_mode(), GPU_texture_wrap_mode(), GPU_uniformbuf_create, OCIO_CurveMappingSettings::lut_size, and OCIO_GPUCurveMappping::texture.
Referenced by getGPUDisplayShader().
|
static |
Definition at line 147 of file ocio_impl_glsl.cc.
References OCIO_GPUUniform::data, data, blender::gpu::shader::ShaderCreateInfo::define(), float(), blender::gpu::shader::ShaderCreateInfo::fragment_out(), blender::gpu::shader::ShaderCreateInfo::fragment_source(), blender::gpu::shader::ShaderCreateInfo::fragment_source_generated, free(), GPU_shader_create_from_info(), GPU_texture_dimensions(), GPU_uniformbuf_create_ex(), OCIO_GPUUniform::name, blender::gpu::shader::ShaderCreateInfo::push_constant(), blender::gpu::shader::ShaderCreateInfo::sampler(), OCIO_GPULutTexture::sampler_name, OCIO_GPUShader::shader, blender::gpu::shader::StageInterfaceInfo::smooth(), blender::StringRefBase::substr(), OCIO_GPULutTexture::texture, TEXTURE_SLOT_CURVE_MAPPING, TEXTURE_SLOT_IMAGE, TEXTURE_SLOT_LUTS_OFFSET, TEXTURE_SLOT_OVERLAY, textures, type, blender::gpu::shader::ShaderCreateInfo::typedef_source(), blender::gpu::shader::ShaderCreateInfo::typedef_source_generated, blender::gpu::shader::ShaderCreateInfo::uniform_buf(), UNIFORMBUF_SLOT_CURVEMAP, UNIFORMBUF_SLOT_DISPLAY, UNIFORMBUF_SLOT_LUTS, blender::gpu::shader::ShaderCreateInfo::vertex_in(), blender::gpu::shader::ShaderCreateInfo::vertex_out(), and blender::gpu::shader::ShaderCreateInfo::vertex_source().
Referenced by getGPUDisplayShader().
|
static |
Definition at line 390 of file ocio_impl_glsl.cc.
References addGPULut1D2D(), addGPULut3D(), addGPUUniform(), GPU_texture_create_error(), and textures.
Referenced by getGPUDisplayShader().
|
static |
Definition at line 551 of file ocio_impl_glsl.cc.
References createGPUCurveMapping(), createGPUShader(), createGPUTextures(), OCIO_GPUDisplayShader::curvemap, OCIO_GPUDisplayShader::display, input, OCIO_GPUDisplayShader::input, OCIO_GPUDisplayShader::look, OCIO_configGetProcessorWithNames(), OCIO_createDisplayProcessor(), OCIO_processorRelease(), OCIO_GPUDisplayShader::shader, SHADER_CACHE, SHADER_CACHE_MAX_SIZE, OCIO_GPUDisplayShader::textures, OCIO_GPUDisplayShader::use_curve_mapping, OCIO_GPUDisplayShader::valid, OCIO_GPUDisplayShader::view, and view.
|
static |
Definition at line 459 of file ocio_impl_glsl.cc.
References OCIO_CurveMappingSettings::black, OCIO_GPUCurveMappping::buffer, OCIO_CurveMappingSettings::bwmul, OCIO_CurveMappingSettings::cache_id, OCIO_GPUCurveMappping::cache_id, data, OCIO_CurveMappingSettings::ext_in_x, OCIO_CurveMappingSettings::ext_in_y, OCIO_CurveMappingSettings::ext_out_x, OCIO_CurveMappingSettings::ext_out_y, OCIO_CurveMappingSettings::first_x, OCIO_CurveMappingSettings::first_y, GPU_DATA_FLOAT, GPU_texture_update_sub(), GPU_uniformbuf_update(), OCIO_CurveMappingSettings::last_x, OCIO_CurveMappingSettings::last_y, OCIO_CurveMappingSettings::lut, OCIO_CurveMappingSettings::lut_size, OCIO_CurveMappingSettings::mintable, offset, OCIO_CurveMappingSettings::range, OCIO_GPUCurveMappping::texture, UNPACK3, and OCIO_CurveMappingSettings::use_extend_extrapolate.
|
static |
Definition at line 501 of file ocio_impl_glsl.cc.
References data, GPU_uniformbuf_create, GPU_uniformbuf_update(), OCIO_GPUShader::parameters, and OCIO_GPUShader::parameters_buffer.
std::list<OCIO_GPUDisplayShader> SHADER_CACHE |
Definition at line 141 of file ocio_impl_glsl.cc.
Referenced by getGPUDisplayShader().
|
static |
Definition at line 140 of file ocio_impl_glsl.cc.
Referenced by getGPUDisplayShader().