Re: [Mesa-dev] [PATCH 1/3] glsl: add ir_partial_visitor

2010-09-08 Thread Eric Anholt
On Tue, 07 Sep 2010 13:08:37 -0700, Ian Romanick wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Luca Barbieri wrote: > > Well, the alternative is to copy&paste this into ir_lower_jumps and > > other similar passes. > > > > I added a new class instead of changing ir_visitor so that

Re: [Mesa-dev] [PATCH 1/3] glsl: add ir_partial_visitor

2010-09-07 Thread Luca Barbieri
Yes, I think what is really needed here is a class that only ignores IR related to declaration and expression statements. This would allow lower_jumps to avoid caring about stuff like ir_texture that it doesn't care about at all. Would this be acceptable? BTW, using hierarchical_visitor is less

Re: [Mesa-dev] [PATCH 1/3] glsl: add ir_partial_visitor

2010-09-07 Thread Ian Romanick
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Luca Barbieri wrote: > Well, the alternative is to copy&paste this into ir_lower_jumps and > other similar passes. > > I added a new class instead of changing ir_visitor so that subclasses > that need to examine all leaves will get a compile error if

Re: [Mesa-dev] [PATCH 1/3] glsl: add ir_partial_visitor

2010-09-07 Thread Luca Barbieri
Well, the alternative is to copy&paste this into ir_lower_jumps and other similar passes. I added a new class instead of changing ir_visitor so that subclasses that need to examine all leaves will get a compile error if not updated when new leaves are introduced. This is debatable though, since yo

Re: [Mesa-dev] [PATCH 1/3] glsl: add ir_partial_visitor

2010-09-06 Thread Ian Romanick
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Luca Barbieri wrote: > This is just a subclass of ir_visitor with empty implementations of all > the visit methods. > > Used to avoid duplicating that in ir_visitor subclasses. NAK. The methods are missing intentionally. Refer to any documentation

[Mesa-dev] [PATCH 1/3] glsl: add ir_partial_visitor

2010-09-06 Thread Luca Barbieri
This is just a subclass of ir_visitor with empty implementations of all the visit methods. Used to avoid duplicating that in ir_visitor subclasses. ir_hierarchical_visitor is another way to solve this, but is less natural for some applications. --- src/glsl/ir_visitor.h | 21 ++