Blender  V2.93
Public Member Functions | Public Attributes | Protected Attributes | List of all members
blender::gpu::Shader Class Referenceabstract

#include <gpu_shader_private.hh>

Inherited by blender::gpu::GLShader.

Public Member Functions

virtual void vertex_shader_from_glsl (MutableSpan< const char * > sources)=0
 
virtual void geometry_shader_from_glsl (MutableSpan< const char * > sources)=0
 
virtual void fragment_shader_from_glsl (MutableSpan< const char * > sources)=0
 
virtual bool finalize (void)=0
 
virtual void transform_feedback_names_set (Span< const char * > name_list, const eGPUShaderTFBType geom_type)=0
 
virtual bool transform_feedback_enable (GPUVertBuf *)=0
 
virtual void transform_feedback_disable (void)=0
 
virtual void bind (void)=0
 
virtual void unbind (void)=0
 
virtual void uniform_float (int location, int comp_len, int array_size, const float *data)=0
 
virtual void uniform_int (int location, int comp_len, int array_size, const int *data)=0
 
virtual void vertformat_from_shader (GPUVertFormat *) const =0
 
virtual int program_handle_get (void) const =0
 
const char *const name_get (void) const
 
Creation / Destruction
 Shader (const char *name)
 
virtual ~Shader ()
 

Public Attributes

ShaderInterfaceinterface = nullptr
 

Protected Member Functions

Debug functions
void print_log (Span< const char * > sources, char *log, const char *stage, const bool error)
 

Protected Attributes

char name [64]
 

Detailed Description

Implementation of shader compilation and uniforms handling. Base class which is then specialized for each implementation (GL, VK, ...).

Definition at line 36 of file gpu_shader_private.hh.

Constructor & Destructor Documentation

◆ Shader()

Shader::Shader ( const char *  name)

Definition at line 249 of file gpu_shader.cc.

References BLI_strncpy(), and name.

◆ ~Shader()

Shader::~Shader ( )
virtual

Definition at line 254 of file gpu_shader.cc.

References interface.

Member Function Documentation

◆ bind()

virtual void blender::gpu::Shader::bind ( void  )
pure virtual

Implemented in blender::gpu::GLShader.

◆ finalize()

virtual bool blender::gpu::Shader::finalize ( void  )
pure virtual

Implemented in blender::gpu::GLShader.

◆ fragment_shader_from_glsl()

virtual void blender::gpu::Shader::fragment_shader_from_glsl ( MutableSpan< const char * >  sources)
pure virtual

Implemented in blender::gpu::GLShader.

◆ geometry_shader_from_glsl()

virtual void blender::gpu::Shader::geometry_shader_from_glsl ( MutableSpan< const char * >  sources)
pure virtual

Implemented in blender::gpu::GLShader.

◆ name_get()

const char* const blender::gpu::Shader::name_get ( void  ) const
inline

Definition at line 70 of file gpu_shader_private.hh.

References name.

Referenced by blender::gpu::debug::check_gl_resources().

◆ print_log()

void Shader::print_log ( Span< const char * >  sources,
char *  log,
const char *  stage,
const bool  error 
)
protected

◆ program_handle_get()

virtual int blender::gpu::Shader::program_handle_get ( void  ) const
pure virtual

Implemented in blender::gpu::GLShader.

◆ transform_feedback_disable()

virtual void blender::gpu::Shader::transform_feedback_disable ( void  )
pure virtual

Implemented in blender::gpu::GLShader.

◆ transform_feedback_enable()

virtual bool blender::gpu::Shader::transform_feedback_enable ( GPUVertBuf )
pure virtual

Implemented in blender::gpu::GLShader.

◆ transform_feedback_names_set()

virtual void blender::gpu::Shader::transform_feedback_names_set ( Span< const char * >  name_list,
const eGPUShaderTFBType  geom_type 
)
pure virtual

Implemented in blender::gpu::GLShader.

◆ unbind()

virtual void blender::gpu::Shader::unbind ( void  )
pure virtual

Implemented in blender::gpu::GLShader.

Referenced by GPU_shader_unbind().

◆ uniform_float()

virtual void blender::gpu::Shader::uniform_float ( int  location,
int  comp_len,
int  array_size,
const float data 
)
pure virtual

Implemented in blender::gpu::GLShader.

◆ uniform_int()

virtual void blender::gpu::Shader::uniform_int ( int  location,
int  comp_len,
int  array_size,
const int *  data 
)
pure virtual

Implemented in blender::gpu::GLShader.

◆ vertex_shader_from_glsl()

virtual void blender::gpu::Shader::vertex_shader_from_glsl ( MutableSpan< const char * >  sources)
pure virtual

Implemented in blender::gpu::GLShader.

◆ vertformat_from_shader()

virtual void blender::gpu::Shader::vertformat_from_shader ( GPUVertFormat ) const
pure virtual

Implemented in blender::gpu::GLShader.

Member Data Documentation

◆ interface

ShaderInterface* blender::gpu::Shader::interface = nullptr

Uniform & attribute locations for shader.

Definition at line 39 of file gpu_shader_private.hh.

Referenced by ~Shader().

◆ name

char blender::gpu::Shader::name[64]
protected

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