• Tomeu Vizoso's avatar
    mesa: handle a bunch of formats in IMPLEMENTATION_COLOR_READ_* · 3f7c2148
    Tomeu Vizoso authored
    Virgl could save a lot of work converting buffers in the host side
    between formats if Mesa supported a bunch of other formats when reading
    pixels.
    
    This commit adds cases to handle specific formats so that the values
    reported by the two calls match more closely the underlying native
    formats.
    
    In GLES is important that IMPLEMENTATION_COLOR_READ_* return the native
    format and data type because the spec only allows reading with those,
    besides GL_RGBA or GL_RGBA_INTEGER.
    
    Additionally, because virgl currently doesn't implement such
    conversions, this commit fixes several tests in
    dEQP-GLES3.functional.fbo.color.clear.*, when using virgl in the guest
    side.
    
    The logic is based on knowledge that is shared with
    _mesa_format_matches_format_and_type() but we cannot assert that the
    results match as we don't have all the starting information at both
    points. So leave the assert out and hope CI comes soon to save us all.
    
    v2: * Let R10G10B10A2_UINT fall back to GL_RGBA_INTEGER (Eric Anholt)
        * Assert with _mesa_format_matches_format_and_type (Eric Anholt)
    
    v3: * Remove the assert, as it won't be reliable (Eric Anholt)
    
    v4: * Use _mesa_is_format_integer in the fallback (Eric Anholt)
    
    v5: * Remove superfluous call to
          _mesa_uncompressed_format_to_type_and_comps (Eric Anholt)
    Reviewed-by: 's avatarGurchetan Singh <gurchetansingh@chromium.org>
    Reviewed-by: 's avatarEric Anholt <eric@anholt.net>
    Signed-off-by: Tomeu Vizoso's avatarTomeu Vizoso <tomeu.vizoso@collabora.com>
    Signed-off-by: 's avatarJakob Bornecrantz <jakob@collabora.com>
    3f7c2148
Name
Last commit
Last update
bin Loading commit data...
build-support Loading commit data...
docs Loading commit data...
doxygen Loading commit data...
include Loading commit data...
m4 Loading commit data...
scons Loading commit data...
scripts Loading commit data...
src Loading commit data...
.dir-locals.el Loading commit data...
.editorconfig Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
.travis.yml Loading commit data...
Android.common.mk Loading commit data...
Android.mk Loading commit data...
CleanSpec.mk Loading commit data...
Makefile.am Loading commit data...
README.rst Loading commit data...
REVIEWERS Loading commit data...
SConstruct Loading commit data...
VERSION Loading commit data...
appveyor.yml Loading commit data...
autogen.sh Loading commit data...
common.py Loading commit data...
configure.ac Loading commit data...
install-gallium-links.mk Loading commit data...
install-lib-links.mk Loading commit data...
meson.build Loading commit data...
meson_options.txt Loading commit data...