[Piglit] [PATCH] gl-1.0/long-dlist: add test of long display lists

Eric Anholt eric at anholt.net
Tue Dec 3 14:37:40 PST 2013


Brian Paul <brianp at vmware.com> writes:
> +/**
> + * Test a long-ish display list to make sure Mesa's display list
> + * implementation (linked list of blocks) works properly.
> + * Ideally, this test should be run with valgrind.
> + */
> +
> +#include "piglit-util-gl-common.h"
> +
> +
> +PIGLIT_GL_TEST_CONFIG_BEGIN
> +	config.supports_gl_compat_version = 10;
> +	config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA;
> +PIGLIT_GL_TEST_CONFIG_END
> +
> +
> +static GLuint
> +build_long_list(void)
> +{
> +	static const GLfloat color[4] = { 1.0f, 0.5f, 0.25f, 1.0f };
> +	GLuint list, i;
> +
> +	list = glGenLists(1);
> +	glNewList(list, GL_COMPILE);
> +
> +	/* build a list of non-vertex commands (since vertex data is
> +	 * typically put into a VBO).
> +	 */
> +	for (i = 0; i < 10 * 1000; i++) {
> +		glEnable(GL_CULL_FACE);
> +		glLightfv(GL_LIGHT0, GL_AMBIENT, color);
> +		glStencilOp(GL_KEEP, GL_INCR, GL_DECR);
> +		glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_BLEND);
> +		glBindTexture(GL_TEXTURE_2D, 1);
> +		glPointSize(1.0);
> +		glFogf(GL_FOG_DENSITY, 5.0);
> +		glDisable(GL_FOG);
> +	}

I like the idea, but I'd be worried that the implementation would notice
these redundant state updates and drop them, defeating the test.

On the other hand, if you're not that interested in pursuing it, since
it appears to have served a purpose in Mesa development,

Reviewed-by: Eric Anholt <eric at anholt.net>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20131203/d1215618/attachment.pgp>


More information about the Piglit mailing list