diff options
author | Ian Romanick <[email protected]> | 2011-07-28 14:09:06 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2011-08-02 08:23:01 -0700 |
commit | 379a32f42ebca9feeb024633f7774661619fd62e (patch) | |
tree | 7654221dfeb0f4d7f93758d8b05fd2be13df1378 /src | |
parent | 586e741ac1fa222d041990b265e820f5aa11344d (diff) |
linker: Make linker_{error,warning} generally available
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 <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/glsl/ir_function_detect_recursion.cpp | 1 | ||||
-rw-r--r-- | src/glsl/linker.cpp | 13 | ||||
-rw-r--r-- | src/glsl/linker.h | 3 | ||||
-rw-r--r-- | src/glsl/program.h | 8 |
4 files changed, 22 insertions, 3 deletions
diff --git a/src/glsl/ir_function_detect_recursion.cpp b/src/glsl/ir_function_detect_recursion.cpp index a3b461818d3..8f805bf1ba9 100644 --- a/src/glsl/ir_function_detect_recursion.cpp +++ b/src/glsl/ir_function_detect_recursion.cpp @@ -125,6 +125,7 @@ #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; diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp index 35d893f499e..19eb9b5ff6f 100644 --- a/src/glsl/linker.cpp +++ b/src/glsl/linker.cpp @@ -178,6 +178,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) { diff --git a/src/glsl/linker.h b/src/glsl/linker.h index dfae073c274..769cf68b6ad 100644 --- a/src/glsl/linker.h +++ b/src/glsl/linker.h @@ -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); diff --git a/src/glsl/program.h b/src/glsl/program.h index db602fa9ec2..437ca1462fa 100644 --- a/src/glsl/program.h +++ b/src/glsl/program.h @@ -25,3 +25,11 @@ 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); |