Mesa (master): meta: Add support for CUBE_MAP_ARRAY to generatemipmap.

Eric Anholt anholt at kemper.freedesktop.org
Tue Apr 15 22:13:59 UTC 2014


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

Author: Eric Anholt <eric at anholt.net>
Date:   Tue Apr  8 13:34:39 2014 -0700

meta: Add support for CUBE_MAP_ARRAY to generatemipmap.

I added support to bind_fbo_image in the process of building meta
CopyTexSubImage, and found that it broke generatemipmap because previously
we would just throw a GL error there and then end up with an incomplete
FBO and fallback.

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/mesa/drivers/common/meta.c                 |    4 ++++
 src/mesa/drivers/common/meta_generate_mipmap.c |    2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index 6dc71c9..12d6f65 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -110,6 +110,7 @@ _mesa_meta_bind_fbo_image(struct gl_texture_image *texImage, GLuint layer)
       break;
    case GL_TEXTURE_1D_ARRAY:
    case GL_TEXTURE_2D_ARRAY:
+   case GL_TEXTURE_CUBE_MAP_ARRAY:
    case GL_TEXTURE_3D:
       _mesa_FramebufferTextureLayer(GL_FRAMEBUFFER,
                                     GL_COLOR_ATTACHMENT0,
@@ -2457,6 +2458,9 @@ _mesa_meta_setup_texture_coords(GLenum faceTarget,
    GLuint i;
    GLfloat r;
 
+   if (faceTarget == GL_TEXTURE_CUBE_MAP_ARRAY)
+      faceTarget = GL_TEXTURE_CUBE_MAP_POSITIVE_X + slice % 6;
+
    /* Currently all texture targets want the W component to be 1.0.
     */
    coords0[3] = 1.0F;
diff --git a/src/mesa/drivers/common/meta_generate_mipmap.c b/src/mesa/drivers/common/meta_generate_mipmap.c
index deff690..db46974 100644
--- a/src/mesa/drivers/common/meta_generate_mipmap.c
+++ b/src/mesa/drivers/common/meta_generate_mipmap.c
@@ -189,7 +189,7 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target,
     */
    if (use_glsl_version) {
       _mesa_meta_setup_vertex_objects(&mipmap->VAO, &mipmap->VBO, true,
-                                      2, 3, 0);
+                                      2, 4, 0);
       _mesa_meta_setup_blit_shader(ctx, target, &mipmap->shaders);
    } else {
       _mesa_meta_setup_ff_tnl_for_blit(&mipmap->VAO, &mipmap->VBO, 3);




More information about the mesa-commit mailing list