[comp.sys.sgi] How to time v3f, etc.

pmartz@undies.dsd.es.com (Paul Martz) (04/30/91)

In article <1991Apr29.154346.6866@odin.corp.sgi.com>, kurt@cashew.asd.sgi.com (Kurt Akeley) writes:
> The n3f/v3f calls block only until the vector data have been copied from
> your data space, not until the drawing commands have actually been
> completed.  Typically the data are copied to the head of a several hundred
> word fifo, which tail is connected to the graphics hardware.

Suppose I'm trying to time my performance. Let's say I get the current
clock time in milliseconds, then I send down several bgnpoly()'s,
v3f()'s, and endpoly()'s. Then I get the clock time in milliseconds
again, subtract it from the start time, and divide by the number of
polygons.

What have I just timed? Have I timed copying data to a fifo, or have I
timed the actual drawing? Does calling endpoly() block until the fifo
is empty? If not (and I hope not), what gl function can I call which
will? (swapbuffers() wouldn't be what I'd want, because I don't want
buffer swaps included in the timing.)
-- 

   -paul	pmartz@dsd.es.com
		Evans & Sutherland

kurt@cashew.asd.sgi.com (Kurt Akeley) (05/01/91)

In article <1991Apr29.173254.18921@dsd.es.com>, pmartz@undies.dsd.es.com (Paul Martz) writes:

|> Suppose I'm trying to time my performance. Let's say I get the current
|> clock time in milliseconds, then I send down several bgnpoly()'s,
|> v3f()'s, and endpoly()'s. Then I get the clock time in milliseconds
|> again, subtract it from the start time, and divide by the number of
|> polygons.
|> 
|> What have I just timed? Have I timed copying data to a fifo, or have I
|> timed the actual drawing? Does calling endpoly() block until the fifo
|> is empty? If not (and I hope not), what gl function can I call which
|> will? (swapbuffers() wouldn't be what I'd want, because I don't want
|> buffer swaps included in the timing.)

Yes, you've timed the transfer of the data to the fifo.  To wait until all
drawing is complete, call GL routine finish().  To avoid corruption resulting
from the delay of the finish command itself, run your tests for one second
or more.

-- Kurt

mg@godzilla.cgl.rmit.oz.au (Mike Gigante) (05/02/91)

When i am timing graphics stuff, I use 'finish()' It inserts a token into
the pipeline and returns when that token has passed through.

For large no of other GL calls, the cost of finish will be negligible..

Mike