Blender V5.3
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 (const 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 ()
Shader * compile (const shader::ShaderCreateInfo &info, bool is_codegen_only)
virtual Shader * compile_shader (const shader::ShaderCreateInfo &info)
AsyncCompilationHandle async_compilation (const shader::ShaderCreateInfo *info, CompilationPriority priority)
void async_compilation_cancel (AsyncCompilationHandle &handle)
bool async_compilation_is_ready (AsyncCompilationHandle handle)
Shader * async_compilation_finalize (AsyncCompilationHandle &handle)
AsyncSpecializationHandle async_specialization (const ShaderSpecialization &specialization, CompilationPriority priority)
bool async_specialization_is_ready (AsyncSpecializationHandle &handle)
bool is_compiling ()
void wait_for_all ()
void pause_all ()
void continue_all ()

Detailed Description

Definition at line 162 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 1067 of file gpu_shader.cc.

References blender::BLI_assert(), and ~ShaderCompiler().

Referenced by ~ShaderCompiler().

Member Function Documentation

◆ async_compilation()

AsyncCompilationHandle blender::gpu::ShaderCompiler::async_compilation ( const shader::ShaderCreateInfo * info,
CompilationPriority priority )

◆ async_compilation_cancel()

void blender::gpu::ShaderCompiler::async_compilation_cancel ( AsyncCompilationHandle & handle)

◆ async_compilation_finalize()

Shader * blender::gpu::ShaderCompiler::async_compilation_finalize ( AsyncCompilationHandle & handle)

◆ async_compilation_is_ready()

bool blender::gpu::ShaderCompiler::async_compilation_is_ready ( AsyncCompilationHandle handle)

◆ async_specialization()

AsyncSpecializationHandle blender::gpu::ShaderCompiler::async_specialization ( const ShaderSpecialization & specialization,
CompilationPriority priority )

◆ async_specialization_is_ready()

bool blender::gpu::ShaderCompiler::async_specialization_is_ready ( AsyncSpecializationHandle & handle)

◆ compile()

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

Definition at line 795 of file gpu_shader.cc.

References blender::gpu::shader::ShaderCreateInfo::batch_resources_, blender::BLI_assert(), blender::gpu::shader::ShaderCreateInfo::builtins(), blender::gpu::shader::ShaderCreateInfo::builtins_, blender::gpu::shader::ShaderCreateInfo::builtins_combined(), blender::gpu::shader::ShaderCreateInfo::check_error(), CLOG_DEBUG, blender::gpu::shader::ShaderCreateInfo::compilation_constants_, compile(), blender::gpu::shader::ShaderCreateInfo::compute_entry_fn_, blender::gpu::shader::ShaderCreateInfo::compute_source_, blender::gpu::shader::ShaderCreateInfo::do_static_compilation_, blender::gpu::shader::ShaderCreateInfo::fragment_entry_fn_, blender::gpu::shader::ShaderCreateInfo::fragment_outputs_, blender::gpu::shader::ShaderCreateInfo::fragment_source_, blender::G, blender::gpu::shader::ShaderCreateInfo::generated_sources, blender::gpu::shader::ShaderCreateInfo::geometry_resources_, blender::gpu::shader::ShaderCreateInfo::geometry_source_, blender::gpu::Context::get(), blender::gpu::GPUBackend::get(), blender::gpu::ProfileReport::get(), blender::GPU_debug_group_begin(), blender::GPU_debug_group_end(), GPU_DEBUG_SHADER_COMPILATION_GROUP, blender::gpu::shader::gpu_shader_dependency_get_resolved_source(), blender::gpu::shader::ShaderCreateInfo::iface_guard_defines(), blender::gpu::shader::ShaderCreateInfo::FragOut::index, blender::blender::StringRefBase::is_empty(), blender::gpu::shader::ShaderCreateInfo::is_generated_, blender::LOG, blender::gpu::shader::ShaderCreateInfo::name_, blender::gpu::shader::NO_PREPROCESSOR, blender::gpu::shader::NONE, blender::gpu::shader::ShaderCreateInfo::pass_resources_, blender::gpu::shader::ShaderCreateInfo::push_constants_, blender::gpu::shader::ShaderCreateInfo::resource_guard_defines(), blender::standard_defines(), blender::gpu::shader::ShaderCreateInfo::vertex_entry_fn_, blender::gpu::shader::ShaderCreateInfo::vertex_inputs_, blender::gpu::shader::ShaderCreateInfo::vertex_out_interfaces_, and blender::gpu::shader::ShaderCreateInfo::vertex_source_.

Referenced by async_compilation(), compile(), blender::gpu::MTLShaderCompiler::compile_shader(), compile_shader(), blender::GPU_shader_create_from_info(), and blender::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 1075 of file gpu_shader.cc.

References compile(), and compile_shader().

Referenced by compile_shader().

◆ continue_all()

void blender::gpu::ShaderCompiler::continue_all ( )

Definition at line 1263 of file gpu_shader.cc.

References blender::BLI_assert(), continue_all(), and lock.

Referenced by continue_all(), and blender::GPU_shader_compiler_resume().

◆ destruct_compilation_worker()

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

Definition at line 213 of file gpu_shader_private.hh.

◆ is_compiling()

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

Definition at line 1241 of file gpu_shader.cc.

References is_compiling(), and lock.

Referenced by blender::GPU_shader_compiler_has_pending_work(), and is_compiling().

◆ pause_all()

void blender::gpu::ShaderCompiler::pause_all ( )

Definition at line 1256 of file gpu_shader.cc.

References blender::BLI_assert(), lock, and pause_all().

Referenced by blender::GPU_shader_compiler_pause(), and pause_all().

◆ specialize_shader()

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

◆ wait_for_all()

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

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