Blender  V3.3
Classes | Namespaces | Macros | Typedefs | Functions | Variables
gpu_shader_dependency.cc File Reference
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <sstream>
#include "BLI_ghash.h"
#include "BLI_map.hh"
#include "BLI_string_ref.hh"
#include "gpu_material_library.h"
#include "gpu_shader_create_info.hh"
#include "gpu_shader_dependency_private.h"
#include "glsl_draw_source_list.h"
#include "glsl_gpu_source_list.h"

Go to the source code of this file.

Classes

struct  blender::gpu::GPUSource
 

Namespaces

 blender
 
 blender::gpu
 
 blender::gpu::shader
 

Macros

#define SHADER_SOURCE(datatoc, filename, filepath)   extern char datatoc[];
 
#define find_keyword   find_str<true, false>
 
#define rfind_keyword   find_str<true, true>
 
#define find_token   find_str<false, false>
 
#define rfind_token   find_str<false, true>
 
#define CHECK(test_value, str, ofs, msg)
 
#define SHADER_SOURCE(datatoc, filename, filepath)    g_sources->add_new(filename, new GPUSource(filepath, filename, datatoc, g_functions));
 

Typedefs

using blender::gpu::GPUSourceDictionnary = Map< StringRef, struct GPUSource * >
 
using blender::gpu::GPUFunctionDictionnary = Map< StringRef, struct GPUFunction * >
 

Functions

void gpu_shader_dependency_init ()
 
void gpu_shader_dependency_exit ()
 
GPUFunctiongpu_material_library_use_function (GSet *used_libraries, const char *name)
 
BuiltinBits blender::gpu::shader::gpu_shader_dependency_get_builtins (const StringRefNull shader_source_name)
 
Vector< const char * > blender::gpu::shader::gpu_shader_dependency_get_resolved_source (const StringRefNull shader_source_name)
 
StringRefNull blender::gpu::shader::gpu_shader_dependency_get_source (const StringRefNull shader_source_name)
 
StringRefNull blender::gpu::shader::gpu_shader_dependency_get_filename_from_source_string (const StringRefNull source_string)
 

Variables

static GPUSourceDictionnaryg_sources = nullptr
 
static GPUFunctionDictionnaryg_functions = nullptr
 

Detailed Description

Shader source dependency builder that make possible to support #include directive inside the shader files.

Definition in file gpu_shader_dependency.cc.

Macro Definition Documentation

◆ CHECK

#define CHECK (   test_value,
  str,
  ofs,
  msg 
)
Value:
if ((test_value) == -1) { \
print_error(str, ofs, msg); \
continue; \
}
#define str(s)

Definition at line 174 of file gpu_shader_dependency.cc.

◆ find_keyword

#define find_keyword   find_str<true, false>

Definition at line 147 of file gpu_shader_dependency.cc.

◆ find_token

#define find_token   find_str<false, false>

Definition at line 149 of file gpu_shader_dependency.cc.

◆ rfind_keyword

#define rfind_keyword   find_str<true, true>

Definition at line 148 of file gpu_shader_dependency.cc.

◆ rfind_token

#define rfind_token   find_str<false, true>

Definition at line 150 of file gpu_shader_dependency.cc.

◆ SHADER_SOURCE [1/2]

#define SHADER_SOURCE (   datatoc,
  filename,
  filepath 
)    extern char datatoc[];

Definition at line 25 of file gpu_shader_dependency.cc.

◆ SHADER_SOURCE [2/2]

#define SHADER_SOURCE (   datatoc,
  filename,
  filepath 
)     g_sources->add_new(filename, new GPUSource(filepath, filename, datatoc, g_functions));

Definition at line 25 of file gpu_shader_dependency.cc.

Function Documentation

◆ gpu_material_library_use_function()

GPUFunction* gpu_material_library_use_function ( GSet used_libraries,
const char *  name 
)

◆ gpu_shader_dependency_exit()

void gpu_shader_dependency_exit ( void  )

◆ gpu_shader_dependency_init()

void gpu_shader_dependency_init ( void  )

Variable Documentation

◆ g_functions

GPUFunctionDictionnary* g_functions = nullptr
static

◆ g_sources

GPUSourceDictionnary* g_sources = nullptr
static