summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texstore.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main/texstore.c')
-rw-r--r--src/mesa/main/texstore.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
index 9281aa9eafb..77222d6dfb6 100644
--- a/src/mesa/main/texstore.c
+++ b/src/mesa/main/texstore.c
@@ -3791,8 +3791,11 @@ _mesa_get_texstore_func(gl_format format)
}
-static GLboolean
-_mesa_texstore_memcpy(TEXSTORE_PARAMS)
+GLboolean
+_mesa_texstore_can_use_memcpy(struct gl_context *ctx,
+ GLenum baseInternalFormat, gl_format dstFormat,
+ GLenum srcFormat, GLenum srcType,
+ const struct gl_pixelstore_attrib *srcPacking)
{
GLenum dstType;
@@ -3834,6 +3837,17 @@ _mesa_texstore_memcpy(TEXSTORE_PARAMS)
return GL_FALSE;
}
+ return GL_TRUE;
+}
+
+static GLboolean
+_mesa_texstore_memcpy(TEXSTORE_PARAMS)
+{
+ if (!_mesa_texstore_can_use_memcpy(ctx, baseInternalFormat, dstFormat,
+ srcFormat, srcType, srcPacking)) {
+ return GL_FALSE;
+ }
+
memcpy_texture(ctx, dims,
dstFormat,
dstRowStride, dstSlices,