Blender V5.0
blender::gpu::ShaderCompiler Class Reference

#include <gpu_shader_private.hh>

Inherited by blender::gpu::GLShaderCompiler, blender::gpu::GLSubprocessShaderCompiler, and blender::gpu::MTLShaderCompiler.

Public Member Functions

virtual void specialize_shader (ShaderSpecialization &)

Protected Member Functions

void destruct_compilation_worker ()

ShaderCompiler

 ShaderCompiler (uint32_t threads_count=1, GPUWorker::ContextType context_type=GPUWorker::ContextType::PerThread, bool support_specializations=false)
virtual ~ShaderCompiler ()
Shadercompile (const shader::ShaderCreateInfo &info, bool is_batch_compilation)
virtual Shadercompile_shader (const shader::ShaderCreateInfo &info)
BatchHandle batch_compile (Span< const shader::ShaderCreateInfo * > &infos, CompilationPriority priority)
void batch_cancel (BatchHandle &handle)
bool batch_is_ready (BatchHandle handle)
Vector< Shader * > batch_finalize (BatchHandle &handle)
SpecializationBatchHandle precompile_specializations (Span< ShaderSpecialization > specializations, CompilationPriority priority)
bool specialization_batch_is_ready (SpecializationBatchHandle &handle)
bool is_compiling ()
void wait_for_all ()

Detailed Description

Definition at line 130 of file gpu_shader_private.hh.

Constructor & Destructor Documentation

◆ ShaderCompiler()

blender::gpu::ShaderCompiler::ShaderCompiler ( uint32_t threads_count = 1,
GPUWorker::ContextType context_type = GPUWorker::ContextType::PerThread,
bool support_specializations = false )

◆ ~ShaderCompiler()

blender::gpu::ShaderCompiler::~ShaderCompiler ( )
virtual

Definition at line 865 of file gpu_shader.cc.

References BLI_assert.

Member Function Documentation

◆ batch_cancel()

void blender::gpu::ShaderCompiler::batch_cancel ( BatchHandle & handle)

Definition at line 907 of file gpu_shader.cc.

References batch, and lock.

Referenced by GPU_shader_batch_cancel(), and GPU_shader_batch_specializations_cancel().

◆ batch_compile()

BatchHandle blender::gpu::ShaderCompiler::batch_compile ( Span< const shader::ShaderCreateInfo * > & infos,
CompilationPriority priority )

◆ batch_finalize()

Vector< Shader * > blender::gpu::ShaderCompiler::batch_finalize ( BatchHandle & handle)

Definition at line 930 of file gpu_shader.cc.

References batch, and lock.

Referenced by GPU_shader_batch_finalize().

◆ batch_is_ready()

bool blender::gpu::ShaderCompiler::batch_is_ready ( BatchHandle handle)

Definition at line 923 of file gpu_shader.cc.

References lock.

Referenced by GPU_shader_batch_is_ready(), and specialization_batch_is_ready().

◆ compile()

Shader * blender::gpu::ShaderCompiler::compile ( const shader::ShaderCreateInfo & info,
bool is_batch_compilation )

Definition at line 665 of file gpu_shader.cc.

References blender::gpu::ProfileReport::add_group_cpu(), blender::Vector< T, InlineBufferCapacity, Allocator >::append(), BLI_assert, blender::StringRefNull::c_str(), blender::gpu::shader::ShaderCreateInfo::check_error(), blender::gpu::shader::ShaderCreateInfo::compute_entry_fn_, blender::gpu::shader::ShaderCreateInfo::compute_source_, blender::gpu::shader::ShaderCreateInfo::compute_source_generated, blender::gpu::shader::ShaderCreateInfo::do_static_compilation_, error(), blender::Vector< T, InlineBufferCapacity, Allocator >::extend(), blender::Vector< T, InlineBufferCapacity, Allocator >::extend_non_duplicates(), blender::gpu::shader::ShaderCreateInfo::fragment_outputs_, blender::gpu::shader::ShaderCreateInfo::fragment_source_, G, blender::gpu::shader::ShaderCreateInfo::generated_sources, blender::gpu::shader::ShaderCreateInfo::geometry_source_, blender::gpu::Context::get(), blender::gpu::GPUBackend::get(), blender::gpu::ProfileReport::get(), GPU_debug_group_begin(), GPU_debug_group_end(), GPU_DEBUG_SHADER_COMPILATION_GROUP, blender::gpu::shader::gpu_shader_dependency_get_resolved_source(), blender::gpu::shader::gpu_shader_dependency_get_source(), blender::gpu::shader::ShaderCreateInfo::FragOut::index, blender::StringRefBase::is_empty(), blender::gpu::shader::ShaderCreateInfo::is_generated_, blender::gpu::shader::ShaderCreateInfo::name_, blender::gpu::shader::ShaderCreateInfo::resource_guard_defines(), blender::gpu::GPUBackend::shader_alloc(), standard_defines(), blender::gpu::shader::ShaderCreateInfo::typedef_source_generated, blender::gpu::shader::ShaderCreateInfo::typedef_sources_, and blender::gpu::shader::ShaderCreateInfo::vertex_source_.

Referenced by batch_compile(), blender::gpu::MTLShaderCompiler::compile_shader(), compile_shader(), GPU_shader_create_from_info(), and GPU_shader_create_from_info_python().

◆ compile_shader()

Shader * blender::gpu::ShaderCompiler::compile_shader ( const shader::ShaderCreateInfo & info)
virtual

Reimplemented in blender::gpu::MTLShaderCompiler.

Definition at line 873 of file gpu_shader.cc.

References compile().

◆ destruct_compilation_worker()

void blender::gpu::ShaderCompiler::destruct_compilation_worker ( )
inlineprotected

Definition at line 262 of file gpu_shader_private.hh.

◆ is_compiling()

bool blender::gpu::ShaderCompiler::is_compiling ( )

Definition at line 1035 of file gpu_shader.cc.

References lock.

Referenced by GPU_shader_batch_is_compiling().

◆ precompile_specializations()

SpecializationBatchHandle blender::gpu::ShaderCompiler::precompile_specializations ( Span< ShaderSpecialization > specializations,
CompilationPriority priority )

◆ specialization_batch_is_ready()

bool blender::gpu::ShaderCompiler::specialization_batch_is_ready ( SpecializationBatchHandle & handle)

Definition at line 969 of file gpu_shader.cc.

References batch, batch_is_ready(), and lock.

Referenced by GPU_shader_batch_specializations_is_ready().

◆ specialize_shader()

virtual void blender::gpu::ShaderCompiler::specialize_shader ( ShaderSpecialization & )
inlinevirtual

◆ wait_for_all()

void blender::gpu::ShaderCompiler::wait_for_all ( )

Definition at line 1041 of file gpu_shader.cc.

References lock.

Referenced by GPU_shader_batch_wait_for_all().


The documentation for this class was generated from the following files: