<div dir="ltr"><div><div><div><div>Iago,<br></div>Most of this looks pretty good to me.  The one primary concern I have is in the handling of integer formats.  I made the comment in a couple of patches, but I'll make it in general here.  In a lot of the code, when you convert from integer formats to float, you treat them as if they are normalized.  Can you explain why you are doing this?  It seems very wrong to me.<br><br></div>One other issue is that I couldn't actually get it to compile.  This is probably due to the fact that I always build out-of-tree, so sourcedir and builddir are not the same.  Not really sure what's going on there.<br><br></div>Other than that, It's looking pretty good.  I'll try and get to reviewing your second patch series tomorrow.  Since my R-B obviously doesn't mean much on the code I wrote I'll try and dig up a second reviewer as well.<br></div>--Jason<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 18, 2014 at 12:43 AM, Iago Toral Quiroga <span dir="ltr"><<a href="mailto:itoral@igalia.com" target="_blank">itoral@igalia.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This is the fist of two series of patches to address:<br>
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=84566" target="_blank">https://bugs.freedesktop.org/show_bug.cgi?id=84566</a><br>
<br>
The idea is that we have a lot of format conversion code scattered through<br>
different files in the repository, a lot of that is redundant / duplicated,<br>
so this intends to address that issue.<br>
<br>
The goal of this first series is to address auto-generation of our pack/unpack<br>
functions (format_pack.c and format_unpack.c). Currently, we  have a ton of<br>
hand-coded pack/unpack functions for lots of formats, but we can auto-generate<br>
most of that code instead, so this series handles this.<br>
<br>
This is based on initial work by Jason Ekstrand.<br>
<br>
Tested on i965, classic swrast and gallium (radeon, nouveau, llvmpipe) without<br>
regressions.<br>
<br>
For software drivers we worked with a trimmed set of piglit tests (related to<br>
format conversion), ~5700 tests selected with the following filter:<br>
<br>
-t format -t color -t tex -t image -t swizzle -t clamp -t rgb -t lum -t pix<br>
-t fbo -t frame<br>
<br>
Summary of the patches:<br>
 * Patches 1-7 are general fixes to the current code that were found while<br>
   working on this.<br>
 * Patches 8-16 implement auto-generation of pack/unpack functions.<br>
 * Patches 17-20 make use of the auto-generated pack/unpack functions in<br>
   various places to simplify the current code.<br>
<br>
Notice that some of the fixes in patches 1-7 will become obsolete as soon as<br>
we auto-generate the pack/unpack functions, but we thought it would make sense<br>
to keep them in the patch set anyway since we started from that base and they<br>
should be correct fixes to the currently existing code.<br>
<br>
Iago Toral Quiroga (1):<br>
  swrast: Remove unused variable.<br>
<br>
Jason Ekstrand (9):<br>
  mesa/format_utils: Fix a bug in one of the format helper functions<br>
  mesa: Fix packing/unpacking of MESA_FORMAT_R5G6B5_UNORM<br>
  mesa/colormac: Remove an unused macro<br>
  mesa: Fix A1R5G5B5 packing/unpacking<br>
  mesa/format_utils: Prefix and expose the conversion helper functions<br>
  mesa: Add a concept of an array format<br>
  mesa: Add a _mesa_is_format_color_format helper<br>
  mesa: Autogenerate most of format_pack.c<br>
  mesa: Autogenerate format_unpack.c<br>
<br>
Samuel Iglesias Gonsalvez (10):<br>
  mesa: Fix get_texbuffer_format().<br>
  mesa: Fix _mesa_swizzle_and_convert integer conversions to clamp<br>
    properly<br>
  mesa: Add _mesa_pack_uint_rgba_row() format conversion function<br>
  mesa: Add non-normalized formats support for ubyte packing functions<br>
  mesa/format_pack: Add _mesa_pack_int_rgba_row()<br>
  mesa/formats: add new mesa formats and their pack/unpack functions.<br>
  mesa: use format conversion functions in swrast<br>
  mesa/pack: use autogenerated format_pack functions<br>
  mesa/main/pack_tmp.h: Add float conversion support<br>
  mesa/pack: refactor _mesa_pack_rgba_span_float()<br>
<br>
 src/mesa/Makefile.am               |   18 +<br>
 src/mesa/Makefile.sources          |    4 +-<br>
 src/mesa/main/colormac.h           |    3 -<br>
 src/mesa/main/format_convert.py    |   71 +<br>
 src/mesa/main/format_info.py       |   41 +<br>
 src/mesa/main/format_pack.c        | 2994 ------------------------<br>
 src/mesa/main/format_pack.c.mako   | 1147 ++++++++++<br>
 src/mesa/main/format_pack.h        |    6 +<br>
 src/mesa/main/format_unpack.c      | 4400 ------------------------------------<br>
 src/mesa/main/format_unpack.c.mako |  914 ++++++++<br>
 src/mesa/main/format_utils.c       |  248 +-<br>
 src/mesa/main/format_utils.h       |  105 +<br>
 src/mesa/main/formats.c            |  193 +-<br>
 src/mesa/main/formats.csv          |   13 +<br>
 src/mesa/main/formats.h            |   73 +<br>
 src/mesa/main/pack.c               | 2111 +++--------------<br>
 src/mesa/main/pack_tmp.h           |   76 +-<br>
 src/mesa/main/run_mako.py          |    7 +<br>
 src/mesa/main/teximage.c           |    4 +-<br>
 src/mesa/main/texstore.c           |    2 +-<br>
 src/mesa/swrast/s_drawpix.c        |    3 -<br>
 src/mesa/swrast/s_texfetch.c       |   13 +<br>
 src/mesa/swrast/s_texfetch_tmp.h   | 1359 +----------<br>
 23 files changed, 3222 insertions(+), 10583 deletions(-)<br>
 create mode 100644 src/mesa/main/format_convert.py<br>
 delete mode 100644 src/mesa/main/format_pack.c<br>
 create mode 100644 src/mesa/main/format_pack.c.mako<br>
 delete mode 100644 src/mesa/main/format_unpack.c<br>
 create mode 100644 src/mesa/main/format_unpack.c.mako<br>
 create mode 100644 src/mesa/main/run_mako.py<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
1.9.1<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div>