diff options
author | marha <marha@users.sourceforge.net> | 2013-06-18 08:28:35 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2013-06-18 08:28:35 +0200 |
commit | 230fe896faed312ef22d915e871fb5aee3ecfad0 (patch) | |
tree | 971b0c0899c72496f97970319bfadfae383abbea /mesalib/src/mesa/main/teximage.c | |
parent | 180290f941da61bd80284d817e27c01cf789ee53 (diff) | |
parent | b071050b9eda9d5e5185e582dbe9f4adba863ccc (diff) | |
download | vcxsrv-230fe896faed312ef22d915e871fb5aee3ecfad0.tar.gz vcxsrv-230fe896faed312ef22d915e871fb5aee3ecfad0.tar.bz2 vcxsrv-230fe896faed312ef22d915e871fb5aee3ecfad0.zip |
Merge remote-tracking branch 'origin/released'
* origin/released:
libX11 libXmu libxcb/xcb-proto mesa mkfontscale pixman xkeyboard-config git update 18 June 2013
Diffstat (limited to 'mesalib/src/mesa/main/teximage.c')
-rw-r--r-- | mesalib/src/mesa/main/teximage.c | 45 |
1 files changed, 38 insertions, 7 deletions
diff --git a/mesalib/src/mesa/main/teximage.c b/mesalib/src/mesa/main/teximage.c index 9aaa63f13..5226687ff 100644 --- a/mesalib/src/mesa/main/teximage.c +++ b/mesalib/src/mesa/main/teximage.c @@ -798,7 +798,7 @@ _mesa_select_tex_object(struct gl_context *ctx, ctx->Extensions.ARB_texture_buffer_object ? texUnit->CurrentTex[TEXTURE_BUFFER_INDEX] : NULL; case GL_TEXTURE_EXTERNAL_OES: - return ctx->Extensions.OES_EGL_image_external + return _mesa_is_gles(ctx) && ctx->Extensions.OES_EGL_image_external ? texUnit->CurrentTex[TEXTURE_EXTERNAL_INDEX] : NULL; case GL_TEXTURE_2D_MULTISAMPLE: return ctx->Extensions.ARB_texture_multisample @@ -3243,7 +3243,8 @@ _mesa_EGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image) valid_target = ctx->Extensions.OES_EGL_image; break; case GL_TEXTURE_EXTERNAL_OES: - valid_target = ctx->Extensions.OES_EGL_image_external; + valid_target = + _mesa_is_gles(ctx) ? ctx->Extensions.OES_EGL_image_external : false; break; default: valid_target = false; @@ -3428,6 +3429,35 @@ get_copy_tex_image_source(struct gl_context *ctx, gl_format texFormat) } } +static void +copytexsubimage_by_slice(struct gl_context *ctx, + struct gl_texture_image *texImage, + GLuint dims, + GLint xoffset, GLint yoffset, GLint zoffset, + struct gl_renderbuffer *rb, + GLint x, GLint y, + GLsizei width, GLsizei height) +{ + if (texImage->TexObject->Target == GL_TEXTURE_1D_ARRAY) { + int slice; + + /* For 1D arrays, we copy each scanline of the source rectangle into the + * next array slice. + */ + assert(zoffset == 0); + + for (slice = 0; slice < height; slice++) { + assert(yoffset + slice < texImage->Height); + ctx->Driver.CopyTexSubImage(ctx, 2, texImage, + xoffset, 0, yoffset + slice, + rb, x, y + slice, width, 1); + } + } else { + ctx->Driver.CopyTexSubImage(ctx, dims, texImage, + xoffset, yoffset, zoffset, + rb, x, y, width, height); + } +} /** @@ -3516,8 +3546,9 @@ copyteximage(struct gl_context *ctx, GLuint dims, struct gl_renderbuffer *srcRb = get_copy_tex_image_source(ctx, texImage->TexFormat); - ctx->Driver.CopyTexSubImage(ctx, dims, texImage, dstX, dstY, dstZ, - srcRb, srcX, srcY, width, height); + copytexsubimage_by_slice(ctx, texImage, dims, + dstX, dstY, dstZ, + srcRb, srcX, srcY, width, height); } check_gen_mipmap(ctx, target, texObj, level); @@ -3609,9 +3640,9 @@ copytexsubimage(struct gl_context *ctx, GLuint dims, GLenum target, GLint level, struct gl_renderbuffer *srcRb = get_copy_tex_image_source(ctx, texImage->TexFormat); - ctx->Driver.CopyTexSubImage(ctx, dims, texImage, - xoffset, yoffset, zoffset, - srcRb, x, y, width, height); + copytexsubimage_by_slice(ctx, texImage, dims, + xoffset, yoffset, zoffset, + srcRb, x, y, width, height); check_gen_mipmap(ctx, target, texObj, level); |