[Piglit] [PATCH] ext_texture_format_bgra8888: Add test for GL_BGRA format in Tex(Sub)Image calls
Emil Velikov
emil.l.velikov at gmail.com
Thu Oct 15 10:25:26 PDT 2015
Hi Eduardo,
A few humble suggestions.
On 15 October 2015 at 02:50, Eduardo Lima Mitev <elima at igalia.com> wrote:
> This is a new test that checks valid and invalid combinations of GL_BGRA_EXT
> format and internal format in Tex(Sub)Image2D calls, as specified by the
> EXT_texture_format_BGRA8888 extension
> <https://www.khronos.org/registry/gles/extensions/EXT/EXT_texture_format_BGRA8888.txt>.
There is no need to provide a link to the spec in commit messages.
[snip]
> +static GLboolean
Please use bool.
> +run_test(void)
> +{
> + GLuint tex;
> +
> + glGenTextures(1, &tex);
> + glBindTexture(GL_TEXTURE_2D, tex);
> + if (!piglit_check_gl_error(GL_NO_ERROR))
> + return false;
> +
> + /* glTexImage2D */
> + glTexImage2D(GL_TEXTURE_2D, 0, GL_BGRA_EXT, 2, 2, 0, GL_BGRA_EXT, GL_UNSIGNED_BYTE, NULL);
Wrap the last three arguments to the next line ? Here and below.
> + if (!piglit_check_gl_error(GL_NO_ERROR))
> + return false;
Most places in piglit continue running all (sub)tests, even if there
is a failure midway. One common pattern is
bool pass = true;
...
glFoo()
if (!piglit_check_gl_error...)
pass = false;
...
return pass;
Cheers,
Emil
P.S. piglit tries to use tabs for indentation, albeit some tests use spaces.
More information about the Piglit
mailing list