summaryrefslogtreecommitdiffstats
path: root/src/glsl/ir.h
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2013-09-25 11:44:41 -0700
committerIan Romanick <[email protected]>2013-10-30 13:49:30 -0700
commitf8c579dc0fc0ffed41a86daecbcfe6c3b9843e61 (patch)
tree1fc49c33a09dacca38a525ae0515a193797ba23b /src/glsl/ir.h
parent2cb760d9945b30bed027a14c2a9ac20d07d7c5ba (diff)
glsl: Make mode_string function globally available
I made this a function (instead of a method of ir_variable) because it made the change set smaller, and I expect that there will be an overload that takes an ir_var_mode enum. Having both functions used the same way seemed better. v2: Add missing case for ir_var_system_value. v3: Change the ir_var_mode_count case to just break. Move the assertion and the return outside the switch-statment. In the unlikely event that var->mode is an invalid value other than ir_var_mode_count, the assertion will still fire, and in release builds we won't wind up returning a garbage pointer. Suggested by Paul. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Paul Berry <[email protected]>
Diffstat (limited to 'src/glsl/ir.h')
-rw-r--r--src/glsl/ir.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/glsl/ir.h b/src/glsl/ir.h
index 49de9e358bd..5b30fe59b91 100644
--- a/src/glsl/ir.h
+++ b/src/glsl/ir.h
@@ -2306,6 +2306,9 @@ extern char *
prototype_string(const glsl_type *return_type, const char *name,
exec_list *parameters);
+const char *
+mode_string(const ir_variable *var);
+
extern "C" {
#endif /* __cplusplus */