diff options
Diffstat (limited to 'src/gallium/drivers/r600/sb/sb_dump.h')
-rw-r--r-- | src/gallium/drivers/r600/sb/sb_dump.h | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/src/gallium/drivers/r600/sb/sb_dump.h b/src/gallium/drivers/r600/sb/sb_dump.h new file mode 100644 index 0000000000..98d4bb4988 --- /dev/null +++ b/src/gallium/drivers/r600/sb/sb_dump.h @@ -0,0 +1,81 @@ +/* + * Copyright 2013 Vadim Girlin <vadimgirlin@gmail.com> + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, and/or sell copies of the Software, and to permit persons to whom + * the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * Authors: + * Vadim Girlin + */ + +#ifndef SB_DUMP_H_ +#define SB_DUMP_H_ + +namespace r600_sb { + +class dump : public vpass { + using vpass::visit; + + int level; + +public: + + dump(shader &s) : vpass(s), level(0) {} + + virtual bool visit(node &n, bool enter); + virtual bool visit(container_node &n, bool enter); + virtual bool visit(alu_group_node &n, bool enter); + virtual bool visit(cf_node &n, bool enter); + virtual bool visit(alu_node &n, bool enter); + virtual bool visit(alu_packed_node &n, bool enter); + virtual bool visit(fetch_node &n, bool enter); + virtual bool visit(region_node &n, bool enter); + virtual bool visit(repeat_node &n, bool enter); + virtual bool visit(depart_node &n, bool enter); + virtual bool visit(if_node &n, bool enter); + virtual bool visit(bb_node &n, bool enter); + + + static void dump_op(node &n, const char *name); + static void dump_vec(const vvec & vv); + static void dump_set(shader &sh, val_set & v); + + static void dump_rels(vvec & vv); + + static void dump_val(value *v); + static void dump_op(node *n); + + static void dump_op_list(container_node *c); + static void dump_queue(sched_queue &q); + + static void dump_alu(alu_node *n); + +private: + + void indent(); + + void dump_common(node &n); + void dump_flags(node &n); + + void dump_live_values(container_node &n, bool before); +}; + +} // namespace r600_sb + +#endif /* SB_DUMP_H_ */ |