[Mesa-dev] [RFC] [PATCH 0/3] Make Gallium aware of GL_TEXTURE_RECTANGLE

Marek Olšák maraeo at gmail.com
Wed Aug 11 10:44:57 PDT 2010


I agree that if a texture was created as GL_TEXTURE_RECTANGLE, meaning that
all shaders use the TGSI_TEXTURE_RECT sampler type, it makes sense to use
unnormalized coordinates. However if a texture is NPOT as in OpenGL, meaning
that all shaders use the TGSI_TEXTURE_2D sampler type, we shouldn't force
unnormalized texture coordinates everywhere and trade effectivity and
simplicity of one driver (nvfx/nv30) at the expense of another (r300). Also
I don't like changing pipe_resource::flags after a texture is created.

Some time ago I think Brian suggested to add PIPE_TEXTURE_RECT as another
texture type and make it match the meaning of GL_TEXTURE_RECTANGLE. We would
do this change but we had no time back then. This seems to be the solution
that would work best for everybody.

-Marek

On Wed, Aug 11, 2010 at 6:27 PM, Luca Barbieri <luca at luca-barbieri.com>wrote:

> > I am not sure if the following is legal, but I think we will just mask
> this
> > unnormalized flag out in resource_create, because r300 doesn't like
> (read:
> > doesn't support in hardware) unnormalized texture coordinates, and
> switching
> > shaders just because of the flag is silly.
>
> Hmm I thought it support GL_TEXTURE_RECTANGLE natively.
>
> This is making me think that my patchset is wrong in having
> blitter/blit set the flag themselves on NPOT textures.
>
> It might even be a good idea to split it in two flags, one for state
> tracker->driver communication, and another for the driver->state
> tracker.
> This way, r300g won't have to do anything.
>
> Not sure on how to call the flags though, since the current name is
> already too long.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20100811/a9d5e9cd/attachment.htm>


More information about the mesa-dev mailing list