Blender V4.5
blender::gpu::GLShader Class Reference

#include <gl_shader.hh>

Inherits blender::gpu::Shader.

Public Member Functions

void warm_cache (int) override
 
bool is_compute () const
 
Creation / Destruction
 GLShader (const char *name)
 
 ~GLShader ()
 
void init (const shader::ShaderCreateInfo &info, bool is_batch_compilation) override
 
void init () override
 
Create Info
std::string resources_declare (const shader::ShaderCreateInfo &info) const override
 
std::string constants_declare (const shader::SpecializationConstants &constants_state) const
 
std::string vertex_interface_declare (const shader::ShaderCreateInfo &info) const override
 
std::string fragment_interface_declare (const shader::ShaderCreateInfo &info) const override
 
std::string geometry_interface_declare (const shader::ShaderCreateInfo &info) const override
 
std::string geometry_layout_declare (const shader::ShaderCreateInfo &info) const override
 
std::string compute_layout_declare (const shader::ShaderCreateInfo &info) const override
 
Binding
void bind (const shader::SpecializationConstants *constants_state) override
 
void unbind () override
 
Uniforms setters
void uniform_float (int location, int comp_len, int array_size, const float *data) override
 
void uniform_int (int location, int comp_len, int array_size, const int *data) override
 
- Public Member Functions inherited from blender::gpu::Shader
std::string defines_declare (const shader::ShaderCreateInfo &info) const
 
StringRefNull name_get () const
 
void parent_set (Shader *parent)
 
Shaderparent_get () const
 
 Shader (const char *name)
 
virtual ~Shader ()
 
void specialization_constants_init (const shader::ShaderCreateInfo &info)
 

Friends

class GLSubprocessShaderCompiler
 
class GLShaderCompiler
 

Shader stage creation

void vertex_shader_from_glsl (MutableSpan< StringRefNull > sources) override
 
void geometry_shader_from_glsl (MutableSpan< StringRefNull > sources) override
 
void fragment_shader_from_glsl (MutableSpan< StringRefNull > sources) override
 
void compute_shader_from_glsl (MutableSpan< StringRefNull > sources) override
 
bool finalize (const shader::ShaderCreateInfo *info=nullptr) override
 
bool post_finalize (const shader::ShaderCreateInfo *info=nullptr)
 

Specialization Constants

GLSourcesBaked get_sources ()
 

Additional Inherited Members

- Static Public Member Functions inherited from blender::gpu::Shader
static void set_srgb_uniform (Context *ctx, GPUShader *shader)
 
static void set_framebuffer_srgb_target (int use_srgb_to_linear)
 
- Public Attributes inherited from blender::gpu::Shader
ShaderInterfaceinterface = nullptr
 
uint16_t fragment_output_bits = 0
 
std::unique_ptr< const shader::SpecializationConstantsconstants
 
bool is_polyline = false
 
- Protected Member Functions inherited from blender::gpu::Shader
void print_log (Span< StringRefNull > sources, const char *log, const char *stage, bool error, GPULogParser *parser)
 
- Protected Attributes inherited from blender::gpu::Shader
char name [64]
 
Shaderparent_shader_ = nullptr
 

Detailed Description

Implementation of shader compilation and uniforms handling using OpenGL.

Definition at line 69 of file gl_shader.hh.

Constructor & Destructor Documentation

◆ GLShader()

GLShader::GLShader ( const char * name)

Definition at line 54 of file gl_shader.cc.

References BLI_assert, and blender::gpu::GLContext::get().

◆ ~GLShader()

GLShader::~GLShader ( )

Definition at line 62 of file gl_shader.cc.

References BLI_assert, and blender::gpu::GLContext::get().

Member Function Documentation

◆ bind()

void GLShader::bind ( const shader::SpecializationConstants * constants_state)
overridevirtual

Implements blender::gpu::Shader.

Definition at line 1426 of file gl_shader.cc.

◆ compute_layout_declare()

std::string GLShader::compute_layout_declare ( const shader::ShaderCreateInfo & info) const
overridevirtual

Implements blender::gpu::Shader.

Definition at line 964 of file gl_shader.cc.

References info.

◆ compute_shader_from_glsl()

void GLShader::compute_shader_from_glsl ( MutableSpan< StringRefNull > sources)
overridevirtual

Implements blender::gpu::Shader.

Definition at line 1364 of file gl_shader.cc.

References blender::gpu::Shader::constants.

◆ constants_declare()

◆ finalize()

◆ fragment_interface_declare()

◆ fragment_shader_from_glsl()

void GLShader::fragment_shader_from_glsl ( MutableSpan< StringRefNull > sources)
overridevirtual

Implements blender::gpu::Shader.

Definition at line 1357 of file gl_shader.cc.

References blender::gpu::Shader::constants.

◆ geometry_interface_declare()

std::string GLShader::geometry_interface_declare ( const shader::ShaderCreateInfo & info) const
overridevirtual

◆ geometry_layout_declare()

std::string GLShader::geometry_layout_declare ( const shader::ShaderCreateInfo & info) const
overridevirtual

Implements blender::gpu::Shader.

Definition at line 912 of file gl_shader.cc.

References info, and blender::gpu::to_string().

◆ geometry_shader_from_glsl()

void GLShader::geometry_shader_from_glsl ( MutableSpan< StringRefNull > sources)
overridevirtual

Implements blender::gpu::Shader.

Definition at line 1350 of file gl_shader.cc.

References blender::gpu::Shader::constants.

Referenced by finalize().

◆ get_sources()

GLSourcesBaked GLShader::get_sources ( )

◆ init() [1/2]

void GLShader::init ( )
overridevirtual

◆ init() [2/2]

void GLShader::init ( const shader::ShaderCreateInfo & info,
bool is_batch_compilation )
overridevirtual

◆ is_compute()

bool blender::gpu::GLShader::is_compute ( ) const
inline

Definition at line 161 of file gl_shader.hh.

Referenced by blender::gpu::GLTexture::check_feedback_loop().

◆ post_finalize()

bool GLShader::post_finalize ( const shader::ShaderCreateInfo * info = nullptr)

Definition at line 1394 of file gl_shader.cc.

References info, log, new(), and blender::gpu::Shader::print_log().

Referenced by finalize().

◆ resources_declare()

std::string GLShader::resources_declare ( const shader::ShaderCreateInfo & info) const
overridevirtual

◆ unbind()

void GLShader::unbind ( )
overridevirtual

Implements blender::gpu::Shader.

Definition at line 1432 of file gl_shader.cc.

◆ uniform_float()

void GLShader::uniform_float ( int location,
int comp_len,
int array_size,
const float * data )
overridevirtual

Implements blender::gpu::Shader.

Definition at line 1445 of file gl_shader.cc.

References BLI_assert, and data.

◆ uniform_int()

void GLShader::uniform_int ( int location,
int comp_len,
int array_size,
const int * data )
overridevirtual

Implements blender::gpu::Shader.

Definition at line 1472 of file gl_shader.cc.

References BLI_assert, and data.

◆ vertex_interface_declare()

◆ vertex_shader_from_glsl()

void GLShader::vertex_shader_from_glsl ( MutableSpan< StringRefNull > sources)
overridevirtual

Return true on success.

Implements blender::gpu::Shader.

Definition at line 1343 of file gl_shader.cc.

References blender::gpu::Shader::constants.

◆ warm_cache()

void blender::gpu::GLShader::warm_cache ( int )
inlineoverridevirtual

Implements blender::gpu::Shader.

Definition at line 145 of file gl_shader.hh.

Friends And Related Symbol Documentation

◆ GLShaderCompiler

friend class GLShaderCompiler
friend

Definition at line 73 of file gl_shader.hh.

◆ GLSubprocessShaderCompiler

Definition at line 72 of file gl_shader.hh.


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