-
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 <anuj.phogat@gmail.com> Acked-by: Marek Olšák <maraeo@gmail.com>
10d0fab8