[Mesa-dev] [PATCH 2/3] st/mesa: Finalize fbo texture attachments

Fabian Bieler der.fabe at gmx.net
Tue Apr 5 00:24:34 PDT 2011


Hello!

I don't know of an existing test or bug report about this issue.

The problem is that a texture is only finalized when bound to a texture unit 
for rendering from. The texture generation code (st_TexImage) does not 
necessarily create a pipe_resource for the texture (or attach the same pipe 
resource to the texture object and all texture images in said texture 
object).

For texture complete textures this can happen if gallium's texture generation 
code thinks there will be no further mipmap levels when specifying the first 
mipmap. Then it will only allocate enough memory for one mipmap and the next 
call to st_TexImage will release the pipe resource from the texture object to 
create a new one. Now the first mipmap has a different pipe resource than the 
texture object.
The attached piglit patch tries to demonstrate this.

For texture incomplete textures this can also happen if one specifies 
different texture images that are incompatible to one another for one texture 
object. The texture images can't share a pipe resource and so only one of 
them can use the same pipe resource as the texture object.
By the way: If one attaches two incompatible texture images from one texture 
object gallium will still fail silently. I'll submit a patch to mark these 
cases as fbo incomplete.

Fabian

On Tuesday 05 April 2011 02:56:51 Brian Paul wrote:
> On 04/02/2011 11:41 AM, Fabian Bieler wrote:
>
>
> Does this fix a specific bug or do you have a test program that
> demonstrates the issue?  The patch looks OK on the surface but I'd
> like to know a bit more about what's going on.
>
> -Brian


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-fbo-clear-formats-Add-depth-clearing.patch
Type: text/x-diff
Size: 3466 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20110405/1fa60d44/attachment.patch>


More information about the mesa-dev mailing list