Performance problem: glViewport() called every draw

New Message Reply Date view Thread view Subject view Author view

Moshe Nissim (moshe++at++orad.co.il)
Mon, 28 Sep 1998 16:37:16 +0300


Hi all,

I came across the following when trying to investigate the strangely slow
performance of Performer on an empty scene graph.

Starting with par -r (process activity tracing), I saw that the X-server (Xsgi)
is context-switching at 100 Hz , when perfly is running at 50 Hz.

By forcing socket communication between perfly and Xsgi (setenv DISPLAY unix:0)
I could dbx perfly and break in write() to see what causes Xlib calls that go to
the server. (normal setenv DISPLAY :0 uses shared-memory transport, so write()
is not called).

It turns out that glViewport() is being called once EVERY draw cycle
by pfChannel::pf_applyView(). This happens in 2.1 and in 2.2.
glViewport() itself calls both XGetGeometry() and XTranslateCoordinates(),
which cause two server round-trips.
(the dbx stack traces are attached)

[ This is actually OpenGL implementation dependent. The only exception I found
was 6.2 on Onyx1, where glViewport() DOESN'T call these functions. ]

So the question is two-fold

1. Why is Performer calling glViewport() every pfFrame(), when there was no real change
(neither by pfChannel::setViewport of pfChanViewport(), nor window-manager event
of window size/position change)
2. Why is OpenGL accessing the X-server for every glViewport() call.

Thanks & Bye,
Moshe

--
  Moshe Nissim,   Orad Hi-Tec Systems
  Tel: (972) - 9 - 7676862 (ext. 579)
  Fax: (972) - 9 - 7676861
  Email: moshe++at++orad.co.il



New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Sep 28 1998 - 07:37:45 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.