At 05:32 PM 10/14/99 -0600, Brett Johnson wrote:

>> On the flip side, does it make sense to even call GetProcAddress before you
>> have queried the existance of an extension?  I think not.
>
>I can think of at least one instance where it makes sense:
>
>  - You're writing a library.  At initialization, you want to gather all of
>    the function pointers you might call later (depending on whether the
>    associated extension is supported).

I suppose its a matter of style.  I would query for extension support
before querying the entry points themselves.  There's no reason it can't be
done in the other order, besides aesthetics.

>>  And synthesizing
>> the GLX protocol requires an implementation to provide a template; the
>> client side GLX can't do its initialization work unless an implementation
>> is present.  I suppose this can all be done at process initialization time,
>> when each driver registers itself with the GLX.  Sounds like a pretty
>> heavy-weight initialization though.  Maybe we should stick with context
>> dependence, hehe.  :)
>
>I don't understand the point you're making here Michael.  There is a fixed
>amount of initialization overhead added to every context creation in order
>to support context independent pointers (i.e. the driver must "register" all
>of its supported entrypoints).  Why would this overhead be any different for
>an indirect context?  Am I missing something?

What does GLX do when GetProcAddress is called for a remote display?  It
must set up a wrapper proc to dispatch over the wire.  It must know the
protocol.  It can only know this by querying an implementation which
supports the extension.  It only needs this from one supporting
implementation, since it will be the same for all, but it cannot do this
work without it.

If we want context independence, and don't want to require a context to be
present when GetProcAddress is called, we must know the protocol up front.
When GLX initializes, it must query all drivers available on the server for
every protocol template for every extension.  Or it can do this when
GetProcAddress is called.  Or it can do it lazily via a "thunk" mechanism
the first time the function is called.  The point is there is some work to
be done here, and its a lot easier if there is a context present.

... This all assumes, of course, that we plan to support GetProcAddress for
indirect rendering contexts, and we don't want to require the client to
have knowledge of the extension.

Thanks,

 -- Michael

Reply via email to