meta: Obvious refactor of _mesa_meta_framebuffer_texture_image
authorIan Romanick <ian.d.romanick@intel.com>
Fri, 13 Nov 2015 01:11:30 +0000 (17:11 -0800)
committerIan Romanick <ian.d.romanick@intel.com>
Tue, 1 Mar 2016 19:07:19 +0000 (11:07 -0800)
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
src/mesa/drivers/common/meta.c

index 9391ac8561c62d09c02ccb1813e21d718ae445d7..b62f0d4feef4e37de343231ec3614a9aa60ac197 100644 (file)
@@ -112,28 +112,12 @@ _mesa_meta_framebuffer_texture_image(struct gl_context *ctx,
 {
    struct gl_texture_object *texObj = texImage->TexObject;
    int level = texImage->Level;
-   GLenum texTarget = texObj->Target;
+   const GLenum texTarget = texObj->Target == GL_TEXTURE_CUBE_MAP
+      ? GL_TEXTURE_CUBE_MAP_POSITIVE_X + texImage->Face
+      : texObj->Target;
 
-   switch (texTarget) {
-   case GL_TEXTURE_1D:
-      _mesa_framebuffer_texture(ctx, fb, attachment, texObj, texTarget,
-                                level, layer, false, __func__);
-      break;
-   case GL_TEXTURE_1D_ARRAY:
-   case GL_TEXTURE_2D_ARRAY:
-   case GL_TEXTURE_2D_MULTISAMPLE_ARRAY:
-   case GL_TEXTURE_CUBE_MAP_ARRAY:
-   case GL_TEXTURE_3D:
-      _mesa_framebuffer_texture(ctx, fb, attachment, texObj, texTarget,
-                                level, layer, false, __func__);
-      break;
-   default: /* 2D / cube */
-      if (texTarget == GL_TEXTURE_CUBE_MAP)
-         texTarget = GL_TEXTURE_CUBE_MAP_POSITIVE_X + texImage->Face;
-
-      _mesa_framebuffer_texture(ctx, fb, attachment, texObj, texTarget,
-                                level, layer, false, __func__);
-   }
+   _mesa_framebuffer_texture(ctx, fb, attachment, texObj, texTarget,
+                             level, layer, false, __func__);
 }
 
 GLuint