Blender V4.3
gpu_shader_dependency.cc File Reference
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <regex>
#include <sstream>
#include "BLI_ghash.h"
#include "BLI_map.hh"
#include "BLI_string.h"
#include "BLI_string_ref.hh"
#include "gpu_material_library.hh"
#include "gpu_shader_create_info.hh"
#include "gpu_shader_dependency_private.hh"
#include "GPU_context.hh"
#include "glsl_compositor_source_list.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

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

Macros

#define SHADER_SOURCE(datatoc, filename, filepath)
#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)

Typedefs

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

Functions

void gpu_shader_dependency_init ()
void gpu_shader_dependency_exit ()
GPUFunctiongpu_material_library_use_function (GSet *used_libraries, const char *name)
bool blender::gpu::shader::gpu_shader_dependency_force_gpu_print_injection ()
bool blender::gpu::shader::gpu_shader_dependency_has_printf ()
const PrintfFormatblender::gpu::shader::gpu_shader_dependency_get_printf_format (uint32_t format_hash)
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)
 Find the name of the file from which the given string was generated.

Variables

static GPUPrintFormatMapg_formats = nullptr
static GPUSourceDictionnaryg_sources = nullptr
static GPUFunctionDictionnaryg_functions = nullptr
static bool force_printf_injection = false

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

◆ find_keyword

◆ find_token

◆ rfind_keyword

#define rfind_keyword   find_str<true, true>

◆ rfind_token

◆ SHADER_SOURCE [1/2]

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

Definition at line 30 of file gpu_shader_dependency.cc.

◆ SHADER_SOURCE [2/2]

#define SHADER_SOURCE ( datatoc,
filename,
filepath )
Value:
g_sources->add_new(filename, new GPUSource(filepath, filename, datatoc, g_functions, g_formats));
static GPUFunctionDictionnary * g_functions
static GPUSourceDictionnary * g_sources
static OVERLAY_InstanceFormats g_formats

Definition at line 30 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 ( )

Definition at line 1143 of file gpu_shader_dependency.cc.

References g_formats, g_functions, and g_sources.

Referenced by GPU_exit().

◆ gpu_shader_dependency_init()

void gpu_shader_dependency_init ( )

Variable Documentation

◆ force_printf_injection

bool force_printf_injection = false
static

◆ g_formats

GPUPrintFormatMap* g_formats = nullptr
static

Definition at line 1099 of file gpu_shader_dependency.cc.

◆ g_functions

◆ g_sources