Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
Renderer::Backend::GL::CShaderProgramARB Class Referencefinal
Inheritance diagram for Renderer::Backend::GL::CShaderProgramARB:
Collaboration diagram for Renderer::Backend::GL::CShaderProgramARB:

Classes

struct  BindingSlot
 

Public Member Functions

 CShaderProgramARB (CDevice *device, const VfsPath &path, const VfsPath &vertexFilePath, const VfsPath &fragmentFilePath, const CShaderDefines &defines, const std::map< CStrIntern, std::pair< CStr, int > > &vertexIndices, const std::map< CStrIntern, std::pair< CStr, int > > &fragmentIndices, int streamflags)
 
 ~CShaderProgramARB () override
 
bool Compile (GLuint target, const char *targetName, GLuint program, const VfsPath &file, const CStr &code)
 
void Bind (CShaderProgram *previousShaderProgram) override
 Binds the shader into the GL context. More...
 
void Unbind () override
 Unbinds the shader from the GL context. More...
 
IDeviceGetDevice () override
 
int32_t GetBindingSlot (const CStrIntern name) const override
 
TextureUnit GetTextureUnit (const int32_t bindingSlot) override
 
void SetUniform (const int32_t bindingSlot, const float value) override
 
void SetUniform (const int32_t bindingSlot, const float valueX, const float valueY) override
 
void SetUniform (const int32_t bindingSlot, const float valueX, const float valueY, const float valueZ) override
 
void SetUniform (const int32_t bindingSlot, const float valueX, const float valueY, const float valueZ, const float valueW) override
 
void SetUniform (const int32_t bindingSlot, PS::span< const float > values) override
 
std::vector< VfsPathGetFileDependencies () const override
 
- Public Member Functions inherited from Renderer::Backend::GL::CShaderProgram
 ~CShaderProgram () override
 
virtual void Bind (CShaderProgram *previousShaderProgram)=0
 Binds the shader into the GL context. More...
 
virtual void Unbind ()=0
 Unbinds the shader from the GL context. More...
 
virtual TextureUnit GetTextureUnit (const int32_t bindingSlot)=0
 
virtual void SetUniform (const int32_t bindingSlot, const float value)=0
 
virtual void SetUniform (const int32_t bindingSlot, const float valueX, const float valueY)=0
 
virtual void SetUniform (const int32_t bindingSlot, const float valueX, const float valueY, const float valueZ)=0
 
virtual void SetUniform (const int32_t bindingSlot, const float valueX, const float valueY, const float valueZ, const float valueW)=0
 
virtual void SetUniform (const int32_t bindingSlot, PS::span< const float > values)=0
 
virtual void VertexAttribPointer (const VertexAttributeStream stream, const Format format, const uint32_t offset, const uint32_t stride, const VertexAttributeRate rate, const void *data)
 
bool IsStreamActive (const VertexAttributeStream stream) const
 
void AssertPointersBound ()
 Checks that all the required vertex attributes have been set. More...
 
virtual int32_t GetBindingSlot (const CStrIntern name) const =0
 
virtual std::vector< VfsPathGetFileDependencies () const =0
 
- Public Member Functions inherited from Renderer::Backend::IDeviceObject< IShaderProgram >
virtual ~IDeviceObject ()
 
virtual IDeviceGetDevice ()=0
 
TAs ()
 

Private Member Functions

BindingSlotGetOrCreateBindingSlot (const CStrIntern name)
 
void SetUniform (const BindingSlot &bindingSlot, const float v0, const float v1, const float v2, const float v3)
 
void SetUniform (const GLenum target, const int location, const float v0, const float v1, const float v2, const float v3)
 
void SetUniformMatrix (const BindingSlot &bindingSlot, PS::span< const float > values)
 
void SetUniformMatrix (const GLenum target, const int location, PS::span< const float > values)
 

Private Attributes

CDevicem_Device = nullptr
 
std::vector< VfsPathm_FileDependencies
 
GLuint m_VertexProgram
 
GLuint m_FragmentProgram
 
std::vector< BindingSlotm_BindingSlots
 
std::unordered_map< CStrIntern, int32_t > m_BindingSlotsMapping
 

Additional Inherited Members

- Public Types inherited from Renderer::Backend::GL::CShaderProgram
typedef CStrIntern attrib_id_t
 
- Static Public Member Functions inherited from Renderer::Backend::GL::CShaderProgram
static std::unique_ptr< CShaderProgramCreate (CDevice *device, const CStr &name, const CShaderDefines &baseDefines)
 
- Protected Member Functions inherited from Renderer::Backend::GL::CShaderProgram
 CShaderProgram (int streamflags)
 
void VertexPointer (const Renderer::Backend::Format format, GLsizei stride, const void *pointer)
 
void NormalPointer (const Renderer::Backend::Format format, GLsizei stride, const void *pointer)
 
void ColorPointer (const Renderer::Backend::Format format, GLsizei stride, const void *pointer)
 
void TexCoordPointer (GLenum texture, const Renderer::Backend::Format format, GLsizei stride, const void *pointer)
 
void BindClientStates ()
 
void UnbindClientStates ()
 
- Protected Attributes inherited from Renderer::Backend::GL::CShaderProgram
int m_StreamFlags
 
int m_ValidStreams
 

Constructor & Destructor Documentation

◆ CShaderProgramARB()

Renderer::Backend::GL::CShaderProgramARB::CShaderProgramARB ( CDevice device,
const VfsPath path,
const VfsPath vertexFilePath,
const VfsPath fragmentFilePath,
const CShaderDefines defines,
const std::map< CStrIntern, std::pair< CStr, int > > &  vertexIndices,
const std::map< CStrIntern, std::pair< CStr, int > > &  fragmentIndices,
int  streamflags 
)
inline

◆ ~CShaderProgramARB()

Renderer::Backend::GL::CShaderProgramARB::~CShaderProgramARB ( )
inlineoverride

Member Function Documentation

◆ Bind()

void Renderer::Backend::GL::CShaderProgramARB::Bind ( CShaderProgram previousShaderProgram)
inlineoverridevirtual

Binds the shader into the GL context.

Call this before calling Uniform() or trying to render with it.

Implements Renderer::Backend::GL::CShaderProgram.

◆ Compile()

bool Renderer::Backend::GL::CShaderProgramARB::Compile ( GLuint  target,
const char *  targetName,
GLuint  program,
const VfsPath file,
const CStr &  code 
)
inline

◆ GetBindingSlot()

int32_t Renderer::Backend::GL::CShaderProgramARB::GetBindingSlot ( const CStrIntern  name) const
inlineoverridevirtual

◆ GetDevice()

IDevice * Renderer::Backend::GL::CShaderProgramARB::GetDevice ( )
inlineoverridevirtual

◆ GetFileDependencies()

std::vector< VfsPath > Renderer::Backend::GL::CShaderProgramARB::GetFileDependencies ( ) const
inlineoverridevirtual

◆ GetOrCreateBindingSlot()

BindingSlot & Renderer::Backend::GL::CShaderProgramARB::GetOrCreateBindingSlot ( const CStrIntern  name)
inlineprivate

◆ GetTextureUnit()

TextureUnit Renderer::Backend::GL::CShaderProgramARB::GetTextureUnit ( const int32_t  bindingSlot)
inlineoverridevirtual

◆ SetUniform() [1/7]

void Renderer::Backend::GL::CShaderProgramARB::SetUniform ( const BindingSlot bindingSlot,
const float  v0,
const float  v1,
const float  v2,
const float  v3 
)
inlineprivate

◆ SetUniform() [2/7]

void Renderer::Backend::GL::CShaderProgramARB::SetUniform ( const GLenum  target,
const int  location,
const float  v0,
const float  v1,
const float  v2,
const float  v3 
)
inlineprivate

◆ SetUniform() [3/7]

void Renderer::Backend::GL::CShaderProgramARB::SetUniform ( const int32_t  bindingSlot,
const float  value 
)
inlineoverridevirtual

◆ SetUniform() [4/7]

void Renderer::Backend::GL::CShaderProgramARB::SetUniform ( const int32_t  bindingSlot,
const float  valueX,
const float  valueY 
)
inlineoverridevirtual

◆ SetUniform() [5/7]

void Renderer::Backend::GL::CShaderProgramARB::SetUniform ( const int32_t  bindingSlot,
const float  valueX,
const float  valueY,
const float  valueZ 
)
inlineoverridevirtual

◆ SetUniform() [6/7]

void Renderer::Backend::GL::CShaderProgramARB::SetUniform ( const int32_t  bindingSlot,
const float  valueX,
const float  valueY,
const float  valueZ,
const float  valueW 
)
inlineoverridevirtual

◆ SetUniform() [7/7]

void Renderer::Backend::GL::CShaderProgramARB::SetUniform ( const int32_t  bindingSlot,
PS::span< const float >  values 
)
inlineoverridevirtual

◆ SetUniformMatrix() [1/2]

void Renderer::Backend::GL::CShaderProgramARB::SetUniformMatrix ( const BindingSlot bindingSlot,
PS::span< const float >  values 
)
inlineprivate

◆ SetUniformMatrix() [2/2]

void Renderer::Backend::GL::CShaderProgramARB::SetUniformMatrix ( const GLenum  target,
const int  location,
PS::span< const float >  values 
)
inlineprivate

◆ Unbind()

void Renderer::Backend::GL::CShaderProgramARB::Unbind ( )
inlineoverridevirtual

Unbinds the shader from the GL context.

Call this after rendering with it.

Implements Renderer::Backend::GL::CShaderProgram.

Member Data Documentation

◆ m_BindingSlots

std::vector<BindingSlot> Renderer::Backend::GL::CShaderProgramARB::m_BindingSlots
private

◆ m_BindingSlotsMapping

std::unordered_map<CStrIntern, int32_t> Renderer::Backend::GL::CShaderProgramARB::m_BindingSlotsMapping
private

◆ m_Device

CDevice* Renderer::Backend::GL::CShaderProgramARB::m_Device = nullptr
private

◆ m_FileDependencies

std::vector<VfsPath> Renderer::Backend::GL::CShaderProgramARB::m_FileDependencies
private

◆ m_FragmentProgram

GLuint Renderer::Backend::GL::CShaderProgramARB::m_FragmentProgram
private

◆ m_VertexProgram

GLuint Renderer::Backend::GL::CShaderProgramARB::m_VertexProgram
private

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