[Piglit] [PATCH 1/4] Add a new comprehensive test for textureSize().

Eric Anholt eric at anholt.net
Tue Dec 6 14:24:21 PST 2011


On Tue,  6 Dec 2011 13:23:55 -0800, Kenneth Graunke <kenneth at whitecape.org> wrote:
> +bool
> +select_sampler(const char *name)
> +{
> +	int i;
> +	bool found = false;
> +	struct {
> +		const char *name;
> +		GLenum type;
> +		GLenum target;
> +	} samplers[] = {

> +		{ "sampler1DShadow",        GL_SAMPLER_1D_SHADOW,                   GL_TEXTURE_1D             },
> +		{ "sampler2DShadow",        GL_SAMPLER_2D_SHADOW,                   GL_TEXTURE_2D             },
> +		{ "samplerCubeShadow",      GL_SAMPLER_CUBE_SHADOW,                 GL_TEXTURE_CUBE_MAP       },
> +		{ "sampler2DRectShadow",    GL_SAMPLER_2D_RECT_SHADOW,              GL_TEXTURE_RECTANGLE      },
> +		{ "sampler1DArrayShadow",   GL_SAMPLER_1D_ARRAY_SHADOW,             GL_TEXTURE_1D_ARRAY       },
> +		{ "sampler2DArrayShadow",   GL_SAMPLER_1D_ARRAY_SHADOW,             GL_TEXTURE_2D_ARRAY       },

GL_SAMPLER_2D_ARRAY_SHADOW?

(looks like type isn't used yet, though I assume it's about to be)

> +void
> +generate_texture()
> +{
> +	int l, i;
> +	GLuint tex;
> +	const GLenum target = sampler.target;
> +
> +	glActiveTexture(GL_TEXTURE0);
> +
> +	glGenTextures(1, &tex);
> +	glBindTexture(target, tex);

> +	glEnable(target);

You shouldn't need this since you aren't using fixed function fragment
shading.

Other than that,

Reviewed-by: Eric Anholt <eric at anholt.net>
-------------- 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/20111206/7178d154/attachment.pgp>


More information about the Piglit mailing list