aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/teximage.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-06-18 08:23:14 +0200
committermarha <marha@users.sourceforge.net>2013-06-18 08:23:14 +0200
commitb071050b9eda9d5e5185e582dbe9f4adba863ccc (patch)
tree6da290f7da04f9afc96691608b65967f2ee0e0fa /mesalib/src/mesa/main/teximage.c
parent150771e7aabf4c864b0b970c5b8d773634793abe (diff)
downloadvcxsrv-b071050b9eda9d5e5185e582dbe9f4adba863ccc.tar.gz
vcxsrv-b071050b9eda9d5e5185e582dbe9f4adba863ccc.tar.bz2
vcxsrv-b071050b9eda9d5e5185e582dbe9f4adba863ccc.zip
libX11 libXmu libxcb/xcb-proto mesa mkfontscale pixman xkeyboard-config git update 18 June 2013
libxcb/xcb-proto commit e5f7c750815cb5170db363a2e5b09639b7354733 xkeyboard-config commit 30d804538462213ed01e8efc0b44a8e5a0aff990 libX11 commit 9dfb0f3c0a761590bcdc1f3396b1e064da4e18e8 pixman commit 279bdcda7ec3af8ac06312f4514b1b082a279544 mkfontscale commit f731c5c36f28ddd0f25f474d2991c96f9a7a915c libXmu commit e46ecb4e02b7f919b11efa79448d4db71d1deb69 mesa commit eb2021507556633cd6ba64cda26653e3c43e80df
Diffstat (limited to 'mesalib/src/mesa/main/teximage.c')
-rw-r--r--mesalib/src/mesa/main/teximage.c45
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);