[Piglit] [PATCH 6/8] arb_gpu_shader_fp64: use generator to test in/out attributes

Dylan Baker baker.dylan.c at gmail.com
Wed Mar 16 16:31:02 UTC 2016


Quoting Andres Gomez (2016-03-16 08:35:52)
> On Tue, 2016-03-15 at 09:38 -0700, Dylan Baker wrote:
> > Quoting Andres Gomez (2016-03-15 08:50:47)
> > > From: "Juan A. Suarez Romero" <jasuarez at igalia.com>
> > > 
[snip]
> 
> > I'm also not sure that I like building the config block in the python
> > layer, I would personally prefer to see it done in the mako layer, I
> > think it would be cleaner there. This applies to all of the get_*
> > functions too.
> 
> I have some doubts about this.
> 
> For this generator we'll change it since it is that simple that maybe
> it'll cleaner that way.
> 
> However, we would be adding the same code in the mako templates and, in
> case of needing additions or corrections, we would need to edit several
> templates instead of a single place in the python script. Anyway, we
> trade having a cleaner python to have a little bit more complex
> templates ...

Mako does have an import mechanism like python (mako is just a DSL for
python anyway), and I know some of the other generators use it. Look for
helper.mako if you want to see how it works. I'm not dead set on it, but
I tend to find that putting code that is basically "print this or that"
is cleaner in mako than python.

> 
> > > +    if ver == '150':
> > > +        config += ' * require_extensions: GL_ARB_gpu_shader_fp64\n'
> > > +    return config
> > > +

[snip]

> > > +
> > > +
> > > +def main():
> > > +    """Main function."""
> > > +
> > > +    parser = optparse.OptionParser(
> > > +        description="Generate in/out tests for fp64",
> > > +        usage="usage: %prog [-h] [--names-only]")
> > > +    parser.add_option(
> > > +        '--names-only',
> > > +        dest='names_only',
> > > +        action='store_true',
> > > +        help="Don't output files, just generate a list of filenames to stdout")
> > > +
> > > +    (options, args) = parser.parse_args()
> > 
> > most of piglit uses argparse, and it also doesn't need the extra code
> > for extra arguments, or use of bool. Could we use argparse
> > instead?
> 
> Right. We'll fix this.
> 
> Notice that in all the generators the module used is optparse, not
> argparse. We were just being coherent with the other existing
> generators.
> 
> Maybe we should send another patch to migrate in all the generators?
> 

I didn't realize that, I thought I'd converted them all to argparse.
Maybe I never sent that series. If the others use opt parse you can
ignore this if you prefer, and I can dig up patches to make all of them
use argparse when I have time.

[snip]

Cheers,
Dylan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: signature
URL: <https://lists.freedesktop.org/archives/piglit/attachments/20160316/786b4c36/attachment.sig>


More information about the Piglit mailing list