Blender V4.5
gpu_shader_dependency.cc File Reference
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <regex>
#include <string>
#include "BLI_ghash.h"
#include "BLI_map.hh"
#include "BLI_string_ref.hh"
#include "gpu_capabilities_private.hh"
#include "gpu_material_library.hh"
#include "gpu_shader_create_info.hh"
#include "gpu_shader_dependency_private.hh"
#include "../glsl_preprocess/glsl_preprocess.hh"
#include "glsl_compositor_source_list.h"
#include "glsl_draw_source_list.h"
#include "glsl_gpu_source_list.h"
#include "glsl_ocio_source_list.h"
#include "glsl_compositor_metadata_list.hh"
#include "glsl_draw_metadata_list.hh"
#include "glsl_gpu_metadata_list.hh"
#include "glsl_ocio_metadata_list.hh"

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(filename_underscore, filename, filepath)
#define SHADER_SOURCE(filename_underscore, 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< StringRefNullblender::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 (StringRef 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

◆ SHADER_SOURCE [1/2]

#define SHADER_SOURCE ( filename_underscore,
filename,
filepath )
Value:
g_sources->add_new(filename, \
new GPUSource(filepath, \
filename, \
datatoc_##filename_underscore, \
blender::gpu::shader::metadata_##filename_underscore));
static GPUFunctionDictionnary * g_functions
static GPUPrintFormatMap * g_formats
static GPUSourceDictionnary * g_sources

Definition at line 35 of file gpu_shader_dependency.cc.

◆ SHADER_SOURCE [2/2]

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

Definition at line 35 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 458 of file gpu_shader_dependency.cc.

References g_formats, g_functions, and g_sources.

Referenced by GPU_exit().

◆ gpu_shader_dependency_init()

Variable Documentation

◆ force_printf_injection

bool force_printf_injection = false
static

◆ g_formats

◆ g_functions

◆ g_sources