[Mesa-dev] [PATCH] glsl: propagate max_array_access through function calls
Dominik Behr
dbehr at chromium.org
Tue Aug 27 21:48:37 PDT 2013
Hi,
I am looking at the code in lower_clip_distance.cpp
ir_visitor_status
lower_clip_distance_visitor::visit_leave(ir_call *ir)
{
void *ctx = ralloc_parent(ir);
const exec_node *formal_param_node = ir->callee->parameters.head;
const exec_node *actual_param_node = ir->actual_parameters.head;
while (!actual_param_node->is_tail_sentinel()) {
ir_variable *formal_param = (ir_variable *) formal_param_node;
ir_rvalue *actual_param = (ir_rvalue *) actual_param_node;
/* Advance formal_param_node and actual_param_node now so that we can
* safely replace actual_param with another node, if necessary, below.
*/
formal_param_node = formal_param_node->next;
actual_param_node = actual_param_node->next;
....
is_tail_sentinel() is true when next == NULL. this means this loop will not
be executed for the last formal param in the list. Is this by design? In my
case I need to visit all function parameters.
I think it should by simply while (actual_param_node) {
Also, what is the point of exec_node::get_head() and exec_node::get_next()
accessor methods if they are not used?
On Tue, Aug 27, 2013 at 3:15 PM, Matt Turner <mattst88 at gmail.com> wrote:
> On Tue, Aug 27, 2013 at 2:03 PM, Dominik Behr <dbehr at chromium.org> wrote:
> > I am not sure about MAX2, is it guaranteed to be converted to branchless
> > conditional assignment?
>
> I don't think there's a guarantee, no. Using MAX2 just makes the code
> easier to immediately understand.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20130827/fc0b59a5/attachment-0001.html>
More information about the mesa-dev
mailing list