Blender V5.0
blender::gpu::GPUSource Struct Reference

Public Member Functions

shader::BuiltinBits convert_builtin_bit (shader::metadata::Builtin builtin)
GPUFunctionQual convert_qualifier (shader::metadata::Qualifier qualifier)
GPUType convert_type (shader::metadata::Type type)
 GPUSource (const char *path, const char *file, const char *datatoc, GPUFunctionDictionary *g_functions, GPUPrintFormatMap *g_formats, std::function< void(GPUSource &, GPUFunctionDictionary *, GPUPrintFormatMap *)> metadata_fn)
void add_builtin (shader::metadata::Builtin builtin)
void add_dependency (StringRef line)
void add_printf_format (uint32_t format_hash, std::string format, GPUPrintFormatMap *format_map)
void add_function (StringRefNull name, Span< shader::metadata::ArgumentFormat > arguments, GPUFunctionDictionary *g_functions)
void print_error (const StringRef &input, int64_t offset, const StringRef message)
int init_dependencies (const GPUSourceDictionary &dict)
void source_get (Vector< StringRefNull > &result, const shader::GeneratedSourceList &generated_sources, const GPUSourceDictionary &dict, const GPUSource &from) const
void build (Vector< StringRefNull > &result, const shader::GeneratedSourceList &generated_sources, const GPUSourceDictionary &dict) const
shader::BuiltinBits builtins_get () const
bool is_from_material_library () const

Public Attributes

StringRefNull fullpath
StringRefNull filename
StringRefNull source
std::string patched_source
Vector< StringRefdependencies_names
Vector< GPUSource * > dependencies
bool dependencies_init = false
shader::BuiltinBits builtins = shader::BuiltinBits::NONE
bool generated = false

Detailed Description

Definition at line 57 of file gpu_shader_dependency.cc.

Constructor & Destructor Documentation

◆ GPUSource()

blender::gpu::GPUSource::GPUSource ( const char * path,
const char * file,
const char * datatoc,
GPUFunctionDictionary * g_functions,
GPUPrintFormatMap * g_formats,
std::function< void(GPUSource &, GPUFunctionDictionary *, GPUPrintFormatMap *)> metadata_fn )
inline

Member Function Documentation

◆ add_builtin()

void blender::gpu::GPUSource::add_builtin ( shader::metadata::Builtin builtin)
inline

Definition at line 184 of file gpu_shader_dependency.cc.

References builtins, and convert_builtin_bit().

◆ add_dependency()

void blender::gpu::GPUSource::add_dependency ( StringRef line)
inline

Definition at line 189 of file gpu_shader_dependency.cc.

References dependencies_names.

◆ add_function()

◆ add_printf_format()

◆ build()

void blender::gpu::GPUSource::build ( Vector< StringRefNull > & result,
const shader::GeneratedSourceList & generated_sources,
const GPUSourceDictionary & dict ) const
inline

◆ builtins_get()

shader::BuiltinBits blender::gpu::GPUSource::builtins_get ( ) const
inline

◆ convert_builtin_bit()

shader::BuiltinBits blender::gpu::GPUSource::convert_builtin_bit ( shader::metadata::Builtin builtin)
inline

Definition at line 73 of file gpu_shader_dependency.cc.

References blender::gpu::shader::metadata::assert, BLI_assert_unreachable, blender::gpu::shader::metadata::drw_debug, blender::gpu::shader::FRAG_COORD, blender::gpu::shader::metadata::FragCoord, blender::gpu::shader::metadata::FragStencilRef, blender::gpu::shader::FRONT_FACING, blender::gpu::shader::metadata::FrontFacing, blender::gpu::shader::GLOBAL_INVOCATION_ID, blender::gpu::shader::metadata::GlobalInvocationID, blender::gpu::shader::INSTANCE_ID, blender::gpu::shader::metadata::InstanceID, blender::gpu::shader::LOCAL_INVOCATION_ID, blender::gpu::shader::LOCAL_INVOCATION_INDEX, blender::gpu::shader::metadata::LocalInvocationID, blender::gpu::shader::metadata::LocalInvocationIndex, blender::gpu::shader::NONE, blender::gpu::shader::NUM_WORK_GROUP, blender::gpu::shader::metadata::NumWorkGroup, blender::gpu::shader::POINT_COORD, blender::gpu::shader::POINT_SIZE, blender::gpu::shader::metadata::PointCoord, blender::gpu::shader::metadata::PointSize, blender::gpu::shader::PRIMITIVE_ID, blender::gpu::shader::metadata::PrimitiveID, blender::gpu::shader::metadata::printf, blender::gpu::shader::RUNTIME_GENERATED, blender::gpu::shader::metadata::runtime_generated, blender::gpu::shader::STENCIL_REF, blender::gpu::shader::USE_DEBUG_DRAW, blender::gpu::shader::USE_PRINTF, blender::gpu::shader::VERTEX_ID, blender::gpu::shader::metadata::VertexID, blender::gpu::shader::WORK_GROUP_ID, blender::gpu::shader::WORK_GROUP_SIZE, blender::gpu::shader::metadata::WorkGroupID, and blender::gpu::shader::metadata::WorkGroupSize.

Referenced by add_builtin().

◆ convert_qualifier()

◆ convert_type()

◆ init_dependencies()

◆ is_from_material_library()

bool blender::gpu::GPUSource::is_from_material_library ( ) const
inline

Definition at line 441 of file gpu_shader_dependency.cc.

References filename.

◆ print_error()

void blender::gpu::GPUSource::print_error ( const StringRef & input,
int64_t offset,
const StringRef message )
inline

◆ source_get()

Member Data Documentation

◆ builtins

shader::BuiltinBits blender::gpu::GPUSource::builtins = shader::BuiltinBits::NONE

Definition at line 65 of file gpu_shader_dependency.cc.

Referenced by add_builtin(), builtins_get(), and init_dependencies().

◆ dependencies

Vector<GPUSource *> blender::gpu::GPUSource::dependencies

Definition at line 63 of file gpu_shader_dependency.cc.

Referenced by builtins_get(), and init_dependencies().

◆ dependencies_init

bool blender::gpu::GPUSource::dependencies_init = false

Definition at line 64 of file gpu_shader_dependency.cc.

◆ dependencies_names

Vector<StringRef> blender::gpu::GPUSource::dependencies_names

Definition at line 62 of file gpu_shader_dependency.cc.

Referenced by add_dependency(), and init_dependencies().

◆ filename

StringRefNull blender::gpu::GPUSource::filename

◆ fullpath

StringRefNull blender::gpu::GPUSource::fullpath

Definition at line 58 of file gpu_shader_dependency.cc.

Referenced by GPUSource(), and print_error().

◆ generated

bool blender::gpu::GPUSource::generated = false

Definition at line 67 of file gpu_shader_dependency.cc.

◆ patched_source

std::string blender::gpu::GPUSource::patched_source

Definition at line 61 of file gpu_shader_dependency.cc.

◆ source


The documentation for this struct was generated from the following file: