[Piglit] [PATCH 1/2] etc2: Add test to verify texturing with etc2 miptree

Eric Anholt eric at anholt.net
Wed Nov 14 15:13:31 PST 2012


Anuj Phogat <anuj.phogat at gmail.com> writes:

> This test make use of code from an existing etc1 test in
> tests/spec/oes_compressed_etc1_rgb8_texture
>
> Verifies texturing with following etc2 formats:
> GL_COMPRESSED_RGB8_ETC2
> GL_COMPRESSED_SRGB8_ETC2
> GL_COMPRESSED_RGBA8_ETC2_EAC
> GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC
> GL_COMPRESSED_R11_EAC
> GL_COMPRESSED_RG11_EAC
>
> Each format requires a compressed and decompressed texture data file,
> which are added as a part of this commit.

These look like a good way to do the testing to me.  Just a few style notes.

> +/**
> + * \file
> + * \brief Test texturing from an ETC2 miptree of a real image.
> + *
> + * This test uses two data files for each etc2 format:
> + * The file waffles-compressed-etc2-xxxx-64x32-mipmap.ktx contains a full
> + * miptree in compressed ETC2 format of a 2D texture of waffles and fruit [1].
> + * The base level size is 64x32 pixels.
> + * The file waffles-decompressed-xxxx-64x32-mipmap.ktx contains a parallel
> + * miptree in corresponding decompressed format. Each of its images was
> + * obtained by decompressing the correspondingETC2 image with etcpack [2].
                                                 ^ missing space

> +#define num_levels 7
> +#define level0_width 64
> +#define level0_height 32
> +
> +#define num_vertices 4

I'd prefer to see these #defines be static const ints.

> +static const int window_width = 2 * level0_width;
> +static const int window_height = 2 * level0_height;


> +	/* Draw a square triangle strip. */
> +	const GLfloat vertices[2 * num_vertices] = {
> +		0, 0,
> +		1, 0,
> +		1, 1,
> +		0, 1,
> +	};

Hmm.  The commented code doesn't do drawing, and the later drawing call
does a trifan.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20121114/5af79532/attachment.pgp>


More information about the Piglit mailing list