summaryrefslogtreecommitdiff
path: root/src/glsl/ir_print_visitor.h
AgeCommit message (Collapse)AuthorFilesLines
2013-08-01glsl: add ir_emit_vertex and ir_end_primitive instruction typesBryan Cain1-0/+2
These correspond to the EmitVertex and EndPrimitive functions in GLSL. v2 (Paul Berry <stereotype441@gmail.com>): Add stub implementations of new pure visitor functions to i965's vec4_visitor and fs_visitor classes. v3 (Paul Berry <stereotype441@gmail.com>): Rename classes to be more consistent with the names used in the GL spec. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-06-21glsl: Make _mesa_print_ir() available from anything including ir.h.Eric Anholt1-3/+0
No more forgetting to #include "ir_print_visitor.h" when doing temporary debug code, or forgetting and leaving it in after removing your temporary debug code. Also, available from C code so you don't need to move the caller to C++ just to call it (see also: ir_to_mesa.cpp). Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-04-02glsl: Use ir_rvalue to represent generic error_type values.Kenneth Graunke1-0/+1
Currently, ir_call can be used as either a statement (for void functions) or a value (for non-void functions). This is rather awkward, as it's the only class that can be used in both forms. A number of places use ir_call::get_error_instruction() to construct a generic value of error_type. If ir_call is to become a statement, it can no longer serve this purpose. Unfortunately, none of our classes are particularly well suited for this, and creating a new one would be rather aggrandizing. So, this patch introduces ir_rvalue::error_value(), a static method that creates an instance of the base class, ir_rvalue. This has the nice property that you can't accidentally try and access uninitialized fields (as it doesn't have any). The downside is that the base class is no longer abstract. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-03-25glsl: Generate readable unique names at print time.Kenneth Graunke1-9/+20
Since GLSL IR allows multiple ir_variables to share the same name, we need to generate unique names when printing the IR. Previously, we always used %s@%p, appending the ir_variable's memory address. While this worked, it had two drawbacks: - When there aren't duplicates, the extra "@0x669a3e88" is useless and makes the code harder to read. - Real duplicates were hard to tell apart: channel_expressions@0x6699e3c8 vs. channel_expressions@0x6699ddd8 We now append @2, @3, @4, and so on, but only where necessary to distinguish duplicates. Since we only do this at print time, any performance impact is irrelevant. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Ian Romanick <idr@freedesktop.org>
2010-07-29glsl2: When dumping IR for debug, indent nested blocks.Eric Anholt1-3/+4
No more trying to match parens in my head when looking at the body of a short function containing an if statement.
2010-06-30glsl2: Define new ir_discard instruction.Kenneth Graunke1-0/+1
2010-06-24glsl2: Move the compiler to the subdirectory it will live in in Mesa.Eric Anholt1-0/+81