|
Blender V5.3
|
Namespaces | |
| namespace | metadata |
| namespace | parser |
Classes | |
| struct | CompilationConstant |
| struct | GeneratedSource |
| class | GPUCodegen |
| struct | GPUCodegenCreateInfo |
| struct | PipelineState |
| Description of a graphical pipeline to pre-compile during shader creation. More... | |
| struct | PrintfFormat |
| struct | ResourceString |
| struct | ShaderCreateInfo |
| Describe inputs & outputs, stage interfaces, resources and sources of a shader. If all data is correctly provided, this is all that is needed to create and compile a #gpu::Shader. More... | |
| class | SourceProcessor |
| struct | SpecializationConstant |
| struct | SpecializationConstants |
| struct | StageInterfaceInfo |
Typedefs | |
| using | CreateInfoDictionary = Map<StringRef, ShaderCreateInfo *> |
| using | InterfaceDictionary = Map<StringRef, StageInterfaceInfo *> |
| using | GeneratedSourceList = Vector<shader::GeneratedSource, 0> |
| using | ShaderCreateInfoStringCache = Vector<std::unique_ptr<std::string>, 0> |
Variables | |
| static CreateInfoDictionary * | g_create_infos = nullptr |
| static InterfaceDictionary * | g_interfaces = nullptr |
| static bool | g_shader_use_printf = false |
Definition at line 37 of file gpu_shader_create_info.cc.
Definition at line 778 of file gpu_shader_create_info.hh.
Definition at line 38 of file gpu_shader_create_info.cc.
| using blender::gpu::shader::ShaderCreateInfoStringCache = Vector<std::unique_ptr<std::string>, 0> |
Definition at line 1865 of file gpu_shader_create_info.hh.
|
strong |
Definition at line 468 of file gpu_shader_create_info.hh.
|
strong |
Follow convention described in: https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_conservative_depth.txt
| Enumerator | |
|---|---|
| UNCHANGED | |
| ANY | |
| GREATER | |
| LESS | |
Definition at line 537 of file gpu_shader_create_info.hh.
|
strong |
Dual Source Blending Index.
| Enumerator | |
|---|---|
| NONE | |
| SRC_0 | |
| SRC_1 | |
Definition at line 660 of file gpu_shader_create_info.hh.
|
strong |
Maps to different descriptor sets.
| Enumerator | |
|---|---|
| BATCH | |
| PASS | |
| GEOMETRY | Special frequency tag that will automatically source storage buffers from GPUBatch. |
Definition at line 652 of file gpu_shader_create_info.hh.
|
strong |
| Enumerator | |
|---|---|
| undefined | |
| TYPES_EXPAND | Color image. |
| TYPES_EXPAND | |
| TYPES_EXPAND | |
| TYPES_EXPAND | |
| TYPES_EXPAND | |
| TYPES_EXPAND | Atomic texture type wrappers. For OpenGL, these map to the equivalent (U)INT_* types. NOTE: Atomic variants MUST be used if the texture bound to this resource has usage flag: GPU_TEXTURE_USAGE_ATOMIC, even if atomic texture operations are not used in the given shader. The shader source MUST also utilize the correct atomic sampler handle e.g. usampler2DAtomic in conjunction with these types, for passing texture/image resources into functions. |
| TYPES_EXPAND | |
| TYPES_EXPAND | |
Definition at line 590 of file gpu_shader_create_info.hh.
|
strong |
| Enumerator | |
|---|---|
| undefined | |
| TYPES_EXPAND | Color samplers/image. |
| TYPES_EXPAND | |
| TYPES_EXPAND | |
| TYPES_EXPAND | |
| TYPES_EXPAND | |
| TYPES_EXPAND | |
| TYPES_EXPAND | |
| TYPES_EXPAND | |
| TYPES_EXPAND | Depth samplers (not supported as image). |
| TYPES_EXPAND | |
| TYPES_EXPAND | |
| TYPES_EXPAND | |
| TYPES_EXPAND | Atomic texture type wrappers. For OpenGL, these map to the equivalent (U)INT_* types. NOTE: Atomic variants MUST be used if the texture bound to this resource has usage flag: GPU_TEXTURE_USAGE_ATOMIC, even if atomic texture operations are not used in the given shader. The shader source MUST also utilize the correct atomic sampler handle e.g. usampler2DAtomic in conjunction with these types, for passing texture/image resources into functions. |
| TYPES_EXPAND | |
| TYPES_EXPAND | |
Definition at line 546 of file gpu_shader_create_info.hh.
|
strong |
Interpolation qualifiers.
| Enumerator | |
|---|---|
| SMOOTH | |
| FLAT | |
| NO_PERSPECTIVE | |
Definition at line 667 of file gpu_shader_create_info.hh.
|
strong |
|
strong |
Input layout for geometry shader.
| Enumerator | |
|---|---|
| POINTS | |
| LINES | |
| LINES_ADJACENCY | |
| TRIANGLES | |
| TRIANGLES_ADJACENCY | |
Definition at line 674 of file gpu_shader_create_info.hh.
|
strong |
Output layout for geometry shader.
| Enumerator | |
|---|---|
| POINTS | |
| LINE_STRIP | |
| TRIANGLE_STRIP | |
| LINES | |
| TRIANGLES | |
Definition at line 683 of file gpu_shader_create_info.hh.
|
strong |
| Enumerator | |
|---|---|
| no_restrict | Restrict flag is set by default. Unless specified otherwise. |
| read | |
| write | |
| read_write | Shorthand version of combined flags. |
| read_no_restrict | |
| QUALIFIER_MAX | |
Definition at line 639 of file gpu_shader_create_info.hh.
|
strong |
Definition at line 94 of file GPU_common_types.hh.
| BuiltinBits blender::gpu::shader::convert_builtin_bit | ( | shader::metadata::Builtin | builtin | ) |
Definition at line 65 of file gpu_shader_dependency.cc.
References blender::gpu::shader::metadata::assert, blender::gpu::shader::metadata::BaseInstance, BLI_assert_unreachable, CLIP_DISTANCES, blender::gpu::shader::metadata::ClipDistance, convert_builtin_bit(), blender::gpu::shader::metadata::drw_debug, FRAG_COORD, blender::gpu::shader::metadata::FragCoord, blender::gpu::shader::metadata::FragStencilRef, FRONT_FACING, blender::gpu::shader::metadata::FrontFacing, g_shader_use_printf, GLOBAL_INVOCATION_ID, blender::gpu::shader::metadata::GlobalInvocationID, INSTANCE_ID, blender::gpu::shader::metadata::InstanceID, blender::gpu::shader::metadata::InstanceIndex, LOCAL_INVOCATION_ID, LOCAL_INVOCATION_INDEX, blender::gpu::shader::metadata::LocalInvocationID, blender::gpu::shader::metadata::LocalInvocationIndex, NONE, NUM_WORK_GROUP, blender::gpu::shader::metadata::NumWorkGroup, POINT_COORD, POINT_SIZE, blender::gpu::shader::metadata::PointCoord, blender::gpu::shader::metadata::PointSize, PRIMITIVE_ID, blender::gpu::shader::metadata::PrimitiveID, blender::gpu::shader::metadata::printf, RUNTIME_GENERATED, blender::gpu::shader::metadata::runtime_generated, STENCIL_REF, USE_DEBUG_DRAW, USE_PRINTF, VERTEX_ID, blender::gpu::shader::metadata::VertexID, WORK_GROUP_ID, WORK_GROUP_SIZE, blender::gpu::shader::metadata::WorkGroupID, and blender::gpu::shader::metadata::WorkGroupSize.
Referenced by blender::gpu::GPUSource::add_builtin(), convert_builtin_bit(), and blender::GPU_shader_preprocess_source().
| blender::gpu::shader::ENUM_OPERATORS | ( | BuiltinBits | ) |
References ENUM_OPERATORS().
Referenced by ENUM_OPERATORS(), and ENUM_OPERATORS().
| blender::gpu::shader::ENUM_OPERATORS | ( | Qualifier | ) |
References ENUM_OPERATORS().
|
static |
Definition at line 22 of file namespace.cc.
References blender::gpu::shader::parser::Scope::front(), get_prefix(), lexit::Token::prev(), blender::gpu::shader::parser::Scope::scope(), and blender::gpu::shader::parser::Scope::type().
Referenced by get_prefix().
| bool blender::gpu::shader::gpu_shader_dependency_force_gpu_print_injection | ( | ) |
Definition at line 655 of file gpu_shader_dependency.cc.
References blender::force_printf_injection, and gpu_shader_dependency_force_gpu_print_injection().
Referenced by blender::gpu_shader_create_info_init(), and gpu_shader_dependency_force_gpu_print_injection().
| BuiltinBits blender::gpu::shader::gpu_shader_dependency_get_builtins | ( | const StringRefNull | shader_source_name | ) |
Definition at line 672 of file gpu_shader_dependency.cc.
References blender::BLI_assert(), blender::gpu::GPUSource::builtins_get(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::contains(), blender::g_sources, gpu_shader_dependency_get_builtins(), blender::blender::StringRefBase::is_empty(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup(), and NONE.
Referenced by blender::gpu_shader_create_info_init(), and gpu_shader_dependency_get_builtins().
| 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.
Definition at line 733 of file gpu_shader_dependency.cc.
References blender::g_sources, gpu_shader_dependency_get_filename_from_source_string(), and blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::values().
Referenced by blender::gpu::GLSource::GLSource(), gpu_shader_dependency_get_filename_from_source_string(), and blender::gpu::Shader::print_log().
| const PrintfFormat & blender::gpu::shader::gpu_shader_dependency_get_printf_format | ( | uint32_t | format_hash | ) |
Definition at line 667 of file gpu_shader_dependency.cc.
References blender::g_formats, gpu_shader_dependency_get_printf_format(), and blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup().
Referenced by gpu_shader_dependency_get_printf_format(), and blender::gpu::printf_end().
| Vector< StringRefNull > blender::gpu::shader::gpu_shader_dependency_get_resolved_source | ( | const StringRefNull | shader_source_name, |
| const shader::GeneratedSourceList & | generated_sources, | ||
| const StringRefNull | shader_name ) |
Definition at line 703 of file gpu_shader_dependency.cc.
References blender::gpu::GPUSource::build(), blender::StringRefNull::c_str(), CLG_LEVEL_TRACE, CLG_log_raw(), CLOG_CHECK, CLOG_TRACE, blender::g_sources, gpu_shader_dependency_get_resolved_source(), blender::LOG, blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_default(), and blender::result.
Referenced by blender::gpu::ShaderCompiler::compile(), blender::gpu::VKDevice::glsl_compute_patch_get(), blender::gpu::VKDevice::glsl_fragment_patch_get(), blender::gpu::VKDevice::glsl_geometry_patch_get(), blender::glsl_patch_compute_get(), blender::glsl_patch_fragment_get(), blender::glsl_patch_geometry_get(), blender::glsl_patch_vertex_get(), blender::gpu::VKDevice::glsl_vertex_patch_get(), and gpu_shader_dependency_get_resolved_source().
| Span< ShaderCreateInfo::SharedVariable > blender::gpu::shader::gpu_shader_dependency_get_shared_variables | ( | const StringRefNull | shader_source_name | ) |
Definition at line 687 of file gpu_shader_dependency.cc.
References blender::BLI_assert(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::contains(), blender::g_sources, gpu_shader_dependency_get_shared_variables(), blender::blender::StringRefBase::is_empty(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup(), and blender::gpu::GPUSource::shared_variables.
Referenced by blender::gpu_shader_create_info_init(), and gpu_shader_dependency_get_shared_variables().
| StringRefNull blender::gpu::shader::gpu_shader_dependency_get_source | ( | const StringRefNull | shader_source_name | ) |
Definition at line 724 of file gpu_shader_dependency.cc.
References blender::g_sources, gpu_shader_dependency_get_source(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_default(), and blender::gpu::GPUSource::source.
Referenced by gpu_shader_dependency_get_source(), and blender::gpu::tests::gpu_shader_lib_test().
| bool blender::gpu::shader::gpu_shader_dependency_has_printf | ( | ) |
Definition at line 662 of file gpu_shader_dependency.cc.
References blender::g_formats, g_shader_use_printf, and gpu_shader_dependency_has_printf().
Referenced by gpu_shader_dependency_has_printf(), and blender::gpu::printf_begin().
|
inlinestatic |
Definition at line 622 of file gpu_shader_create_info.hh.
References is_atomic_type().
Referenced by is_atomic_type().
|
static |
Definition at line 48 of file gpu_shader_create_info.cc.
References FLAT, blender::gpu::shader::StageInterfaceInfo::inouts, blender::gpu::shader::StageInterfaceInfo::instance_name, blender::gpu::shader::StageInterfaceInfo::InOut::interp, blender::blender::StringRefBase::is_empty(), is_vulkan_compatible_interface(), blender::gpu::shader::StageInterfaceInfo::name, NO_PERSPECTIVE, and SMOOTH.
Referenced by blender::gpu::shader::ShaderCreateInfo::is_vulkan_compatible(), and is_vulkan_compatible_interface().
|
inlinestatic |
Definition at line 18 of file processor.hh.
References BSL, CPP, blender::gpu::shader::parser::filename(), GLSL, INFO, language_from_filename(), MSL, and UNKNOWN.
Referenced by language_from_filename().
|
static |
Definition at line 176 of file namespace.cc.
References blender::gpu::shader::parser::Scope::back(), blender::gpu::shader::parser::Scope::foreach_match(), blender::gpu::shader::parser::Scope::foreach_scope(), blender::gpu::shader::parser::Scope::foreach_token(), blender::gpu::shader::parser::Scope::front(), blender::gpu::shader::parser::Scope::is_valid(), lower_namespace(), blender::gpu::shader::SourceProcessor::namespace_separator, lexit::Token::next(), lexit::Token::prev(), blender::gpu::shader::parser::ErrorHandler::report(), lexit::Token::str(), str, blender::gpu::shader::parser::TemplateArg, lexit::Token::type(), and lexit::Word.
Referenced by lower_namespace().
|
inlinestatic |
Definition at line 458 of file gpu_shader_create_info.hh.
References blender::GPU_CLOSURE, operator<<(), and to_type().
|
inlinestatic |
Definition at line 385 of file gpu_shader_create_info.hh.
References blender::BLI_assert(), bool_t, char2_t, char3_t, char4_t, char_t, float2_t, float3_10_10_10_2_t, float3_t, float3x3_t, float4_t, float4x4_t, float_t, int2_t, int3_t, int4_t, int_t, operator<<(), short2_t, short3_t, short4_t, short_t, uchar2_t, uchar3_t, uchar4_t, uchar_t, uint2_t, uint3_t, uint4_t, uint_t, ushort2_t, ushort3_t, ushort4_t, and ushort_t.
Referenced by operator<<(), and operator<<().
| std::ostream & blender::blender::operator<< | ( | std::ostream & | stream, |
| StringRef | ref ) |
|
static |
Definition at line 46 of file template.cc.
References blender::gpu::shader::parser::Scope::foreach_match(), blender::gpu::shader::parser::Scope::front(), lexit::Token::next(), parse_template_definition_args(), blender::gpu::shader::parser::ErrorHandler::report(), lexit::Token::str(), and str.
Referenced by parse_template_definition_args().
|
static |
Definition at line 769 of file processor.cc.
References lexit::Token::str(), str, and str_view_exclusive().
Referenced by str_view_exclusive().
| BLI_INLINE int blender::gpu::shader::to_component_count | ( | const Type & | type | ) |
Definition at line 136 of file GPU_common_types.hh.
References BLI_assert_unreachable, BLI_INLINE, bool_t, char2_t, char3_t, char4_t, char_t, float2_t, float3_10_10_10_2_t, float3_t, float3x3_t, float4_t, float4x4_t, float_t, int2_t, int3_t, int4_t, int_t, short2_t, short3_t, short4_t, short_t, to_component_count(), uchar2_t, uchar3_t, uchar4_t, uchar_t, uint2_t, uint3_t, uint4_t, uint_t, ushort2_t, ushort3_t, ushort4_t, and ushort_t.
Referenced by blender::gpu::GLShader::fragment_interface_declare(), blender::gpu::VKShader::fragment_interface_declare(), blender::gpu::padded_size(), and to_component_count().
Definition at line 344 of file gpu_shader_create_info.hh.
References BLI_assert_msg, bool_t, float2_t, float3_t, float3x3_t, float4_t, float4x4_t, float_t, blender::GPU_ATTR, blender::GPU_BOOL, blender::GPU_CLOSURE, blender::GPU_FLOAT, blender::GPU_INT, blender::GPU_INT2, blender::GPU_INT3, blender::GPU_INT4, blender::GPU_KERNEL_GLOBALS, blender::GPU_MAT3, blender::GPU_MAT4, blender::GPU_NONE, blender::GPU_SHADING_DATA, blender::GPU_TEX1D_ARRAY, blender::GPU_TEX2D, blender::GPU_TEX2D_ARRAY, blender::GPU_TEX3D, blender::GPU_VEC2, blender::GPU_VEC3, blender::GPU_VEC4, int2_t, int3_t, int4_t, int_t, and to_type().
Referenced by operator<<(), and to_type().
|
static |
Definition at line 40 of file gpu_shader_create_info.cc.
Referenced by blender::gpu_shader_create_info_compile_all(), blender::gpu_shader_create_info_exit(), blender::gpu_shader_create_info_get(), and blender::gpu_shader_create_info_init().
|
static |
Definition at line 41 of file gpu_shader_create_info.cc.
Referenced by blender::gpu_shader_create_info_exit(), and blender::gpu_shader_create_info_init().
|
static |
Definition at line 63 of file gpu_shader_dependency.cc.
Referenced by convert_builtin_bit(), and gpu_shader_dependency_has_printf().