Mesa (master): intel: Skip texsubimage fastpath for more pixel unpack state (v2)

Chad Versace chadversary at kemper.freedesktop.org
Thu Oct 18 15:56:33 UTC 2012


Module: Mesa
Branch: master
Commit: 0da72d3502ecc48e9189ebc4cbea446f79ccb61d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0da72d3502ecc48e9189ebc4cbea446f79ccb61d

Author: Chad Versace <chad.versace at linux.intel.com>
Date:   Fri Oct 12 11:11:57 2012 -0700

intel: Skip texsubimage fastpath for more pixel unpack state (v2)

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.

v2: Use _mesa_is_bufferobj(), per Anholt.

Reviewed-by: Eric Anholt <eric at anholt.net>
Signed-off-by: Chad Versace <chad.versace at linux.intel.com>

---

 src/mesa/drivers/dri/intel/intel_tex_subimage.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_tex_subimage.c b/src/mesa/drivers/dri/intel/intel_tex_subimage.c
index ba6267a..76ea0de 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_subimage.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_subimage.c
@@ -26,6 +26,7 @@
  * 
  **************************************************************************/
 
+#include "main/bufferobj.h"
 #include "main/macros.h"
 #include "main/mtypes.h"
 #include "main/pbo.h"
@@ -205,10 +206,14 @@ intel_texsubimage_tiled_memcpy(struct gl_context * ctx,
        texImage->TexObject->Target != GL_TEXTURE_2D ||
        texImage->Level != 0 ||
        pixels == NULL ||
+       _mesa_is_bufferobj(packing->BufferObj) ||
        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)




More information about the mesa-commit mailing list