[Mesa-dev] [PATCH v2 00/29] Use a master format convert function

Iago Toral Quiroga itoral at igalia.com
Mon Dec 1 03:04:53 PST 2014


This is the second of two series that aim to address:
https://bugs.freedesktop.org/show_bug.cgi?id=84566

This series requires the previous series that implements auto-generation of
the pack/unpack functions. A branch with both series is available here:
https://github.com/Igalia/mesa/tree/itoral-format-convert-review-v2

Link to the original series:
http://lists.freedesktop.org/archives/mesa-dev/2014-November/070916.html

Main changes in v2:
  - In the pack/unpack fast-paths, keep the assertions for integer formats.
  - Add additional comments for the integer path in _mesa_format_convert.
  - Add documentation for _mesa_format_convert.
  - Ensure that we use _mesa_swizzle_and_convert for all integer signed source
    formats
  - Let _mesa_format_convert receive a swizzle instead of a baseFormat (this
    change affects multiple patches)
  - Consider the requirements of the internal base format (now the swizzle)
    in all paths of _mesa_format_convert.
  - Fix incorrect triple swizzle composition in _mesa_format_convert.
  - Have GL_UNSIGNED_INT_8_8_8_8(_REV) be resolved as a mesa_format instead
    of a mesa_array_format to ease swizzling handling.
  - Move _mesa_format_from_format_and_type to glformats.
  - Fix variable declarations in some of the patches to work with MSVC.
  - Squashed some patches into the original implementation of
    _mesa_format_convert.
  - Remove support for incorrect ABGR type combinations (last patch in the
    series).
    
Notes:
  - Following discussion in the mailing list, the last patch removes support
    for:
     GL_ABGR_EXT/GL_UNSIGNED_SHORT_5_5_5_1,
     GL_ABGR_EXT/GL_UNSIGNED_SHORT_1_5_5_5_REV,
     GL_ABGR_EXT/GL_UNSIGNED_INT_2_10_10_10_REV,
     GL_ABGR_EXT/GL_UNSIGNED_INT_10_10_10_2
  which breaks the following piglit tests:
     spec/!OpenGL 1.2/texture-packed-formats
     glean/pixelFormats
  so if we commit to this decission we should also fix these tests to not
  use these types.
  
Tested on i965, classic swrast and gallium (radeon, nouveau, llvmpipe) without
regressions, except for the two regressions mentioned above with the last patch.

14 new piglit passes:
spec/ARB_copy_image/arb_copy_image-formats/Source: GL_RGB16_SNORM/Destination: GL_RGB16_SNORM
spec/ARB_copy_image/arb_copy_image-formats/Source: GL_ALPHA12/Destination: GL_ALPHA12
spec/!OpenGL 1.1/teximage-colors GL_RGB16_SNORM/Exact upload-download of GL_RGB16_SNORM
spec/ARB_copy_image/arb_copy_image-formats/Source: GL_RGB8I/Destination: GL_RGB8_SNORM
spec/ARB_copy_image/arb_copy_image-formats/Source: GL_RGB16UI/Destination: GL_RGB16_SNORM
spec/ARB_copy_image/arb_copy_image-formats/Source: GL_RGB8_SNORM/Destination: GL_RGB8_SNORM
spec/ARB_copy_image/arb_copy_image-formats/Source: GL_RGB8UI/Destination: GL_RGB8_SNORM
spec/ARB_copy_image/arb_copy_image-formats/Source: GL_RGB8/Destination: GL_RGB8_SNORM
spec/ARB_copy_image/arb_copy_image-formats/Source: GL_RGB16/Destination: GL_RGB16_SNORM
spec/!OpenGL 1.1/teximage-colors GL_RGB8_SNORM/Exact upload-download of GL_RGB8_SNORM
spec/ARB_copy_image/arb_copy_image-formats/Source: GL_INTENSITY12/Destination: GL_INTENSITY12
spec/ARB_copy_image/arb_copy_image-formats/Source: GL_LUMINANCE12/Destination: GL_LUMINANCE12
spec/ARB_copy_image/arb_copy_image-formats/Source: GL_LUMINANCE12_ALPHA12/Destination: GL_LUMINANCE12_ALPHA12
spec/ARB_copy_image/arb_copy_image-formats/Source: GL_RGB16I/Destination: GL_RGB16_SNORM

Eduardo Lima Mitev (1):
  mesa: Replace _mesa_unpack_bitmap with _mesa_unpack_image()

Iago Toral Quiroga (24):
  mesa: Set normalized=true for float array formats.
  mesa: Expose compute_component_mapping as
    _mesa_compute_component_mapping
  mesa: Add a rebase_swizzle parameter to _mesa_format_convert
  mesa: Add a helper _mesa_compute_rgba2base2rgba_component_mapping
  mesa: Let _mesa_swizzle_and_convert take array format types instead of
    GL types
  mesa: Add helper to convert a GL format and type to a mesa (array)
    format.
  mesa: Add _mesa_swap2_copy and _mesa_swap4_copy
  mesa: Add RGBA to Luminance conversion helpers
  mesa: Add helpers to extract GL_COLOR_INDEX to RGBA float/ubyte
  mesa: Use _mesa_format_convert to implement texstore_rgba.
  mesa: use _mesa_format_convert to implement glReadPixels.
  mesa: use _mesa_format_convert to implement get_tex_rgba_uncompressed.
  mesa: Use _mesa_format_convert to implement get_tex_rgba_compressed.
  swrast: Use _mesa_format_convert to implement draw_rgba_pixels.
  gallium: Use _mesa_format_convert to implement st_GetTexImage.
  mesa: Remove _mesa_unpack_color_span_uint
  mesa: Remove _mesa_make_temp_ubyte_image
  mesa: Remove _mesa_make_temp_float_image
  mesa: Remove _mesa_unpack_color_span_ubyte
  mesa: Remove (signed) integer pack and span functions.
  mesa: Remove _mesa_unpack_color_span_float
  mesa: Remove _mesa_pack_rgba_span_float and tmp_pack.h
  mesa: Remove _mesa_(un)pack_index_span
  mesa: Remove _mesa_rebase_rgba_uint and _mesa_rebase_rgba_float

Jason Ekstrand (1):
  mesa: Add an implementation of a master convert function.

Samuel Iglesias Gonsalvez (3):
  mesa/pack: use _mesa_format_from_format_and_type in
    _mesa_pack_rgba_span_from_*
  mesa: Remove _mesa_pack_int_rgba_row() and auxiliary functions
  mesa: restrict use of GL_ABGR_EXT format to allowed data types

 src/mesa/main/dlist.c                  |   14 +-
 src/mesa/main/format_info.py           |    3 +-
 src/mesa/main/format_pack.c.mako       |  121 --
 src/mesa/main/format_pack.h            |    4 -
 src/mesa/main/format_utils.c           |  928 ++++++++-
 src/mesa/main/format_utils.h           |   24 +-
 src/mesa/main/formats.c                |   46 +-
 src/mesa/main/formats.csv              |    4 -
 src/mesa/main/formats.h                |   12 +-
 src/mesa/main/glformats.c              |  304 ++-
 src/mesa/main/glformats.h              |    2 +
 src/mesa/main/image.c                  |   25 +-
 src/mesa/main/image.h                  |   10 +-
 src/mesa/main/pack.c                   | 3505 ++------------------------------
 src/mesa/main/pack.h                   |   85 +-
 src/mesa/main/pack_tmp.h               |  196 --
 src/mesa/main/readpix.c                |  321 +--
 src/mesa/main/texcompress_bptc.c       |   39 +-
 src/mesa/main/texcompress_fxt1.c       |   34 +-
 src/mesa/main/texcompress_rgtc.c       |   90 +-
 src/mesa/main/texcompress_s3tc.c       |   68 +-
 src/mesa/main/texgetimage.c            |  323 +--
 src/mesa/main/texstore.c               | 1145 +----------
 src/mesa/main/texstore.h               |   19 -
 src/mesa/state_tracker/st_cb_texture.c |   17 +-
 src/mesa/swrast/s_drawpix.c            |   39 +-
 src/mesa/swrast/s_texfetch.c           |    4 -
 27 files changed, 2060 insertions(+), 5322 deletions(-)
 delete mode 100644 src/mesa/main/pack_tmp.h

-- 
1.9.1



More information about the mesa-dev mailing list