[Mesa-dev] state tracker texture sizing fun

Dave Airlie airlied at gmail.com
Wed Apr 9 18:14:04 PDT 2014


So I was looking at adding ARB_texture_query_levels support to
gallium, and hit a bit of a saga in the state tracker texture
finalising code.

commits involved in this are below,

So to fix the query levels test I essentially wanted to revert
529b7b355d392b1534ccd8ff7b428dc21cbfdc21 so that the hw was programmed
with the correct last levels and the query tests would pass,

I then did an llvmpipe piglit run, and found two major regressions,
texture arrays broke and getteximage broke,

arrays are broken simply because st_texture_image_copy is broken for
arrays, that seems like a not insane fix,

however getteximage is broken because of Cooper's commit, as the test
sets GL_NEAREST for everything, it however TexImage2D a number of
layers into the textures, then GetTexImage them backout, however due
to that sampler check we totally fail, I think we should be dropping
Cooper's change it lacks justification and it dies texture backing
store and samplers together a bit much for my liking,

Dave.

commit 529b7b355d392b1534ccd8ff7b428dc21cbfdc21
Author: Brian Paul <brianp at vmware.com>
Date:   Mon May 3 13:04:29 2010 -0600

    st/mesa: restore original last_layer comparison

    Commit e648d4a1d1c0c5f70916e38366b863f0bec79a62 changed the original
    less-than test to a not-equal test.  This was an effort to save some
    memory by switching the texture layout to a non-mipmapped layout when
    we mis-guessed about the original layout (thus saving some memory).

    However, this causes us to hit a new (apparently broken) code path
    when copying the old texture's data to the new texture.  Simply
    undo this change for the time being until the other/new bug is fixed.

    Fixes fd.o bug 27933.

commit e648d4a1d1c0c5f70916e38366b863f0bec79a62
Author: Brian Paul <brianp at vmware.com>
Date:   Thu Apr 29 15:32:36 2010 -0600

    st/mesa: ignore gl_texture_object::BaseLevel when allocating gallium texture

    Previously, when we created a gallium texture for a corresponding Mesa
    texture we'd only allocate space for mipmap levels >= BaseLevel.

    This patch undoes that mechanism.  This fixes a render-to-texture bug
    when rendering to level 0 when BaseLevel=1.

    Also, it makes sense to allocate the whole texture object memory when
    BaseLevel > 0 since a common use of GL_TEXTURE_BASE_LEVEL is to
    progressively load/render mipmaps.  Eventually, the app almost always
    fills in the level=0 mipmap image.

    Finally, the texture image code is bit easier to understand now.

ae2daacbac7242938cffe0e2409071e030e00863
Author: Cooper Yuan <cooperyuan at gmail.com>
Date:   Thu Oct 1 17:54:27 2009 +0800

    st/mesa: fix non-mipmap lastLevel calculation.

    reviewed by Brian Paul.


More information about the mesa-dev mailing list