2 * Copyright 2013 Vadim Girlin <vadimgirlin@gmail.com>
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * on the rights to use, copy, modify, merge, publish, distribute, sub
8 * license, and/or sell copies of the Software, and to permit persons to whom
9 * the Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
19 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
20 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
21 * USE OR OTHER DEALINGS IN THE SOFTWARE.
27 #include "sb_shader.h"
32 pass::pass(shader
&s
) : ctx(s
.get_ctx()), sh(s
) {}
34 int pass::run() { return -1; }
36 int vpass::init() { return 0; }
37 int vpass::done() { return 0; }
52 void vpass::run_on(container_node
&n
) {
53 if (n
.accept(*this, true)) {
55 for (node_iterator N
, I
= n
.begin(), E
= n
.end(); I
!= E
; I
= N
) {
59 if (I
->is_container()) {
60 container_node
*c
= static_cast<container_node
*>(*I
);
63 I
->accept(*this, true);
64 I
->accept(*this, false);
69 n
.accept(*this, false);
72 bool vpass::visit(node
& n
, bool enter
) { return true; }
73 bool vpass::visit(container_node
& n
, bool enter
) { return true; }
74 bool vpass::visit(alu_group_node
& n
, bool enter
) { return true; }
75 bool vpass::visit(cf_node
& n
, bool enter
) { return true; }
76 bool vpass::visit(alu_node
& n
, bool enter
) { return true; }
77 bool vpass::visit(alu_packed_node
& n
, bool enter
) { return true; }
78 bool vpass::visit(fetch_node
& n
, bool enter
) { return true; }
79 bool vpass::visit(region_node
& n
, bool enter
) { return true; }
80 bool vpass::visit(repeat_node
& n
, bool enter
) { return true; }
81 bool vpass::visit(depart_node
& n
, bool enter
) { return true; }
82 bool vpass::visit(if_node
& n
, bool enter
) { return true; }
83 bool vpass::visit(bb_node
& n
, bool enter
) { return true; }
85 void rev_vpass::run_on(container_node
& n
) {
86 if (n
.accept(*this, true)) {
88 for (node_riterator N
, I
= n
.rbegin(), E
= n
.rend(); I
!= E
; I
= N
) {
92 if (I
->is_container()) {
93 container_node
*c
= static_cast<container_node
*>(*I
);
96 I
->accept(*this, true);
97 I
->accept(*this, false);
102 n
.accept(*this, false);
105 } // namespace r600_sb