Blender  V3.3
Classes | Enumerations | Variables
ocio_impl_glsl.cc File Reference
#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_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 35 of file ocio_impl_glsl.cc.

◆ OCIO_GPUUniformBufSlots

Enumerator
UNIFORMBUF_SLOT_DISPLAY 
UNIFORMBUF_SLOT_CURVEMAP 
UNIFORMBUF_SLOT_LUTS 

Definition at line 42 of file ocio_impl_glsl.cc.

Function Documentation

◆ addGPULut1D2D()

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

◆ addGPULut3D()

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

◆ addGPUUniform()

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

Definition at line 298 of file ocio_impl_glsl.cc.

References OCIO_GPUUniform::data, OCIO_GPUUniform::name, and textures.

Referenced by createGPUTextures().

◆ createGPUCurveMapping()

static bool createGPUCurveMapping ( OCIO_GPUCurveMappping curvemap,
OCIO_CurveMappingSettings curve_mapping_settings 
)
static

◆ createGPUShader()

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 
)
static

◆ createGPUTextures()

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

◆ getGPUDisplayShader()

static OCIO_GPUDisplayShader& getGPUDisplayShader ( OCIO_ConstConfigRcPtr *  config,
const char *  input,
const char *  view,
const char *  display,
const char *  look,
OCIO_CurveMappingSettings curve_mapping_settings 
)
static

◆ updateGPUCurveMapping()

static void updateGPUCurveMapping ( OCIO_GPUCurveMappping curvemap,
OCIO_CurveMappingSettings curve_mapping_settings 
)
static

◆ updateGPUDisplayParameters()

static void updateGPUDisplayParameters ( OCIO_GPUShader shader,
float  scale,
float  exponent,
float  dither,
bool  use_predivide,
bool  use_overlay 
)
static

Variable Documentation

◆ SHADER_CACHE

std::list<OCIO_GPUDisplayShader> SHADER_CACHE

Definition at line 141 of file ocio_impl_glsl.cc.

Referenced by getGPUDisplayShader().

◆ SHADER_CACHE_MAX_SIZE

const int SHADER_CACHE_MAX_SIZE = 4
static

Definition at line 140 of file ocio_impl_glsl.cc.

Referenced by getGPUDisplayShader().