11#ifndef CSCI441_SHADER_PROGRAM_PIPELINE_HPP
12#define CSCI441_SHADER_PROGRAM_PIPELINE_HPP
32 [[maybe_unused]]
static void enableDebugMessages();
37 [[maybe_unused]]
static void disableDebugMessages();
65 [[maybe_unused]]
void useProgramStages( GLbitfield programStages,
const ShaderProgram *shaderProgram )
const;
72 [[maybe_unused]]
void useProgramStages(
const ShaderProgram *shaderProgram )
const;
78 [[maybe_unused]]
void bindPipeline()
const;
83 [[maybe_unused]]
void printPipelineInfo()
const;
89 [[maybe_unused]] [[nodiscard]]
bool validatePipeline()
const;
94 GLuint _pipelineHandle;
100inline bool CSCI441::ShaderProgramPipeline::sDEBUG =
true;
113 glGenProgramPipelines(1,& _pipelineHandle);
117 glDeleteProgramPipelines(1, &_pipelineHandle);
133 glBindProgramPipeline( _pipelineHandle );
139 printf(
"\n[INFO]: /--------------------------------------------------------\\\n");
140 printf(
"[INFO]: | Program Pipeline: |\n");
141 printf(
"[INFO]: | Pipeline Handle: %4u %32c\n", _pipelineHandle,
'|' );
143 CSCI441_INTERNAL::ShaderUtils::printProgramPipelineLog(_pipelineHandle);
145 printf(
"[INFO]: >--------------------------------------------------------<\n");
147 GLint vs, tcs, tes, gs, fs;
148 glGetProgramPipelineiv( _pipelineHandle, GL_VERTEX_SHADER, &vs );
149 glGetProgramPipelineiv( _pipelineHandle, GL_TESS_CONTROL_SHADER, &tcs );
150 glGetProgramPipelineiv( _pipelineHandle, GL_TESS_EVALUATION_SHADER, &tes );
151 glGetProgramPipelineiv( _pipelineHandle, GL_GEOMETRY_SHADER, &gs );
152 glGetProgramPipelineiv( _pipelineHandle, GL_FRAGMENT_SHADER, &fs );
154 if( vs != 0 ) printf(
"[INFO]: | Vertex Shader Program Handle: %2d |\n", vs );
155 if( tcs != 0 ) printf(
"[INFO]: | Tess Ctrl Shader Program Handle: %2d |\n", tcs );
156 if( tes != 0 ) printf(
"[INFO]: | Tess Eval Shader Program Handle: %2d |\n", tes );
157 if( gs != 0 ) printf(
"[INFO]: | Geometry Shader Program Handle: %2d |\n", gs );
158 if( fs != 0 ) printf(
"[INFO]: | Fragment Shader Program Handle: %2d |\n", fs );
160 printf(
"[INFO]: \\--------------------------------------------------------/\n");
167 glValidateProgramPipeline(_pipelineHandle);
168 GLint validateStatus;
169 glGetProgramPipelineiv(_pipelineHandle, GL_VALIDATE_STATUS, &validateStatus);
170 return (validateStatus == GL_TRUE);
Class to work with OpenGL 4.0+ Shaders.
Handles registration and compilation of Shaders.
Definition: ShaderProgram.hpp:35
virtual GLbitfield getProgramStages() const final
returns a single value corresponding to which shader stages are present in this shader program
Definition: ShaderProgram.hpp:1999
virtual GLuint getShaderProgramHandle() const final
Returns the handle for this shader program.
Definition: ShaderProgram.hpp:1417
Handles registration and compilation of Shader Program Pipelines.
Definition: ShaderProgramPipeline.hpp:26
ShaderProgramPipeline(const ShaderProgramPipeline &)=delete
do not allow shader program pipelines to be copied
void useProgramStages(GLbitfield programStages, const ShaderProgram *shaderProgram) const
adds shader program stages to pipeline
Definition: ShaderProgramPipeline.hpp:121
ShaderProgramPipeline()
creates a shader program pipeline by generating a shader program pipeline handle
Definition: ShaderProgramPipeline.hpp:112
static void enableDebugMessages()
Enables debug messages from Shader Program functions.
Definition: ShaderProgramPipeline.hpp:103
bool validatePipeline() const
Definition: ShaderProgramPipeline.hpp:166
void bindPipeline() const
bind shader program pipeline
Definition: ShaderProgramPipeline.hpp:131
ShaderProgramPipeline & operator=(const ShaderProgramPipeline &)=delete
do not allow shader program pipelines to be copied
~ShaderProgramPipeline()
deletes a shader program pipeline by deleting the shader program pipeline handle
Definition: ShaderProgramPipeline.hpp:116
static void disableDebugMessages()
Disables debug messages from Shader Program functions.
Definition: ShaderProgramPipeline.hpp:108
void printPipelineInfo() const
prints shader program pipeline information to console
Definition: ShaderProgramPipeline.hpp:137
CSCI441 Helper Functions for OpenGL.
Definition: ArcballCam.hpp:17