On Wed, Dec 04, 2002 at 02:21:30PM -0800, Ian Romanick wrote:
> 
> As far as I can tell, there is no way either an app or a wrapper library
> could communicate this information to the driver.  Yet, shipping "high end"
> drivers support and demanding users expect this level of
> application-to-driver tuning.

A wrapper library doesn't have to communicate any information to the driver
- it just intercepts the function calls and turns them into something based
on the user's preference.

Like, here, a concrete example, based on the topic which sparked this whole
discussion to begin with.  Let's say an application does

        glTexImage2D(GL_TEXTURE_2D, blah, blah, blah, GL_RGB,
            GL_UNSIGNED_BYTE, blah);

and the driver decides that GL_RGB should default to GL_RGB4.  But the user
doesn't want that to happen, so they configure the wrapper library to
intercept that call and turn it into:

        glTexImage2D(GL_TEXTURE_2D, blah, blah, blah, GL_RGB8,
            GL_UNSIGNED_BYTE, blah);

See what I'm saying?  The wrapper library wouldn't explicitly tell "the
driver" anything, it'd just make hints based on user preferences, rather
than based on driver default.

Or, for a more complex idea, let's say the user wants to force wireframe
rendering and FSAA.  Probably the easiest way for this to happen is for the
wrapper library to have something like:

void glXMakeCurrent(Display *dpy, Window win, GLXContext ctx)
{
        real_glXMakeCurrent(dpy, win, ctx);
        SetupOverridenStuff();
}

void SetupOverriddenStuff()
{
        if (override_wireframe)
                real_glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
        if (override_fsaa)
                real_glEnable(GL_whatever_it_is_to_enable_FSAA);
        // ...
}

and then the overridden glPolygonMode would be, for example,

void glPolygonMode(GLEnum foo, GLEnum bar)
{
        if (!override_wireframe)
                real_glPolygonMode(foo, bar);
}

and so on.

See, the wrapper wouldn't have to communicate directly to the driver in
order to do any of what's been discussed - it would override it *based on
user preferences* using the existing high-level functionality provided by
OpenGL itself.

-- 
http://trikuare.cx


-------------------------------------------------------
This SF.net email is sponsored by: Microsoft Visual Studio.NET 
comprehensive development tool, built to increase your 
productivity. Try a free online hosted session at:
http://ads.sourceforge.net/cgi-bin/redirect.pl?micr0003en
_______________________________________________
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to