summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2008-08-08 12:29:48 -0600
committerKeith Whitwell <[email protected]>2008-09-21 22:13:57 -0700
commit8122ab2dfd0e158a4982e1bfeb1f7a6f185b69ee (patch)
treeb4a19579ea98be7fc35813bf9ed932e2ff68ccbc /src/mesa/main
parent6bc8749cd593e29e7950da36cd166aa1c9ebc34b (diff)
mesa: fix some pixel transfer state tests for depth formats
(cherry picked from commit 966e199e409a1b52eef88e48997442250997f45e)
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/texstore.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
index 79ef8813ca6..56f5b2ebaa1 100644
--- a/src/mesa/main/texstore.c
+++ b/src/mesa/main/texstore.c
@@ -1160,7 +1160,8 @@ _mesa_texstore_z32(TEXSTORE_PARAMS)
ASSERT(dstFormat == &_mesa_texformat_z32);
ASSERT(dstFormat->TexelBytes == sizeof(GLuint));
- if (!ctx->_ImageTransferState &&
+ if (ctx->Pixel.DepthScale == 1.0f &&
+ ctx->Pixel.DepthBias == 0.0f &&
!srcPacking->SwapBytes &&
baseInternalFormat == GL_DEPTH_COMPONENT &&
srcFormat == GL_DEPTH_COMPONENT &&
@@ -1207,7 +1208,8 @@ _mesa_texstore_z16(TEXSTORE_PARAMS)
ASSERT(dstFormat == &_mesa_texformat_z16);
ASSERT(dstFormat->TexelBytes == sizeof(GLushort));
- if (!ctx->_ImageTransferState &&
+ if (ctx->Pixel.DepthScale == 1.0f &&
+ ctx->Pixel.DepthBias == 0.0f &&
!srcPacking->SwapBytes &&
baseInternalFormat == GL_DEPTH_COMPONENT &&
srcFormat == GL_DEPTH_COMPONENT &&
@@ -2405,7 +2407,8 @@ _mesa_texstore_z24_s8(TEXSTORE_PARAMS)
ASSERT(srcFormat == GL_DEPTH_STENCIL_EXT);
ASSERT(srcType == GL_UNSIGNED_INT_24_8_EXT);
- if (!ctx->_ImageTransferState &&
+ if (ctx->Pixel.DepthScale == 1.0f &&
+ ctx->Pixel.DepthBias == 0.0f &&
!srcPacking->SwapBytes) {
/* simple path */
memcpy_texture(ctx, dims,
@@ -2476,7 +2479,7 @@ _mesa_texstore_s8_z24(TEXSTORE_PARAMS)
ASSERT(srcFormat == GL_DEPTH_STENCIL_EXT || srcFormat == GL_DEPTH_COMPONENT);
ASSERT(srcFormat != GL_DEPTH_STENCIL_EXT || srcType == GL_UNSIGNED_INT_24_8_EXT);
- /* Incase we only upload depth we need to preserve the stencil */
+ /* In case we only upload depth we need to preserve the stencil */
if (srcFormat == GL_DEPTH_COMPONENT) {
for (img = 0; img < srcDepth; img++) {
GLuint *dstRow = (GLuint *) dstAddr
@@ -2504,7 +2507,8 @@ _mesa_texstore_s8_z24(TEXSTORE_PARAMS)
dstRow += dstRowStride / sizeof(GLuint);
}
}
- } else {
+ }
+ else {
for (img = 0; img < srcDepth; img++) {
GLuint *dstRow = (GLuint *) dstAddr
+ dstImageOffsets[dstZoffset + img]