[virglrenderer-devel] [PATCH] vrend: specify GL_UNPACK_IMAGE_HEIGHT

Gurchetan Singh gurchetansingh at chromium.org
Fri Mar 23 21:51:05 UTC 2018


We need it when uploading a 3D texture without a temporary buffer.

Fixes:
    dEQP-GLES3.functional.texture.specification.texsubimage3d_unpack_params.r8_complex1
    dEQP-GLES3.functional.texture.specification.texsubimage3d_unpack_params.r8_complex2
    dEQP-GLES3.functional.texture.specification.texsubimage3d_unpack_params.r8_complex3
    dEQP-GLES3.functional.texture.specification.texsubimage3d_unpack_params.r8_complex4
---
 src/vrend_renderer.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c
index 3d3bcc1..c4fbc69 100644
--- a/src/vrend_renderer.c
+++ b/src/vrend_renderer.c
@@ -5020,6 +5020,7 @@ static int vrend_renderer_transfer_write_iov(struct vrend_context *ctx,
 
       if (stride && !need_temp) {
          glPixelStorei(GL_UNPACK_ROW_LENGTH, stride / elsize);
+         glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, u_minify(res->base.height0, info->level));
       } else
          glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
 
@@ -5149,8 +5150,12 @@ static int vrend_renderer_transfer_write_iov(struct vrend_context *ctx,
                glPixelTransferf(GL_DEPTH_SCALE, 1.0);
          }
       }
-      if (stride && !need_temp)
+
+      if (stride && !need_temp) {
          glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
+         glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, 0);
+      }
+
       glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
 
       if (need_temp)
-- 
2.17.0.rc0.231.g781580f067-goog



More information about the virglrenderer-devel mailing list