[Mesa-dev] [PATCH] intel: Skip texsubimage fastpath for more pixel unpack state

Chad Versace chad.versace at linux.intel.com
Fri Oct 12 11:30:00 PDT 2012


Fixes piglit tests "unpack-teximage2d --pbo=* --format=GL_BGRA" on
Sandybridge+.

The fastpath was checking an incomplete set of pixel unpack state. This
patch adds checks for all the fields of gl_pixelstore_attrib that affect
2D texture uploads.  Also, it begins permitting the case where
GL_UNPACK_ROW_LENGTH is 0.

Ideally, we would just ask a unicorn to JIT this fastpath for us in
a way that safely handles the unpacking state. Until then, it's safer if
only a small set of situations activate the fastpath.

CC: Rob Bradford <rob at linux.intel.com>
CC: Neil Roberts <neil at linux.intel.com>
Signed-off-by: Chad Versace <chad.versace at linux.intel.com>
---
 src/mesa/drivers/dri/intel/intel_tex_subimage.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/intel/intel_tex_subimage.c b/src/mesa/drivers/dri/intel/intel_tex_subimage.c
index ba6267a..5c77697 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_subimage.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_subimage.c
@@ -205,10 +205,14 @@ intel_texsubimage_tiled_memcpy(struct gl_context * ctx,
        texImage->TexObject->Target != GL_TEXTURE_2D ||
        texImage->Level != 0 ||
        pixels == NULL ||
+       packing->BufferObj != ctx->Shared->NullBufferObj ||
        packing->Alignment > 4 ||
        packing->SkipPixels > 0 ||
        packing->SkipRows > 0 ||
-       packing->RowLength != width)
+       (packing->RowLength != 0 && packing->RowLength != width) ||
+       packing->SwapBytes ||
+       packing->LsbFirst ||
+       packing->Invert)
       return false;
 
    if (for_glTexImage)
-- 
1.7.11.7



More information about the mesa-dev mailing list