[virglrenderer-devel] [PATCH 2/2] vrend: Correctly set pack alignment for three component textures

Gert Wollny gert.wollny at collabora.com
Thu Jun 7 19:58:16 UTC 2018


For rgb8 and rgb16 textures the element size is 3 and 6 respectively,
and the packing must correspond to the component size (1 and 2).

Fixes:
  dEQP-GLES3.functional.texture.specification.basic_teximage3d.rgb16i_3d
  dEQP-GLES3.functional.texture.specification.basic_teximage3d.rgb16ui_3d
  dEQP-GLES3.functional.texture.specification.basic_teximage3d.rgb8i_3d
  dEQP-GLES3.functional.texture.specification.basic_teximage3d.rgb8ui_3d

Signed-off-by: Gert Wollny <gert.wollny at collabora.com>
---
 src/vrend_renderer.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c
index 5534ce4..737a94a 100644
--- a/src/vrend_renderer.c
+++ b/src/vrend_renderer.c
@@ -5938,9 +5938,11 @@ static void vrend_resource_copy_fallback(struct vrend_context *ctx,
    } else {
       switch (elsize) {
       case 1:
+      case 3:
          glPixelStorei(GL_PACK_ALIGNMENT, 1);
          break;
       case 2:
+      case 6:
          glPixelStorei(GL_PACK_ALIGNMENT, 2);
          break;
       case 4:
@@ -5978,9 +5980,11 @@ static void vrend_resource_copy_fallback(struct vrend_context *ctx,
    glPixelStorei(GL_PACK_ALIGNMENT, 4);
    switch (elsize) {
    case 1:
+   case 3:
       glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
       break;
    case 2:
+   case 6:
       glPixelStorei(GL_UNPACK_ALIGNMENT, 2);
       break;
    case 4:
-- 
2.17.1



More information about the virglrenderer-devel mailing list