[patches] re-enable ARB_texture_rectangle



On Wed, 2008-11-05 at 13:03 -0500, Owen Taylor wrote:
> On Wed, 2008-11-05 at 16:36 +0000, Matthew Allum wrote:
> > On Wed, 2008-11-05 at 10:22 -0500, Owen Taylor wrote:
> 
> > > I see two basic routes I could take:
> > > 
> > > 1) I could add support for ARB_texture_rectangle into cogl_texture.
> > >    Presumably this would look like cogl_texture_new_rectangle()
> > >    or something ... you'd have to explicitly ask to get a rectangular
> > >    texture, since they do behave significantly different.
[...]
> [...]
> > 
> > I think making it usage explicit and contained like this is really the
> > only way to go in we do bring back in support for ARB_texture_rectangle
> > without a lot of complexity and other pain elsewhere. 
> > 
> > Re devel branch - I dont see why this could not end up in the stable
> > branch of which we are already having to track pretty much with mutter.
> 
> My initial expectation was that there would be significant code churn
> and API changes, but looking at it, the "remove texture_rectangle
> support" patch is a lot smaller than I expected and doesn't look to hard
> or intrusive to reintroduce. 
> 
> I'll do some more experimentation with that and see if it I can get it
> to work and see if it fixes some of the other issues people are having.

OK, here's a stab at this. The first two patches (one for clutter, one
for metacity-clutter) basically simply revert the removal of
ARB_texture_rectangle support from clutter.

However, that leaves two problems:

 - texture_rectangle might unexpectedly be used in places that
   clutter-0.8 code won't expect, breaking compatibility.

 - for texture_from_pixmap, I want a way to actually force
   texture_rectangle to be used, to deal with driver bugs.
   (The current proprietary NVIDIA drivers are buggy this way;
   and I think also older Intel drivers.)

So, the second two patches add:

 cogl_texture_new_with_size_and_options()
 cogl_texture_new_from_data_and_options()
 cogl_texture_new_from_file_and_options() // for completeness 

Where auto_mipmap is replaced with a flags field. (If breaking cogl
compat, you'd just want to change existing functions.) texture_rectangle
is not used by default, but you can pass:

 COGL_TEXTURE_ALLOW_RECTANGLE: allow it to be used
 COGL_TEXTURE_FORCE_RECTANGLE: use in preference to NPOT textures

And ClutterGLXPixmapTexture supports an environment variable 
CLUTTER_PIXMAP_TEXTURE_RECTANGLE=[force|disable].

The default is to allow - there's a good argument that it should default
to 'force' instead, considering the widespread presence of such buggy
drivers.

- Owen







[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]