From: Allen B. <ba...@lo...> - 2001-05-02 16:57:15
|
Hi, While trying to diagnose a rendering problem with my code, I added a call to glGetError after each glVertex call between glBegin and glEnd. With Mesa compiled with debugging turned on, _mesa_error was reporting INVALID OPERATION to stdout even though glGetError itself returned 0. According to the man page, this is the correct result but it also mentions that there should be no other side effects. However, when calling glGetError, the FLUSH_VERTICES macro is invoked by the ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL macro at the beginning of _mesa_GetError. This seems to have a (negative) effect on the display list which is being constructed. I activated the _tnl_print_cassette function in _tnl_compile_cassette. WITHOUT calling glGetError between glBegin/End, after all three vertices have been defined, _tnl_print_cassette produces: Cassette id 0, 3 rows. Contains at least one: (0x880001) eye/glbegin, obj, obj-3, Contains a full complement of: (0x80001) obj, obj-3, Final begin/end state out/out, errors y/n 3: Obj 0.000000 0.000000 0.000000 1.000000 BEGIN(GL_POLYGON) (BEGIN,END,) 4: Obj 10.000000 0.000000 0.000000 1.000000 5: Obj 0.000000 10.000000 0.000000 1.000000 6: END which seems reasonable. If I call glGetError after each glVertex, then I get three separate invocations of _tnl_compile_cassette after each vertex is defined: Cassette id 0, 1 rows. Contains at least one: (0x880001) eye/glbegin, obj, obj-3, Contains a full complement of: (0x880001) eye/glbegin, obj, obj-3, Final begin/end state in/in, errors y/n 3: Obj 0.000000 0.000000 0.000000 1.000000 BEGIN(GL_POLYGON) (LAST,BEGIN,) 4: ............ some output deleted .......... Cassette id 0, 1 rows. Contains at least one: (0x80001) obj, obj-3, Contains a full complement of: (0x80001) obj, obj-3, Final begin/end state in/in, errors n/n 8: Obj 10.000000 0.000000 0.000000 1.000000 9: ............ some output deleted ........... Cassette id 0, 1 rows. Contains at least one: (0x80001) obj, obj-3, Contains a full complement of: (0x80001) obj, obj-3, Final begin/end state in/in, errors n/n 13: Obj 0.000000 10.000000 0.000000 1.000000 14: ............ some output deleted ........... Cassette id 0, 0 rows. Contains at least one: (0x0) 18: END When I draw this display list later, I get a torrent of INVALID OPERATION errors. This looks like a bug, but perhaps I shouldn't be calling glGetError between glBegin/End anyway. As always, thanks for the tremendous effort you guys put into this library. Allen |