There's a glEnableClientState(GL_VERTEX_ARRAY) later on in the test.

Is that one sufficient enough, or does the glEnable(GL_VERTEX_ARRAY) in init() 
need to be coverted to glEnableClientState(GL_VERTEX_ARRAY) instead of simply 
being removed?


tests/general/vbo-map-remap.c
    79  static void
    80  display()
    81  {
    82          GLfloat white[4] = {1.0, 1.0, 1.0, 0.0};
    83          GLboolean pass = GL_TRUE;
    84          GLfloat varray1[12] = {175, 125, 0,
    85                                 175, 175, 0,
    86                                 125, 125, 0,
    87                                 125, 175, 0};
    88          GLfloat varray2[12] = {275, 125, 0,
    89                                 275, 175, 0,
    90                                 225, 125, 0,
    91                                 225, 175, 0};
    92          GLenum err;
    93  
    94          glBindBufferARB(GL_ARRAY_BUFFER_ARB, vbo);
    95  
->  96          glEnableClientState(GL_VERTEX_ARRAY);
    97          glVertexPointer(3, GL_FLOAT, 0, 0);
    98  
    99          vbo_write_floats_mapped(varray1, 12);
   100  
   101          glClear(GL_COLOR_BUFFER_BIT);
   102          glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
   103  
   104          vbo_write_floats_mapped(varray2, 12);
   105  
   106          glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
   107  
   108          if ((err = glGetError()) != 0) {
   109                  printf("gl error: 0x%08x\n", err);
   110                  pass = GL_FALSE;
   111          }
   112  
   113          pass = pass && piglit_probe_pixel_rgb(250, 150, white);
   114          pass = pass && piglit_probe_pixel_rgb(150, 150, white);
   115  
   116          glutSwapBuffers();
   117  
   118          glDisableClientState(GL_VERTEX_ARRAY);
   119  
   120          if (Automatic)
   121                  piglit_report_result(pass ? PIGLIT_SUCCESS : 
PIGLIT_FAILURE);
   122  }

________________________________________
From: Ian Romanick [[email protected]]
Sent: Monday, July 06, 2009 9:12 AM
To: Vinson Lee
Cc: [email protected]; [email protected]; [email protected]
Subject: Re: [Mesa3d-dev] bug in piglit vbo-map-remap.c test?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Vinson Lee wrote:
> I believe there's a bug in the piglit vbo-map-remap.c test. The test fails 
> for me with a GL_INVALID_ENUM error that comes from 
> glEnable(GL_VERTEX_ARRAY). GL_VERTEX_ARRAY is a client-side capability so the 
> error seems valid.
>
> tests/general/vbo-map-remap.c
>     42        static void
>     43        init()
>     44        {
>     45
>     46                glewInit();
>     47                glMatrixMode(GL_PROJECTION);
>     48                glPushMatrix();
>     49                glLoadIdentity();
>     50                glOrtho(0, 400, 0, 300, -1, 1);
>     51
>     52                glMatrixMode(GL_MODELVIEW);
>     53                glPushMatrix();
>     54                glLoadIdentity();
>     55
> ->  56                glEnable(GL_VERTEX_ARRAY);
>     57
>     58                glGenBuffersARB(1, &vbo);
>     59                glBindBufferARB(GL_ARRAY_BUFFER_ARB, vbo);
>     60                glBufferDataARB(GL_ARRAY_BUFFER_ARB, 12 * 
> sizeof(GLfloat),
>     61                                NULL, GL_DYNAMIC_DRAW);
>     62        }
>
>
> If I remove the glEnable line, the test passes for me.

Right.  It should be glEnableClientState.  Separation of client and
server state for the win.  Just removing the enable completely disables
the use of vertex arrays, which defeats the point of the test.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkpSInwACgkQX1gOwKyEAw+6ngCeNeW6dNJhO4kY9I24a6BFJHuo
SlMAnilBGJ76fwUC9m5mxoSS9BE7RYMB
=X9Xf
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
_______________________________________________
Mesa3d-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to