case VERTEX: { static Require _req(ARB_vertex_shader); gl_type = GL_VERTEX_SHADER; } break;
case GEOMETRY: { static Require _req(ARB_geometry_shader4); gl_type = GL_GEOMETRY_SHADER; } break;
case FRAGMENT: { static Require _req(ARB_fragment_shader); gl_type = GL_FRAGMENT_SHADER; } break;
- default: throw invalid_argument("Program::add_stage");
+ default: throw invalid_argument("OpenGLProgram::add_stage");
}
if(stage_ids[type])
- throw invalid_operation("Program::add_stage");
+ throw invalid_operation("OpenGLProgram::add_stage");
unsigned stage_id = glCreateShader(gl_type);
stage_ids[type] = stage_id;
vector<SL::Stage::Type> stages = compiler.get_stages();
if(stages.empty())
- throw invalid_argument("Program::add_glsl_stages");
+ throw invalid_argument("OpenGLProgram::add_glsl_stages");
for(SL::Stage::Type st: stages)
{
case SL::Stage::VERTEX: stage_id = add_stage(VERTEX); break;
case SL::Stage::GEOMETRY: stage_id = add_stage(GEOMETRY); break;
case SL::Stage::FRAGMENT: stage_id = add_stage(FRAGMENT); break;
- default: throw invalid_operation("Program::add_glsl_stages");
+ default: throw invalid_operation("OpenGLProgram::add_glsl_stages");
}
string stage_src = compiler.get_stage_glsl(st);
case SpirVModule::VERTEX: stage_id = add_stage(VERTEX); break;
case SpirVModule::GEOMETRY: stage_id = add_stage(GEOMETRY); break;
case SpirVModule::FRAGMENT: stage_id = add_stage(FRAGMENT); break;
- default: throw invalid_operation("Program::add_spirv_stages");
+ default: throw invalid_operation("OpenGLProgram::add_spirv_stages");
}
used_stage_ids[n_stages++] = stage_id;
}
if(!n_stages)
- throw invalid_argument("Program::add_spirv_stages");
+ throw invalid_argument("OpenGLProgram::add_spirv_stages");
const vector<uint32_t> &code = mod.get_code();
glShaderBinary(n_stages, used_stage_ids, GL_SHADER_BINARY_FORMAT_SPIR_V, &code[0], code.size()*4);
for(int j: indices)
{
if(!uniforms_by_index[j])
- throw logic_error("Program::link");
+ throw logic_error("OpenGLProgram::query_uniform_blocks");
info.uniforms.push_back(uniforms_by_index[j]);
uniforms_by_index[j]->block = &info;
}
void VertexSetup::set_format_instanced(const VertexFormat &vfmt, const VertexFormat &ifmt)
{
if(!verify_format(vfmt) || !verify_format(ifmt))
- throw invalid_argument("VertexSetup::set_format");
+ throw invalid_argument("VertexSetup::set_format_instanced");
if(!vertex_format.empty())
- throw invalid_operation("VertexSetup::set_format");
+ throw invalid_operation("VertexSetup::set_format_instanced");
require_format(vfmt, false);
require_format(ifmt, true);