[virglrenderer-devel] [PATCH] vrend: correct the stride if the client sends it

Gert Wollny gert.wollny at collabora.com
Thu Jul 26 16:57:38 UTC 2018


If the client sends vrend_transfer_send_readpixels a stride (and vtest does),
then it is in bytes, but glPixelStorei(GL_PACK_ROW_LENGTH, stride) expects
the value to be pixels.

Fixes:
   42e2a4ca7da4604beb377e181aa6b20abf4445e
   vrend: use the row-stride when directly reading back to an IOV
Signed-off-by: Gert Wollny <gert.wollny at collabora.com>
---
 src/vrend_renderer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c
index 6536dd8..4bf22ba 100644
--- a/src/vrend_renderer.c
+++ b/src/vrend_renderer.c
@@ -5912,7 +5912,7 @@ static int vrend_transfer_send_readpixels(struct vrend_context *ctx,
    uint32_t h = u_minify(res->base.height0, info->level);
    int elsize = util_format_get_blocksize(res->base.format);
    float depth_scale;
-   int row_stride = info->stride;
+   int row_stride = info->stride / elsize;
 
    vrend_use_program(ctx, 0);
 
-- 
2.16.4



More information about the virglrenderer-devel mailing list