[Piglit] [PATCH] texture-integer: use usampler/uint value

Ian Romanick idr at freedesktop.org
Mon Nov 23 13:17:24 PST 2015


On 11/20/2015 09:24 PM, Ilia Mirkin wrote:
> All of the random values are positive. Mixing uint texture with isampler
> is not allowed, and happens to cause problems for freedreno. Using uint
> works.

I guess I'm confused what the actual problem is.  The test previously
used isampler with ivec4.  Did that work with freedreno?  Is the UINT
vs. INT base type of the texture the problem?

In other news... piglit's coverage of integer samplers is *pathetic*.
I grepped for all uses of isampler or usampler.  The second grep just
filters out the compiler tests.

$ grep -r [iu]sampler tests/spec/ tests/shaders/ | egrep -v '[.](vert|frag|geom):'
tests/spec/arb_texture_buffer_range/ranges.c:	"uniform usamplerBuffer buf;\n"
tests/spec/arb_stencil_texturing/draw.c:/** A program that samples from stencil using usampler2D. */
tests/spec/arb_stencil_texturing/draw.c: * should be read using an unsigned integer usampler2D.  So, we need two
tests/spec/arb_stencil_texturing/draw.c:	"uniform usampler2D tex;\n"
tests/spec/arb_stencil_texturing/draw.c:	piglit_require_GLSL_version(130); /* for usampler2D */
tests/spec/ext_texture_integer/texture-integer-glsl130.c:	"uniform isampler2D tex; \n"
tests/spec/ext_framebuffer_multisample/fast-clear.c:	"uniform isampler2DMS tex;\n"
tests/spec/ext_framebuffer_multisample/fast-clear.c:	"uniform usampler2DMS tex;\n"
tests/spec/gl-3.0/texture-integer.c:	"uniform isampler2D tex; \n"
tests/spec/arb_texture_view/rendering-formats.c:			"uniform usampler2D s;\n"
tests/spec/arb_texture_stencil8/draw.c:/** A program that samples from stencil using usampler2D. */
tests/spec/arb_texture_stencil8/draw.c:	"uniform usampler2D tex;\n"
tests/spec/arb_sample_shading/execution/builtin-gl-sample-id.cpp:			 "isampler2DMS", ", i");
tests/spec/arb_sample_shading/execution/builtin-gl-sample-id.cpp:		asprintf(&frag_1, frag_template, "", "isampler2DRect", "");

Only 2D targets (no array, 3D, or cube targets) are tested.  Almost all
of the tests require other extensions that many drivers do not support.

There are plenty of compiler tests that verify all the sampler types
and sampler functions are available, so I guess that something.

> ---
>  tests/spec/gl-3.0/texture-integer.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/spec/gl-3.0/texture-integer.c b/tests/spec/gl-3.0/texture-integer.c
> index 5fe90aa..389164b 100644
> --- a/tests/spec/gl-3.0/texture-integer.c
> +++ b/tests/spec/gl-3.0/texture-integer.c
> @@ -105,10 +105,10 @@ static const struct format_info Formats[] = {
>  static const char *FragShaderText =
>  	"#version 130 \n"
>  	"uniform vec4 bias; \n"
> -	"uniform isampler2D tex; \n"
> +	"uniform usampler2D tex; \n"
>  	"void main() \n"
>  	"{ \n"
> -	"   ivec4 t = texture(tex, gl_TexCoord[0].xy); \n"
> +	"   uvec4 t = texture(tex, gl_TexCoord[0].xy); \n"
>  	"   gl_FragColor = vec4(t) + bias; \n"
>  	"} \n";
>  
> 



More information about the Piglit mailing list