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.c37
1 files changed, 21 insertions, 16 deletions
diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
index 77222d6dfb6..0e13d8903f9 100644
--- a/src/mesa/main/texstore.c
+++ b/src/mesa/main/texstore.c
@@ -3792,26 +3792,21 @@ _mesa_get_texstore_func(gl_format format)
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)
+_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.
@@ -3820,10 +3815,20 @@ _mesa_texstore_can_use_memcpy(struct gl_context *ctx,
*/
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. */