Blender V5.0
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
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_scene_linear_to_xyz_uniform (gpu::Shader *shader)
static void set_srgb_uniform (Context *ctx, gpu::Shader *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)

◆ ~GLShader()

GLShader::~GLShader ( )

Definition at line 68 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 1420 of file gl_shader.cc.

◆ compute_layout_declare()

◆ compute_shader_from_glsl()

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

Implements blender::gpu::Shader.

Definition at line 1358 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 1351 of file gl_shader.cc.

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

◆ geometry_interface_declare()

◆ geometry_layout_declare()

◆ geometry_shader_from_glsl()

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

Implements blender::gpu::Shader.

Definition at line 1344 of file gl_shader.cc.

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

Referenced by finalize().

◆ get_sources()

GLSourcesBaked GLShader::get_sources ( )

Definition at line 1668 of file gl_shader.cc.

References result.

◆ init()

◆ is_compute()

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

Definition at line 160 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 1388 of file gl_shader.cc.

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

Referenced by finalize().

◆ resources_declare()

◆ unbind()

void GLShader::unbind ( )
overridevirtual

Implements blender::gpu::Shader.

Definition at line 1426 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 1439 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 1466 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 1337 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 144 of file gl_shader.hh.

◆ GLShaderCompiler

friend class GLShaderCompiler
friend

Definition at line 73 of file gl_shader.hh.

References GLShaderCompiler.

Referenced by GLShaderCompiler.

◆ GLSubprocessShaderCompiler

friend class GLSubprocessShaderCompiler
friend

Definition at line 72 of file gl_shader.hh.

References GLSubprocessShaderCompiler.

Referenced by GLSubprocessShaderCompiler.


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