[Mesa-dev] [PATCH v2 13/23] mesa: Autogenerate most of format_pack.c

Samuel Iglesias Gonsálvez siglesias at igalia.com
Wed Dec 3 00:05:58 PST 2014


On Tuesday, December 02, 2014 09:35:05 AM Jason Ekstrand wrote:
> 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).
> 

I found the same error but after executing the following commands in the 
source tree:

$ make distclean
$ git clean -fdx

Then I created a new build tree under /tmp/mesa-build directory and it built 
successfully. Please check if it works for you too.

Sam

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20141203/d439d62e/attachment.sig>


More information about the mesa-dev mailing list