]> git.tdb.fi Git - libs/gl.git/commitdiff
Fix incorrect exception messages
authorMikko Rasa <tdb@tdb.fi>
Mon, 11 Oct 2021 13:25:41 +0000 (16:25 +0300)
committerMikko Rasa <tdb@tdb.fi>
Mon, 11 Oct 2021 13:25:41 +0000 (16:25 +0300)
source/backends/opengl/program_backend.cpp
source/core/vertexsetup.cpp

index b902db5f6a99043df53af71632230ff9eed263e1..bd54fbaa788348d2358163759de2549e83afbaf8 100644 (file)
@@ -69,11 +69,11 @@ unsigned OpenGLProgram::add_stage(Stage type)
        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;
@@ -101,7 +101,7 @@ void OpenGLProgram::add_glsl_stages(const GlslModule &mod, const map<string, int
 
        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)
        {
@@ -111,7 +111,7 @@ void OpenGLProgram::add_glsl_stages(const GlslModule &mod, const map<string, int
                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);
@@ -177,14 +177,14 @@ void OpenGLProgram::add_spirv_stages(const SpirVModule &mod, const map<string, i
                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);
@@ -371,7 +371,7 @@ void OpenGLProgram::query_uniform_blocks(const vector<ReflectData::UniformInfo *
                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;
                }
index 7b346d8ecf5f497e53cb91d8cc65765e8fac5b01..50f9c1837d1eff8e6bf5bfdf89d956b2cec82827 100644 (file)
@@ -23,9 +23,9 @@ void VertexSetup::set_format(const VertexFormat &vfmt)
 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);