[Mesa-dev] [PATCH v2 13/23] mesa: Autogenerate most of format_pack.c
Jason Ekstrand
jason at jlekstrand.net
Tue Dec 2 09:35:05 PST 2014
On Mon, Dec 1, 2014 at 11:03 PM, Samuel Iglesias Gonsálvez <
siglesias at igalia.com> wrote:
>
>
> On 01/12/14 20:00, Jason Ekstrand wrote:
> > On Mon, Dec 1, 2014 at 3:04 AM, Iago Toral Quiroga <itoral at igalia.com>
> > wrote:
> >
> >> From: Jason Ekstrand <jason.ekstrand at intel.com>
> >>
> >> We were auto-generating it before. The problem was that the
> autogeneration
> >> tool we were using was called "copy, paste, and edit". Let's use a more
> >> sensible solution.
> >>
> >> Signed-off-by: Jason Ekstrand <jason.ekstrand at intel.com>
> >>
> >> v2 by Samuel Iglesias <siglesias at igalia.com>
> >> - Remove format_pack.c as it is now autogenerated
> >> - Add usage of INDENT_FLAGS in Makefile.am
> >> - Remove trailing blank line
> >>
> >> v3 by Samuel Iglesias <siglesias at igalia.com>
> >> - Merge format_convert.py into format_parser.py
> >> - Adapt pack_*_* function generations
> >> - Fix out-of-tree build
> >>
> >> Signed-off-by: Samuel Iglesias Gonsalvez <siglesias at igalia.com>
> >> ---
> [...]
> >> + def __get_datatype(self, type, size):
> >> + if type == FLOAT:
> >> + if size == 32:
> >> + return 'float'
> >> + elif size == 16:
> >> + return 'uint16_t'
> >> + else:
> >> + assert False
> >> + elif type == UNSIGNED:
> >> + if size <= 8:
> >> + return 'uint8_t'
> >> + elif size <= 16:
> >> + return 'uint16_t'
> >> + elif size <= 32:
> >> + return 'uint32_t'
> >> + else:
> >> + assert False
> >> + elif type == SIGNED:
> >> + if size <= 8:
> >> + return 'int8_t'
> >> + elif size <= 16:
> >> + return 'int16_t'
> >> + elif size <= 32:
> >> + return 'int32_t'
> >> + else:
> >> + assert False
> >> + else:
> >> + assert False
> >>
> >
> > Let's put this in a helper that's called by both Format and Channel.
> That
> > way if we change any of this, it's all in one place. Also, it still
> > doesn't build. Matt is looking into that.
> > --Jason
> >
> >
>
> OK, I will put this in a helper.
>
> Which error do you get when building? I created a build/ directory in
> Mesa and build from there with success. However, any help on this would
> be great.
>
> Thanks,
>
> Sam
>
Maybe it would help if I explained my setup a bit more
My mesa tree is in ~/projects/mesa and my usual build tree is in
~/build/mesa-debug so they are in completely different locations. I don't
know why that would be different from nested, but maybe it is. The exact
error that I'm getting is that it has no rule to build
~/projects/mesa/src/mesa/main/format_pack.c which is a path in the source
tree even though the actual file is getting successfully generated as
~/build/mesa-debug/src/mesa/main/format_pack.c (in the build tree).
--Jason
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20141202/5e91b3c9/attachment.html>
More information about the mesa-dev
mailing list