[Mesa-dev] [PATCH 2/3] linker: Add carriage returns on several linker errors

Andres Gomez agomez at igalia.com
Tue Nov 18 05:49:35 PST 2014


---
 src/glsl/linker.cpp | 40 ++++++++++++++++++++--------------------
 1 file changed, 20 insertions(+), 20 deletions(-)

diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index 2d31801..794efdc 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -642,7 +642,7 @@ validate_geometry_shader_emissions(struct gl_context *ctx,
       emit_vertex.run(prog->_LinkedShaders[MESA_SHADER_GEOMETRY]->ir);
       if (emit_vertex.error()) {
          linker_error(prog, "Invalid call %s(%d). Accepted values for the "
-                      "stream parameter are in the range [0, %d].",
+                      "stream parameter are in the range [0, %d].\n",
                       emit_vertex.error_func(),
                       emit_vertex.error_stream(),
                       ctx->Const.MaxVertexStreams - 1);
@@ -676,7 +676,7 @@ validate_geometry_shader_emissions(struct gl_context *ctx,
        */
       if (prog->Geom.UsesStreams && prog->Geom.OutputType != GL_POINTS) {
          linker_error(prog, "EmitStreamVertex(n) and EndStreamPrimitive(n) "
-                      "with n>0 requires point output");
+                      "with n>0 requires point output\n");
       }
    }
 }
@@ -808,7 +808,7 @@ cross_validate_globals(struct gl_shader_program *prog,
 		  linker_error(prog,
 			       "All redeclarations of gl_FragDepth in all "
 			       "fragment shaders in a single program must have "
-			       "the same set of qualifiers.");
+			       "the same set of qualifiers.\n");
 	       }
 
 	       if (var->data.used && layout_differs) {
@@ -817,7 +817,7 @@ cross_validate_globals(struct gl_shader_program *prog,
 			       "qualifier in any fragment shader, it must be "
 			       "redeclared with the same layout qualifier in "
 			       "all fragment shaders that have assignments to "
-			       "gl_FragDepth");
+			       "gl_FragDepth\n");
 	       }
 	    }
 
@@ -948,7 +948,7 @@ interstage_cross_validate_uniform_blocks(struct gl_shader_program *prog)
 						       &sh->UniformBlocks[j]);
 
 	 if (index == -1) {
-	    linker_error(prog, "uniform block `%s' has mismatching definitions",
+	    linker_error(prog, "uniform block `%s' has mismatching definitions\n",
 			 sh->UniformBlocks[j].Name);
 	    return false;
 	 }
@@ -1635,7 +1635,7 @@ link_intrastage_shaders(void *mem_ctx,
 
 	       if ((other_sig != NULL) && other_sig->is_defined
 		   && !other_sig->is_builtin()) {
-		  linker_error(prog, "function `%s' is multiply defined",
+		  linker_error(prog, "function `%s' is multiply defined\n",
 			       f->name);
 		  return NULL;
 	       }
@@ -2086,7 +2086,7 @@ assign_attribute_or_color_locations(gl_shader_program *prog,
             if (attr + slots > max_index) {
                linker_error(prog,
                            "insufficient contiguous locations "
-                           "available for %s `%s' %d %d %d", string,
+                           "available for %s `%s' %d %d %d\n", string,
                            var->name, used_locations, use_mask, attr);
                return false;
             }
@@ -2155,7 +2155,7 @@ assign_attribute_or_color_locations(gl_shader_program *prog,
 
 	 linker_error(prog,
 		      "insufficient contiguous locations "
-		      "available for %s `%s'",
+		      "available for %s `%s'\n",
 		      string, to_assign[i].var->name);
 	 return false;
       }
@@ -2257,7 +2257,7 @@ check_resources(struct gl_context *ctx, struct gl_shader_program *prog)
 	 continue;
 
       if (sh->num_samplers > ctx->Const.Program[i].MaxTextureImageUnits) {
-	 linker_error(prog, "Too many %s shader texture samplers",
+	 linker_error(prog, "Too many %s shader texture samplers\n",
 		      _mesa_shader_stage_to_string(i));
       }
 
@@ -2271,7 +2271,7 @@ check_resources(struct gl_context *ctx, struct gl_shader_program *prog)
                            _mesa_shader_stage_to_string(i));
          } else {
             linker_error(prog, "Too many %s shader default uniform block "
-			 "components",
+			 "components\n",
                          _mesa_shader_stage_to_string(i));
          }
       }
@@ -2284,7 +2284,7 @@ check_resources(struct gl_context *ctx, struct gl_shader_program *prog)
                            "this is non-portable out-of-spec behavior\n",
                            _mesa_shader_stage_to_string(i));
          } else {
-            linker_error(prog, "Too many %s shader uniform components",
+            linker_error(prog, "Too many %s shader uniform components\n",
                          _mesa_shader_stage_to_string(i));
          }
       }
@@ -2302,7 +2302,7 @@ check_resources(struct gl_context *ctx, struct gl_shader_program *prog)
       }
 
       if (total_uniform_blocks > ctx->Const.MaxCombinedUniformBlocks) {
-	 linker_error(prog, "Too many combined uniform blocks (%d/%d)",
+	 linker_error(prog, "Too many combined uniform blocks (%d/%d)\n",
 		      prog->NumUniformBlocks,
 		      ctx->Const.MaxCombinedUniformBlocks);
       } else {
@@ -2310,7 +2310,7 @@ check_resources(struct gl_context *ctx, struct gl_shader_program *prog)
             const unsigned max_uniform_blocks =
                ctx->Const.Program[i].MaxUniformBlocks;
 	    if (blocks[i] > max_uniform_blocks) {
-	       linker_error(prog, "Too many %s uniform blocks (%d/%d)",
+	       linker_error(prog, "Too many %s uniform blocks (%d/%d)\n",
 			    _mesa_shader_stage_to_string(i),
 			    blocks[i],
 			    max_uniform_blocks);
@@ -2338,7 +2338,7 @@ check_image_resources(struct gl_context *ctx, struct gl_shader_program *prog)
 
       if (sh) {
          if (sh->NumImages > ctx->Const.Program[i].MaxImageUniforms)
-            linker_error(prog, "Too many %s shader image uniforms",
+            linker_error(prog, "Too many %s shader image uniforms\n",
                          _mesa_shader_stage_to_string(i));
 
          total_image_units += sh->NumImages;
@@ -2354,11 +2354,11 @@ check_image_resources(struct gl_context *ctx, struct gl_shader_program *prog)
    }
 
    if (total_image_units > ctx->Const.MaxCombinedImageUniforms)
-      linker_error(prog, "Too many combined image uniforms");
+      linker_error(prog, "Too many combined image uniforms\n");
 
    if (total_image_units + fragment_outputs >
        ctx->Const.MaxCombinedImageUnitsAndFragmentOutputs)
-      linker_error(prog, "Too many combined image uniforms and fragment outputs");
+      linker_error(prog, "Too many combined image uniforms and fragment outputs\n");
 }
 
 
@@ -2382,7 +2382,7 @@ reserve_explicit_locations(struct gl_shader_program *prog,
                   max_loc + 1);
 
       if (!prog->UniformRemapTable) {
-         linker_error(prog, "Out of memory during linking.");
+         linker_error(prog, "Out of memory during linking.\n");
          return false;
       }
 
@@ -2412,7 +2412,7 @@ reserve_explicit_locations(struct gl_shader_program *prog,
           */
          linker_error(prog,
                       "location qualifier for uniform %s overlaps"
-                      "previously used location",
+                      "previously used location\n",
                       var->name);
          return false;
       }
@@ -2447,7 +2447,7 @@ check_explicit_uniform_locations(struct gl_context *ctx,
    string_to_uint_map *uniform_map = new string_to_uint_map;
 
    if (!uniform_map) {
-      linker_error(prog, "Out of memory during linking.");
+      linker_error(prog, "Out of memory during linking.\n");
       return;
    }
 
@@ -2719,7 +2719,7 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
        */
       if (first == MESA_SHADER_FRAGMENT) {
          linker_error(prog, "Transform feedback varyings specified, but "
-                      "no vertex or geometry shader is present.");
+                      "no vertex or geometry shader is present.\n");
          goto done;
       }
 
-- 
1.9.1



More information about the mesa-dev mailing list