mirror of
https://github.com/allemangD/toddcox-visualize.git
synced 2025-11-10 12:02:47 -05:00
tweaking program pipeline construction
This commit is contained in:
@@ -206,30 +206,6 @@ namespace cgl {
|
||||
return id;
|
||||
}
|
||||
|
||||
void use_stages(const shaderprogram<GL_VERTEX_SHADER> &pgm) {
|
||||
glUseProgramStages(id, GL_VERTEX_SHADER_BIT, pgm);
|
||||
}
|
||||
|
||||
void use_stages(const shaderprogram<GL_TESS_CONTROL_SHADER> &pgm) {
|
||||
glUseProgramStages(id, GL_TESS_CONTROL_SHADER_BIT, pgm);
|
||||
}
|
||||
|
||||
void use_stages(const shaderprogram<GL_TESS_EVALUATION_SHADER> &pgm) {
|
||||
glUseProgramStages(id, GL_TESS_EVALUATION_SHADER_BIT, pgm);
|
||||
}
|
||||
|
||||
void use_stages(const shaderprogram<GL_GEOMETRY_SHADER> &pgm) {
|
||||
glUseProgramStages(id, GL_GEOMETRY_SHADER_BIT, pgm);
|
||||
}
|
||||
|
||||
void use_stages(const shaderprogram<GL_FRAGMENT_SHADER> &pgm) {
|
||||
glUseProgramStages(id, GL_FRAGMENT_SHADER_BIT, pgm);
|
||||
}
|
||||
|
||||
void use_stages(const shaderprogram<GL_COMPUTE_SHADER> &pgm) {
|
||||
glUseProgramStages(id, GL_COMPUTE_SHADER_BIT, pgm);
|
||||
}
|
||||
|
||||
[[nodiscard]] int get(GLenum pname) const {
|
||||
GLint res;
|
||||
glGetProgramPipelineiv(id, pname, &res);
|
||||
@@ -242,6 +218,36 @@ namespace cgl {
|
||||
glGetProgramPipelineInfoLog(id, len, nullptr, buffer);
|
||||
return std::string(buffer);
|
||||
}
|
||||
|
||||
pipeline &stage(const shaderprogram<GL_VERTEX_SHADER> &pgm) {
|
||||
glUseProgramStages(id, GL_VERTEX_SHADER_BIT, pgm);
|
||||
return *this;
|
||||
}
|
||||
|
||||
pipeline &stage(const shaderprogram<GL_TESS_CONTROL_SHADER> &pgm) {
|
||||
glUseProgramStages(id, GL_TESS_CONTROL_SHADER_BIT, pgm);
|
||||
return *this;
|
||||
}
|
||||
|
||||
pipeline &stage(const shaderprogram<GL_TESS_EVALUATION_SHADER> &pgm) {
|
||||
glUseProgramStages(id, GL_TESS_EVALUATION_SHADER_BIT, pgm);
|
||||
return *this;
|
||||
}
|
||||
|
||||
pipeline &stage(const shaderprogram<GL_GEOMETRY_SHADER> &pgm) {
|
||||
glUseProgramStages(id, GL_GEOMETRY_SHADER_BIT, pgm);
|
||||
return *this;
|
||||
}
|
||||
|
||||
pipeline &stage(const shaderprogram<GL_FRAGMENT_SHADER> &pgm) {
|
||||
glUseProgramStages(id, GL_FRAGMENT_SHADER_BIT, pgm);
|
||||
return *this;
|
||||
}
|
||||
|
||||
pipeline &stage(const shaderprogram<GL_COMPUTE_SHADER> &pgm) {
|
||||
glUseProgramStages(id, GL_COMPUTE_SHADER_BIT, pgm);
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
||||
namespace pgm {
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "combo_iterator.hpp"
|
||||
|
||||
/**
|
||||
* An primitive with N indices.
|
||||
* An primitive stage N indices.
|
||||
* @tparam N
|
||||
*/
|
||||
template<unsigned N>
|
||||
|
||||
Reference in New Issue
Block a user