linker: Make linker_{error,warning} generally available
authorIan Romanick <ian.d.romanick@intel.com>
Thu, 28 Jul 2011 21:09:06 +0000 (14:09 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Tue, 2 Aug 2011 15:23:01 +0000 (08:23 -0700)
linker_warning is a new function.  It's identical to linker_error
except that it doesn't set LinkStatus=false and it prepends "warning: "
on messages instead of "error: ".

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/glsl/ir_function_detect_recursion.cpp
src/glsl/linker.cpp
src/glsl/linker.h
src/glsl/program.h

index a3b461818d3837cae7afedba4383efa7fbdb95be..8f805bf1ba96097a215d2e2ae67623d166702462 100644 (file)
 #include "glsl_parser_extras.h"
 #include "linker.h"
 #include "program/hash_table.h"
+#include "program.h"
 
 struct call_node : public exec_node {
    class function *func;
index 35d893f499e2c50d50f50013591e58a9a38f6b67..19eb9b5ff6f5a40383d92350f1177a9413449c7b 100644 (file)
@@ -177,6 +177,19 @@ linker_error(gl_shader_program *prog, const char *fmt, ...)
 }
 
 
+void
+linker_warning(gl_shader_program *prog, const char *fmt, ...)
+{
+   va_list ap;
+
+   ralloc_strcat(&prog->InfoLog, "error: ");
+   va_start(ap, fmt);
+   ralloc_vasprintf_append(&prog->InfoLog, fmt, ap);
+   va_end(ap);
+
+}
+
+
 void
 invalidate_variable_locations(gl_shader *sh, enum ir_variable_mode mode,
                              int generic_base)
index dfae073c274f2c4dd3b399584f20f713731f27ac..769cf68b6ad0207b92a94d6f7697c2107d17c90f 100644 (file)
@@ -25,9 +25,6 @@
 #ifndef GLSL_LINKER_H
 #define GLSL_LINKER_H
 
-extern void
-linker_error(gl_shader_program *prog, const char *fmt, ...);
-
 extern bool
 link_function_calls(gl_shader_program *prog, gl_shader *main,
                    gl_shader **shader_list, unsigned num_shaders);
index db602fa9ec2ee0838261f711224df00949a2b7dd..437ca1462faf98837de734700545fb9119968490 100644 (file)
 
 extern void
 link_shaders(struct gl_context *ctx, struct gl_shader_program *prog);
+
+extern void
+linker_error(gl_shader_program *prog, const char *fmt, ...)
+   PRINTFLIKE(2, 3);
+
+extern void
+linker_warning(gl_shader_program *prog, const char *fmt, ...)
+   PRINTFLIKE(2, 3);