diff options
author | Ian Romanick <[email protected]> | 2015-11-12 17:11:30 -0800 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2016-03-01 11:07:19 -0800 |
commit | 92266ff7a34ef4d16509650d714487a5c74fd27c (patch) | |
tree | 136b99b48a0177f26f164bd69deced229c5a35af /src | |
parent | f69c743069b65fa58196875a0c5a74e4160acc86 (diff) |
meta: Obvious refactor of _mesa_meta_framebuffer_texture_image
Signed-off-by: Ian Romanick <[email protected]>
Reviewed-by: Topi Pohjolainen <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/common/meta.c | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index 9391ac8561c..b62f0d4feef 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -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 |