summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/ast.h
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2018-11-01 13:50:14 -0700
committerIan Romanick <[email protected]>2018-11-08 11:00:00 -0800
commitc5a4c264508d3b36663779b89ec0dbaf7653df96 (patch)
tree0e27e48dc1617316c2312a271963ff36bc0befe4 /src/compiler/glsl/ast.h
parent011abfc963a734953a0edd9c7a4fa01570627050 (diff)
glsl: Add pragma to disable all warnings
Use #pragma warning(off) and #pragma warning(on) to disable or enable all warnings. This is a big hammer. If we ever need a smaller hammer, we can enhance this functionality. There is one lame thing about this. Because we parse everything, create an AST, then convert the AST to GLSL IR, we have to treat the #pragma like a statment. This means that you can't do something like ' void ' #pragma warning(off) ' __foo ' #pragma warning(on) ' (float param0); Fixing that would, as far as I can tell, require a huge amount of work. I did try just handling the #pragma during parsing (like we do for state for the whole shader. v2: Fix the #pragma lines in the commit message that git-commit ate. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/compiler/glsl/ast.h')
-rw-r--r--src/compiler/glsl/ast.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/compiler/glsl/ast.h b/src/compiler/glsl/ast.h
index 4d5e045b82c..94bcf644a26 100644
--- a/src/compiler/glsl/ast.h
+++ b/src/compiler/glsl/ast.h
@@ -1315,6 +1315,20 @@ private:
ast_layout_expression *local_size[3];
};
+class ast_warnings_toggle : public ast_node {
+public:
+ ast_warnings_toggle(bool _enable)
+ : enable(_enable)
+ {
+ /* empty */
+ }
+
+ virtual ir_rvalue *hir(exec_list *instructions,
+ struct _mesa_glsl_parse_state *state);
+
+private:
+ bool enable;
+};
/*@}*/
extern void