[Piglit] [PATCH 1/3] copyteximage: drop redundant z=0, w=1 initialization

Ian Romanick idr at freedesktop.org
Tue Aug 25 06:45:26 PDT 2015


On 08/24/2015 09:38 PM, Erik Faye-Lund wrote:
> We can just ask OpenGL to use the default values instead.
> 
> Signed-off-by: Erik Faye-Lund <kusmabite at gmail.com>

This patch is

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

> ---
>  tests/texturing/copyteximage.c | 24 ++++--------------------
>  1 file changed, 4 insertions(+), 20 deletions(-)
> 
> diff --git a/tests/texturing/copyteximage.c b/tests/texturing/copyteximage.c
> index af65d5f..48b2263 100644
> --- a/tests/texturing/copyteximage.c
> +++ b/tests/texturing/copyteximage.c
> @@ -305,39 +305,31 @@ static GLvoid
>  draw_rect_tex_3d(float x, float y, float w, float h,
>                   float tx, float ty, float tz, float tw, float th)
>  {
> -	float verts[4][4];
> +	float verts[4][2];
>  	float tex[4][3];
>  
>  	verts[0][0] = x;
>  	verts[0][1] = y;
> -	verts[0][2] = 0.0;
> -	verts[0][3] = 1.0;
>  	tex[0][0] = tx;
>  	tex[0][1] = ty;
>  	tex[0][2] = tz;
>  	verts[1][0] = x + w;
>  	verts[1][1] = y;
> -	verts[1][2] = 0.0;
> -	verts[1][3] = 1.0;
>  	tex[1][0] = tx + tw;
>  	tex[1][1] = ty;
>  	tex[1][2] = tz;
>  	verts[2][0] = x;
>  	verts[2][1] = y + h;
> -	verts[2][2] = 0.0;
> -	verts[2][3] = 1.0;
>  	tex[2][0] = tx;
>  	tex[2][1] = ty + th;
>  	tex[2][2] = tz;
>  	verts[3][0] = x + w;
>  	verts[3][1] = y + h;
> -	verts[3][2] = 0.0;
> -	verts[3][3] = 1.0;
>  	tex[3][0] = tx + tw;
>  	tex[3][1] = ty + th;
>  	tex[3][2] = tz;
>  
> -	glVertexPointer(4, GL_FLOAT, 0, verts);
> +	glVertexPointer(2, GL_FLOAT, 0, verts);
>  	glTexCoordPointer(3, GL_FLOAT, 0, tex);
>  	glEnableClientState(GL_VERTEX_ARRAY);
>  	glEnableClientState(GL_TEXTURE_COORD_ARRAY);
> @@ -356,26 +348,18 @@ draw_rect_tex_3d(float x, float y, float w, float h,
>  static GLvoid
>  draw_rect_tex_cube_face(float x, float y, float w, float h, int face)
>  {
> -	float verts[4][4];
> +	float verts[4][2];
>  
>  	verts[0][0] = x;
>  	verts[0][1] = y;
> -	verts[0][2] = 0.0;
> -	verts[0][3] = 1.0;
>  	verts[1][0] = x + w;
>  	verts[1][1] = y;
> -	verts[1][2] = 0.0;
> -	verts[1][3] = 1.0;
>  	verts[2][0] = x + w;
>  	verts[2][1] = y + h;
> -	verts[2][2] = 0.0;
> -	verts[2][3] = 1.0;
>  	verts[3][0] = x;
>  	verts[3][1] = y + h;
> -	verts[3][2] = 0.0;
> -	verts[3][3] = 1.0;
>  
> -	glVertexPointer(4, GL_FLOAT, 0, verts);
> +	glVertexPointer(2, GL_FLOAT, 0, verts);
>  	glTexCoordPointer(3, GL_FLOAT, 0, cube_face_texcoords[face]);
>  	glEnableClientState(GL_VERTEX_ARRAY);
>  	glEnableClientState(GL_TEXTURE_COORD_ARRAY);
> 



More information about the Piglit mailing list