Blender  V3.3
Variables
gl_shader.cc File Reference
#include "BKE_global.h"
#include "BLI_string.h"
#include "BLI_vector.hh"
#include "GPU_capabilities.h"
#include "GPU_platform.h"
#include "gl_debug.hh"
#include "gl_vertex_buffer.hh"
#include "gl_shader.hh"
#include "gl_shader_interface.hh"

Go to the source code of this file.

Functions

Create Info
static const char * to_string (const Interpolation &interp)
 
static const char * to_string (const Type &type)
 
static const char * to_string (const eGPUTextureFormat &type)
 
static const char * to_string (const PrimitiveIn &layout)
 
static const char * to_string (const PrimitiveOut &layout)
 
static const char * to_string (const DepthWrite &value)
 
static void print_image_type (std::ostream &os, const ImageType &type, const ShaderCreateInfo::Resource::BindType bind_type)
 
static std::ostream & print_qualifier (std::ostream &os, const Qualifier &qualifiers)
 
static void print_resource (std::ostream &os, const ShaderCreateInfo::Resource &res)
 
static void print_resource_alias (std::ostream &os, const ShaderCreateInfo::Resource &res)
 
static void print_interface (std::ostream &os, const StringRefNull &prefix, const StageInterfaceInfo &iface, const StringRefNull &suffix="")
 
static std::string main_function_wrapper (std::string &pre_main, std::string &post_main)
 
static StageInterfaceInfofind_interface_by_name (const Vector< StageInterfaceInfo * > &ifaces, const StringRefNull &name)
 
Shader stage creation
static char * glsl_patch_default_get ()
 
static char * glsl_patch_compute_get ()
 
GPUVertFormat from Shader
static uint calc_component_size (const GLenum gl_type)
 
static void get_fetch_mode_and_comp_type (int gl_type, GPUVertCompType *r_comp_type, GPUVertFetchMode *r_fetch_mode)
 

Variables

char datatoc_glsl_shader_defines_glsl []
 

Function Documentation

◆ calc_component_size()

static uint calc_component_size ( const GLenum  gl_type)
static

Definition at line 1139 of file gl_shader.cc.

Referenced by blender::gpu::GLShader::vertformat_from_shader().

◆ find_interface_by_name()

static StageInterfaceInfo* find_interface_by_name ( const Vector< StageInterfaceInfo * > &  ifaces,
const StringRefNull name 
)
static

Definition at line 667 of file gl_shader.cc.

Referenced by blender::gpu::GLShader::geometry_interface_declare().

◆ get_fetch_mode_and_comp_type()

static void get_fetch_mode_and_comp_type ( int  gl_type,
GPUVertCompType r_comp_type,
GPUVertFetchMode r_fetch_mode 
)
static

◆ glsl_patch_compute_get()

static char* glsl_patch_compute_get ( )
static

Used for shader patching. Init once.

Definition at line 875 of file gl_shader.cc.

References BLI_assert, datatoc_glsl_shader_defines_glsl, and STR_CONCAT.

◆ glsl_patch_default_get()

static char* glsl_patch_default_get ( )
static

◆ main_function_wrapper()

static std::string main_function_wrapper ( std::string &  pre_main,
std::string &  post_main 
)
static

◆ print_image_type()

static void print_image_type ( std::ostream &  os,
const ImageType type,
const ShaderCreateInfo::Resource::BindType  bind_type 
)
static

Definition at line 233 of file gl_shader.cc.

References type.

Referenced by print_resource().

◆ print_interface()

static void print_interface ( std::ostream &  os,
const StringRefNull prefix,
const StageInterfaceInfo iface,
const StringRefNull suffix = "" 
)
static

◆ print_qualifier()

static std::ostream& print_qualifier ( std::ostream &  os,
const Qualifier qualifiers 
)
static

Definition at line 349 of file gl_shader.cc.

Referenced by print_resource().

◆ print_resource()

static void print_resource ( std::ostream &  os,
const ShaderCreateInfo::Resource res 
)
static

◆ print_resource_alias()

static void print_resource_alias ( std::ostream &  os,
const ShaderCreateInfo::Resource res 
)
static

◆ to_string() [1/6]

static const char* to_string ( const DepthWrite value)
static

Definition at line 219 of file gl_shader.cc.

◆ to_string() [2/6]

static const char* to_string ( const eGPUTextureFormat type)
static

◆ to_string() [3/6]

static const char* to_string ( const Interpolation interp)
static

◆ to_string() [4/6]

static const char* to_string ( const PrimitiveIn layout)
static

Definition at line 187 of file gl_shader.cc.

◆ to_string() [5/6]

static const char* to_string ( const PrimitiveOut layout)
static

Definition at line 205 of file gl_shader.cc.

◆ to_string() [6/6]

static const char* to_string ( const Type type)
static

Definition at line 77 of file gl_shader.cc.

References FLOAT, type, and UINT().

Variable Documentation

◆ datatoc_glsl_shader_defines_glsl

char datatoc_glsl_shader_defines_glsl[]

Definition at line 26 of file gl_shader.cc.

Referenced by glsl_patch_compute_get(), and glsl_patch_default_get().