Blender V4.3
ocio_impl_glsl.cc File Reference
#include <limits>
#include <list>
#include <sstream>
#include <string.h>
#include <vector>
#include <OpenColorIO/OpenColorIO.h>
#include "GPU_immediate.hh"
#include "GPU_shader.hh"
#include "GPU_uniform_buffer.hh"
#include "gpu_shader_create_info.hh"
#include "BLI_math_color.h"
#include "BLI_math_color.hh"
#include "BLI_math_matrix.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 void string_replace_all (std::string &haystack, const std::string &needle, const std::string &other)
 
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 exponent, float4x4 scene_linear_matrix, float dither, bool use_predivide, bool use_overlay, bool use_hdr)
 
OCIO GPU Shader Implementation
static OCIO_GPUDisplayShadergetGPUDisplayShader (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_GPUDisplayShaderSHADER_CACHE
 

Enumeration Type Documentation

◆ OCIO_GPUTextureSlots

Enumerator
TEXTURE_SLOT_IMAGE 
TEXTURE_SLOT_OVERLAY 
TEXTURE_SLOT_CURVE_MAPPING 
TEXTURE_SLOT_LUTS_OFFSET 

Definition at line 43 of file ocio_impl_glsl.cc.

◆ OCIO_GPUUniformBufSlots

Enumerator
UNIFORMBUF_SLOT_DISPLAY 
UNIFORMBUF_SLOT_CURVEMAP 
UNIFORMBUF_SLOT_LUTS 

Definition at line 50 of file ocio_impl_glsl.cc.

Function Documentation

◆ addGPULut1D2D()

◆ addGPULut3D()

◆ addGPUUniform()

static bool addGPUUniform ( OCIO_GPUTextures & textures,
const GpuShaderDescRcPtr & shader_desc,
int index )
static

◆ createGPUCurveMapping()

◆ createGPUShader()

◆ createGPUTextures()

static bool createGPUTextures ( OCIO_GPUTextures & textures,
const GpuShaderDescRcPtr & shaderdesc_to_scene_linear,
const GpuShaderDescRcPtr & shaderdesc_to_display )
static

◆ getGPUDisplayShader()

◆ string_replace_all()

static void string_replace_all ( std::string & haystack,
const std::string & needle,
const std::string & other )
static

Definition at line 155 of file ocio_impl_glsl.cc.

Referenced by createGPUShader().

◆ updateGPUCurveMapping()

◆ updateGPUDisplayParameters()

static void updateGPUDisplayParameters ( OCIO_GPUShader & shader,
float exponent,
float4x4 scene_linear_matrix,
float dither,
bool use_predivide,
bool use_overlay,
bool use_hdr )
static

Variable Documentation

◆ SHADER_CACHE

std::list<OCIO_GPUDisplayShader> SHADER_CACHE

Definition at line 149 of file ocio_impl_glsl.cc.

Referenced by getGPUDisplayShader().

◆ SHADER_CACHE_MAX_SIZE

const int SHADER_CACHE_MAX_SIZE = 4
static

Definition at line 148 of file ocio_impl_glsl.cc.

Referenced by getGPUDisplayShader().