[Mesa-dev] [PATCH 5/8] i965: Add script to gen code for OA counter queries

Robert Bragg robert at sixbynine.org
Wed Mar 1 16:58:09 UTC 2017


On Wed, Mar 1, 2017 at 3:57 PM, Robert Bragg <robert at sixbynine.org> wrote:
> On Mon, Feb 27, 2017 at 8:01 PM, Dylan Baker <dylan at pnwbakers.com> wrote:

>>> +def output_rpn_equation_code(set, counter, equation, counter_vars):
>>> +    c("/* RPN equation: " + equation + " */")
>>> +    tokens = equation.split()
>>> +    stack = []
>>> +    tmp_id = 0
>>> +    tmp = None
>>> +
>>> +    for token in tokens:
>>> +        stack.append(token)
>>> +        while stack and stack[-1] in ops:
>>> +            op = stack.pop()
>>> +            argc, callback = ops[op]
>>> +            args = []
>>> +            for i in range(0, argc):
>>
>> Use xrange instead of range
>
> okey, can do.

I just realised that the use of xrange() became the only thing
stopping the script from being python version agnostic (python 3
removes xrange and plain range() behaves like xrange()) so I went back
to using range() here.


More information about the mesa-dev mailing list