aboutsummaryrefslogtreecommitdiffstats
path: root/src/util/format
Commit message (Collapse)AuthorAgeFilesLines
* meson: use gnu_symbol_visibility argumentDylan Baker2020-06-011-1/+2
| | | | | | | | | | This uses a meson builtin to handle -fvisibility=hidden. This is nice because we don't need to track which languages are used, if C++ is suddenly added meson just does the right thing. Acked-by: Matt Turner <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4740>
* util/format: Add more multi-planar formats.Bas Nieuwenhuizen2020-05-304-0/+303
| | | | | | | | These don't have a fourcc code as far as I can tell, but we want them for internal Vulkan use. Reviewed-by: Eric Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5195>
* util/format: Add VK_FORMAT_D16_UNORM_S8_UINT.Bas Nieuwenhuizen2020-05-303-0/+72
| | | | | | | | Not participating in packing/unpacking/stencil-only/depth-only, because it doesn't mix well in a single plane. Reviewed-by: Eric Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5195>
* util/format: Use SATURATEAlyssa Rosenzweig2020-05-261-3/+3
| | | | | | Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5100>
* meson: inline `inc_common`Eric Engestrom2020-03-281-1/+1
| | | | | | | | | Let's make it clear what includes are being added everywhere, so that they can be cleaned up. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4360>
* gallium/util: Add back (and rename) util_float_to_half implementationRoland Scheidegger2020-03-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | This implementation was removed by 8b8af6d3 ("gallium/util: Switch util_float_to_half to _mesa_float_to_half()'s impl.") It was not actually broken, but _mesa_float_to_half() implements round-to-nearest-even, whereas util_float_to_half() implemented round-to-zero. So rename it appropriately. GL actually never cares about rounding (except a broken piglit test), however d3d10 very much does and requires RTZ for float to half conversion. Moreover, apparently at least radeon gpus actually always do RTZ when doing RT writes (and I'd suspect for shader image writes as well). Hence it seems appropriate to hook up this rtz function to the format instead. This will cause llvmpipe and softpipe to use rtz rounding for clears with half float formats, and softpipe would use rtz behavior for rt writes as well (llvmpipe has that hardcoded), not sure if "real" hw drivers hit this function for much. (For shader opcodes would still need to figure out what rounding to use appropriately, but this is a question for another day.) Note should probably unify with _mesa_float_to_float16_rtz. Unclear at this point which one is better, so just restore previous function here. Reviewed-by: Marek Olšák <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4312> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4312>
* Revert "gallium: Fix big-endian addressing of non-bitmask array formats."Eric Anholt2020-02-111-17/+6
| | | | | | | | | | | | | | | | | | | | | | | | This reverts the functional part of commit d17ff2f7f1864c81c1e00d04baf20f953c6d276a, leaving the unit test for mesa/pipe agreement on what's an array. The issue is that the util_channel_desc.shift values on array formats are not used for bit addressing in memory, they're bit addressing within a word treating a pixel of the format as a native type, as seen by llvmpipe's use of the values to do shifts (see lp_build_unpack_arith_rgba_aos() for example). This means the values are nonsensical for 3-byte RGB, but then llvmpipe doesn't expose those formats so it works out. I still want to clean up our big-endian format handling at some point, but let's fix the s390x regression first, sort out our format unit tests in CI, then be able to refactor with confidence. Fixes: d17ff2f7f186 ("gallium: Fix big-endian addressing of non-bitmask array formats.") Closes: #2472 Acked-by: Marek Olšák <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3721> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3721>
* util: Drop unpacking from int signed to unsigned and vice versa.Eric Anholt2020-02-042-4/+2
| | | | | | | | | | After all the previous cleanups, it's clear that the callers only ever ask for SINT->SINT or UINT->UINT. Cuts 20k of compiled text from gallium drivers. Reviewed-by: Marek Olšák <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2744> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2744>
* util: Make helper functions for pack/unpacking pixel rows.Eric Anholt2020-02-042-4/+104
| | | | | | | | | Almost all users of the unpack functions don't have strides to plug in (and many are only doing one pixel!), and this will help simplify them. Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2744>
* util/format: Add the P010 format used for 10-bit videosThong Thai2020-01-034-0/+44
| | | | | | Signed-off-by: Thong Thai <[email protected]> Reviewed-by: Leo Liu <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3153>
* util/format: add PIPE_FORMAT_ASTC_*x*x*_SRGB to util_format_{srgb,linear}()Eric Engestrom2019-12-271-0/+40
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* util/format: remove left-over util_format_description_table declarationEric Engestrom2019-12-271-4/+0
| | | | | | Fixes: 3c45c4bc44310c1af4f0 ("util: Cope with the fact that formats in u_format.csv are not ordered.") Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* util/format: add missing vulkan formatsJonathan Marek2019-12-192-2/+27
| | | | | | | | | Add some missing vulkan formats to util/format, this solves all the missing pipe format cases for the formats that turnip supports. Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3170>
* st/mesa: Add GL_TDFX_texture_compression_FXT1 supportKenneth Graunke2019-12-011-0/+1
| | | | | | | | | | | | | Eric recently added PIPE_FORMAT_FXT1_RGB[A] as part of his format unification work. This was really most of the work of implementing the extension. We just need to handle it in a couple of places and expose the extension. v2: Reject the new formats in llvmpipe_is_format_supported to prevent crashes because it doesn't know how to handle the new formats. Reviewed-by: Marek Olšák <[email protected]> [v1] Reviewed-by: Eric Anholt <[email protected]> [v1]
* util: Move gallium's PIPE_FORMAT utils to /util/format/Eric Anholt2019-11-1425-0/+11248
To make PIPE_FORMATs usable from non-gallium parts of Mesa, I want to move their helpers out of gallium. Since u_format used util_copy_rect(), I moved that in there, too. I've put it in a separate directory in util/ because it's a big chunk of related code, and it's not clear to me whether we might want it as a separate library from libmesa_util at some point. Closes: #1905 Acked-by: Marek Olšák <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>