Mesa (master): meta: Abort meta path if ReadPixels need rgb to luminance conversion

Anuj Phogat aphogat at kemper.freedesktop.org
Mon Jun 15 16:20:54 UTC 2015


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

Author: Anuj Phogat <anuj.phogat at gmail.com>
Date:   Tue May 12 04:17:04 2015 -0700

meta: Abort meta path if ReadPixels need rgb to luminance conversion

After recent addition of pbo testing in piglit test getteximage-luminance,
it fails on i965. This patch makes a sub test pass.

Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
Cc: <mesa-stable at lists.freedesktop.org>
Reviewed-by: Tapani Pälli <tapani.palli at intel.com>

---

 src/mesa/drivers/common/meta_tex_subimage.c |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/mesa/drivers/common/meta_tex_subimage.c b/src/mesa/drivers/common/meta_tex_subimage.c
index ad6e787..6bd74e1 100644
--- a/src/mesa/drivers/common/meta_tex_subimage.c
+++ b/src/mesa/drivers/common/meta_tex_subimage.c
@@ -34,6 +34,7 @@
 #include "macros.h"
 #include "meta.h"
 #include "pbo.h"
+#include "readpix.h"
 #include "shaderapi.h"
 #include "state.h"
 #include "teximage.h"
@@ -257,6 +258,7 @@ _mesa_meta_pbo_GetTexSubImage(struct gl_context *ctx, GLuint dims,
    GLuint pbo = 0, pbo_tex = 0, fbos[2] = { 0, 0 };
    int full_height, image_height;
    struct gl_texture_image *pbo_tex_image;
+   struct gl_renderbuffer *rb = NULL;
    GLenum status;
    bool success = false;
    int z;
@@ -273,6 +275,13 @@ _mesa_meta_pbo_GetTexSubImage(struct gl_context *ctx, GLuint dims,
    if (ctx->_ImageTransferState)
       return false;
 
+
+   if (!tex_image) {
+      rb = ctx->ReadBuffer->_ColorReadBuffer;
+      if (_mesa_need_rgb_to_luminance_conversion(rb->Format, format))
+         return false;
+   }
+
    /* For arrays, use a tall (height * depth) 2D texture but taking into
     * account the inter-image padding specified with the image height packing
     * property.




More information about the mesa-commit mailing list