aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/texstore.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-02-27 10:45:05 +0100
committermarha <marha@users.sourceforge.net>2013-02-27 10:45:05 +0100
commitc74ef795c7282681616decc36a9a81cd1b1b6ec7 (patch)
treebeb5f13ba78bd7920eae918b6aa5db5bac83f0da /mesalib/src/mesa/main/texstore.c
parentf51268259621a21d14e40b8a41c5803a5c2ce706 (diff)
downloadvcxsrv-c74ef795c7282681616decc36a9a81cd1b1b6ec7.tar.gz
vcxsrv-c74ef795c7282681616decc36a9a81cd1b1b6ec7.tar.bz2
vcxsrv-c74ef795c7282681616decc36a9a81cd1b1b6ec7.zip
libX11 mesa pixman xkeyboard-config
xkeyboard-config commit 9993f996e75232385b19cc5078f7fecde6b399b9 libX11 commit b687440c28c7da6ee0ae44514d20248db5161606 pixman commit 2156fb51b353867d5a18b734690ca551f74d4fb1 mesa commit f987d23b28491bd7b0552bd9daffa53a8e073c71
Diffstat (limited to 'mesalib/src/mesa/main/texstore.c')
-rw-r--r--mesalib/src/mesa/main/texstore.c47
1 files changed, 33 insertions, 14 deletions
diff --git a/mesalib/src/mesa/main/texstore.c b/mesalib/src/mesa/main/texstore.c
index 9281aa9ea..0e13d8903 100644
--- a/mesalib/src/mesa/main/texstore.c
+++ b/mesalib/src/mesa/main/texstore.c
@@ -3791,24 +3791,22 @@ _mesa_get_texstore_func(gl_format format)
}
-static GLboolean
-_mesa_texstore_memcpy(TEXSTORE_PARAMS)
+GLboolean
+_mesa_texstore_needs_transfer_ops(struct gl_context *ctx,
+ GLenum baseInternalFormat,
+ gl_format dstFormat)
{
GLenum dstType;
- /* There are different restrictions depending on the base format... */
+ /* There are different rules depending on the base format. */
switch (baseInternalFormat) {
case GL_DEPTH_COMPONENT:
case GL_DEPTH_STENCIL:
- /* Depth scale and bias are not allowed. */
- if (ctx->Pixel.DepthScale != 1.0f ||
- ctx->Pixel.DepthBias != 0.0f) {
- return GL_FALSE;
- }
- break;
+ return ctx->Pixel.DepthScale != 1.0f ||
+ ctx->Pixel.DepthBias != 0.0f;
case GL_STENCIL_INDEX:
- break;
+ return GL_FALSE;
default:
/* Color formats.
@@ -3817,10 +3815,20 @@ _mesa_texstore_memcpy(TEXSTORE_PARAMS)
*/
dstType = _mesa_get_format_datatype(dstFormat);
- if (dstType != GL_INT && dstType != GL_UNSIGNED_INT &&
- ctx->_ImageTransferState) {
- return GL_FALSE;
- }
+ return dstType != GL_INT && dstType != GL_UNSIGNED_INT &&
+ ctx->_ImageTransferState;
+ }
+}
+
+
+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)
+{
+ if (_mesa_texstore_needs_transfer_ops(ctx, baseInternalFormat, dstFormat)) {
+ return GL_FALSE;
}
/* The base internal format and the base Mesa format must match. */
@@ -3834,6 +3842,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,