Suckless OGL 1.0.0
A lean, high-performance C11 PBR Renderer
Loading...
Searching...
No Matches
postprocess_shader.c File Reference
#include "log.h"
#include "postprocess.h"
#include "postprocess_internal.h"
#include "pp_shader_state.h"
#include "profiler.h"
#include "shader.h"
#include "utils.h"
#include <stdio.h>
Include dependency graph for postprocess_shader.c:

Data Structures

struct  EffectMetadata
 

Macros

#define EFFECT_COUNT   (sizeof(ALL_EFFECTS) / sizeof(ALL_EFFECTS[0]))
 

Enumerations

enum  { MAX_SHADER_DEFINES = 32 , MAX_DEFINE_LENGTH = 64 }
 

Functions

bool pp_is_shader_in_cache (PostProcess *post_processing, Shader *shader)
 
void pp_setup_sampler_uniforms (PostProcess *post_processing)
 
void pp_update_current_shader (PostProcess *post_processing, Shader *new_shader, bool is_optimized)
 
static void log_optimized_effects (unsigned int flags)
 
static Shader * find_shader_in_cache (PostProcess *post_processing, unsigned int static_flags)
 
void postprocess_compile_optimized (PostProcess *post_processing, unsigned int static_flags)
 
void postprocess_use_dynamic (PostProcess *post_processing)
 

Variables

static const EffectMetadata ALL_EFFECTS []
 

Macro Definition Documentation

◆ EFFECT_COUNT

#define EFFECT_COUNT   (sizeof(ALL_EFFECTS) / sizeof(ALL_EFFECTS[0]))

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
MAX_SHADER_DEFINES 
MAX_DEFINE_LENGTH 

Function Documentation

◆ find_shader_in_cache()

static Shader * find_shader_in_cache ( PostProcess *  post_processing,
unsigned int  static_flags 
)
static

◆ log_optimized_effects()

static void log_optimized_effects ( unsigned int  flags)
static

◆ postprocess_compile_optimized()

void postprocess_compile_optimized ( PostProcess *  post_processing,
unsigned int  static_flags 
)
Here is the call graph for this function:

◆ postprocess_use_dynamic()

void postprocess_use_dynamic ( PostProcess *  post_processing)
Here is the call graph for this function:

◆ pp_is_shader_in_cache()

bool pp_is_shader_in_cache ( PostProcess *  post_processing,
Shader *  shader 
)

Check whether a shader is in the variant cache.

◆ pp_setup_sampler_uniforms()

void pp_setup_sampler_uniforms ( PostProcess *  post_processing)

Bind sampler uniforms to texture units on the current shader.

Here is the call graph for this function:

◆ pp_update_current_shader()

void pp_update_current_shader ( PostProcess *  post_processing,
Shader *  new_shader,
bool  is_optimized 
)

Update the active shader, destroying the old one if not cached.

Here is the call graph for this function:

Variable Documentation

◆ ALL_EFFECTS

const EffectMetadata ALL_EFFECTS[]
static
Initial value:
= {
{POSTFX_VIGNETTE, "Vignette", "OPT_ENABLE_VIGNETTE"},
{POSTFX_GRAIN, "Film Grain", "OPT_ENABLE_GRAIN"},
{POSTFX_EXPOSURE, "Manual Exposure", "OPT_ENABLE_EXPOSURE"},
{POSTFX_CHROM_ABBR, "Chromatic Aberration", "OPT_ENABLE_CHROM_ABBR"},
{POSTFX_BLOOM, "Bloom", "OPT_ENABLE_BLOOM"},
{POSTFX_COLOR_GRADING, "Color Grading", "OPT_ENABLE_COLOR_GRADING"},
{POSTFX_DOF, "Depth of Field", "OPT_ENABLE_DOF"},
{POSTFX_DOF_DEBUG, "DoF Debug View", "OPT_ENABLE_DOF_DEBUG"},
{POSTFX_AUTO_EXPOSURE, "Auto-Exposure", "OPT_ENABLE_AUTO_EXPOSURE"},
{POSTFX_EXPOSURE_DEBUG, "Exposure Debug View", "OPT_ENABLE_EXPOSURE_DEBUG"},
{POSTFX_MOTION_BLUR, "Motion Blur", "OPT_ENABLE_MOTION_BLUR"},
{POSTFX_MOTION_BLUR_DEBUG, "Motion Blur Debug View",
"OPT_ENABLE_MOTION_BLUR_DEBUG"},
{POSTFX_FXAA, "FXAA", "OPT_ENABLE_FXAA"},
{POSTFX_FXAA_DEBUG, "FXAA Debug View", "OPT_ENABLE_FXAA_DEBUG"},
{POSTFX_BANDING, "Banding", "OPT_ENABLE_BANDING"},
{POSTFX_VECTOR_FIELD_DEBUG, "Vector Field Debug",
"OPT_ENABLE_VECTOR_FIELD_DEBUG"},
{POSTFX_STENCIL_DEBUG, "Stencil Debug View", "OPT_ENABLE_STENCIL_DEBUG"},
{POSTFX_BLOOM_DEBUG, "Bloom Debug View", "OPT_ENABLE_BLOOM_DEBUG"},
{POSTFX_FOG, "Atmospheric Fog", "OPT_ENABLE_FOG"},
{POSTFX_FOG_DEBUG, "Fog Debug View", "OPT_ENABLE_FOG_DEBUG"},
{POSTFX_LUT3D, "3D LUT Gamut Mapping", "OPT_ENABLE_LUT3D"},
}
@ POSTFX_BANDING
Definition pp_params.h:200
@ POSTFX_BLOOM_DEBUG
Definition pp_params.h:204
@ POSTFX_AUTO_EXPOSURE
Definition pp_params.h:191
@ POSTFX_MOTION_BLUR
Definition pp_params.h:195
@ POSTFX_DOF_DEBUG
Definition pp_params.h:190
@ POSTFX_COLOR_GRADING
Definition pp_params.h:187
@ POSTFX_EXPOSURE_DEBUG
Definition pp_params.h:193
@ POSTFX_GRAIN
Definition pp_params.h:183
@ POSTFX_MOTION_BLUR_DEBUG
Definition pp_params.h:196
@ POSTFX_VECTOR_FIELD_DEBUG
Definition pp_params.h:201
@ POSTFX_FXAA
Definition pp_params.h:198
@ POSTFX_DOF
Definition pp_params.h:189
@ POSTFX_STENCIL_DEBUG
Definition pp_params.h:203
@ POSTFX_BLOOM
Definition pp_params.h:186
@ POSTFX_FXAA_DEBUG
Definition pp_params.h:199
@ POSTFX_LUT3D
Definition pp_params.h:207
@ POSTFX_FOG_DEBUG
Definition pp_params.h:206
@ POSTFX_EXPOSURE
Definition pp_params.h:184
@ POSTFX_FOG
Definition pp_params.h:205
@ POSTFX_VIGNETTE
Definition pp_params.h:182
@ POSTFX_CHROM_ABBR
Definition pp_params.h:185