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

Jose Fonseca jfonseca at vmware.com
Wed Nov 30 08:27:48 PST 2011


----- Original Message -----
> On Tue, 29 Nov 2011 23:32:27 -0800, Kenneth Graunke
> <kenneth at whitecape.org> wrote:
> > This exhaustively tests all of GLSL 1.30's textureSize variants,
> > both in
> > the vertex and fragment shaders.  It covers:
> > - Sampler data type (floating point, signed integer, unsigned
> > integer)
> > - Dimensionality (1D, 2D, 3D, Cube, 1DArray, 2DArray)
> > - Color and shadow samplers
> > - Mipmapped textures
> > - Non-power-of-two textures
> > 
> > It doesn't cover texture format variations.  In fact, the test
> > never
> > actually provides any content for the textures, because it should
> > be
> > irrelevant for textureSize(), is easier to program, and also extra
> > mean.
> > 
> > The new "textureSize" binary takes two arguments: shader stage and
> > sampler type.  For example:
> > 
> > ./bin/textureSize fs sampler1DArrayShadow
> > ./bin/textureSize vs usamplerCube
> > 
> > Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> > ---
> 
> > +#define BS 500
> 
> Heh.  Workaround for Windows developers always replacing nice
> asprintfs
> with snprintf instead of just defining asprintf on their platform
> produces #define BS :)

The man page for these functions says they are GNU extensions, not in C or POSIX. But I agree they enable simpler and more robust code.  I'll post a patch implementing them later.

Jose


More information about the Piglit mailing list