From c74ef795c7282681616decc36a9a81cd1b1b6ec7 Mon Sep 17 00:00:00 2001 From: marha Date: Wed, 27 Feb 2013 10:45:05 +0100 Subject: libX11 mesa pixman xkeyboard-config xkeyboard-config commit 9993f996e75232385b19cc5078f7fecde6b399b9 libX11 commit b687440c28c7da6ee0ae44514d20248db5161606 pixman commit 2156fb51b353867d5a18b734690ca551f74d4fb1 mesa commit f987d23b28491bd7b0552bd9daffa53a8e073c71 --- mesalib/src/mesa/main/texstore.c | 47 ++++++++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 14 deletions(-) (limited to 'mesalib/src/mesa/main/texstore.c') 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, -- cgit v1.2.3