• Paul Berry's avatar
    util: Generalize piglit_probe_image_{rgb,rgba} · 10d0fab8
    Paul Berry authored
    This patch eliminates code duplication between
    piglit_probe_image_rgb() and piglit_probe_image_rgba() by implementing
    them both in terms of a common function, piglit_probe_image_color().
    In addition to being able to test GL_RGB and GL_RGBA,
    piglit_probe_image_color() should be able to test any color buffer
    format (e.g. GL_RG or GL_LUMINANCE_ALPHA).
    piglit_probe_image_color() makes use of a new function,
    piglit_num_components(), to determine how many components a given base
    internal format contains (e.g. piglit_num_components(GL_RGBA) == 4).
    This function is exposed through piglit-util.h in case it can be
    useful in writing tests.
    Reviewed-by: Anuj Phogat's avatarAnuj Phogat <anuj.phogat@gmail.com>
    Acked-by: Marek Olšák's avatarMarek Olšák <maraeo@gmail.com>
piglit-util-gl.c 29.9 KB