[Piglit] [PATCH 1/2] arb_texture_cube_map_array: sample-cube-map-array-shadow sample from second layer
Brian Paul
brianp at vmware.com
Mon Nov 5 06:40:48 PST 2012
On 11/03/2012 02:37 AM, Dave Airlie wrote:
> This test wasn't actually testing array behaviour at all, so
> wouldn't catch the case where the layer was getting lost.
>
> This modifies the test so that it samples from the second layer,
> and makes the contents of the first layer incorrect to catch
> this case.
>
> Signed-off-by: Dave Airlie<airlied at redhat.com>
> ---
> .../sampler-cube-array-shadow.c | 30 ++++++++++++++--------
> 1 file changed, 20 insertions(+), 10 deletions(-)
>
> diff --git a/tests/spec/arb_texture_cube_map_array/sampler-cube-array-shadow.c b/tests/spec/arb_texture_cube_map_array/sampler-cube-array-shadow.c
> index d80f596..35818ce 100644
> --- a/tests/spec/arb_texture_cube_map_array/sampler-cube-array-shadow.c
> +++ b/tests/spec/arb_texture_cube_map_array/sampler-cube-array-shadow.c
> @@ -60,12 +60,13 @@ static GLfloat compvals[6][4] = { { -0.50, 0.00, 0.50, 0.00 },
> { 0.90, 0.90, 0.90, 0.90 } };
>
> #define STRIDE (5 * sizeof(GLfloat))
> -void setup_texcoords(void)
> +void setup_texcoords(float layer_sample)
> {
> int i, j;
> for (i = 0; i< 6; i++) {
> for (j = 0; j< 4; j++) {
> memcpy(cube_shadow_texcoords[i][j], cube_face_texcoords[i][j], 3 * sizeof(GLfloat));
> + cube_shadow_texcoords[i][j][3] = layer_sample;
> cube_shadow_texcoords[i][j][4] = compvals[i][j];
> }
> }
> @@ -109,17 +110,26 @@ loadTex(void)
> #define height 2
> #define width 2
> int i, j;
> - GLfloat tex_vals[6][width][height];
> + GLfloat tex_vals[12][width][height];
>
> /* Set the cubemap depth values for each face */
> for (i=0; i< height; ++i) {
> for (j=0; j< width; ++j) {
> - tex_vals[0][i][j] = 0.0;
> - tex_vals[1][i][j] = 0.2;
> - tex_vals[2][i][j] = 0.35;
> - tex_vals[3][i][j] = 0.50;
> - tex_vals[4][i][j] = 0.75;
> - tex_vals[5][i][j] = 1.0;
> + /* fill base layer with wrong stuff - checks
> + we don't accidentally sample layer 0 */
> + tex_vals[0][i][j] = 1.0;
> + tex_vals[1][i][j] = 0.75;
> + tex_vals[2][i][j] = 0.50;
> + tex_vals[3][i][j] = 0.35;
> + tex_vals[4][i][j] = 0.2;
> + tex_vals[5][i][j] = 0.0;
> +
> + tex_vals[6][i][j] = 0.0;
> + tex_vals[7][i][j] = 0.2;
> + tex_vals[8][i][j] = 0.35;
> + tex_vals[9][i][j] = 0.50;
> + tex_vals[10][i][j] = 0.75;
> + tex_vals[11][i][j] = 1.0;
> }
> }
>
> @@ -144,7 +154,7 @@ loadTex(void)
> GL_LEQUAL);
>
> glTexImage3D(GL_TEXTURE_CUBE_MAP_ARRAY, 0, GL_DEPTH_COMPONENT,
> - width, height, 6, 0, GL_DEPTH_COMPONENT, GL_FLOAT, (void*)tex_vals);
> + width, height, 12, 0, GL_DEPTH_COMPONENT, GL_FLOAT, (void*)tex_vals);
> #undef height
> #undef width
> }
> @@ -163,7 +173,7 @@ piglit_init(int argc, char **argv)
> glLoadIdentity();
> glClearColor(0.1, 0.1, 0.1, 1.0);
> shaderSetup();
> - setup_texcoords();
> + setup_texcoords(1.0);
> }
>
> enum piglit_result
Looks alright to me. For both: Reviewed-by: Brian Paul
<brianp at vmware.com>
More information about the Piglit
mailing list