diff options
author | Brian Paul <[email protected]> | 2002-09-21 16:51:25 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2002-09-21 16:51:25 +0000 |
commit | c5b995066020191982b2315fc45d05e068eee761 (patch) | |
tree | 9ca2e3a49b84631aa61ef97d072439228478b3cb /src/mesa/main/texstore.c | |
parent | c62aeed003cc20b189d71bc53256419e0d630aaf (diff) |
updates from 4.0.4 (MESA_ycbcr_texture, APPLE_client_storage, etc)
Diffstat (limited to 'src/mesa/main/texstore.c')
-rw-r--r-- | src/mesa/main/texstore.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index c1fa760247f..07404a26094 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -1,4 +1,4 @@ -/* $Id: texstore.c,v 1.40 2002/09/17 14:14:18 brianp Exp $ */ +/* $Id: texstore.c,v 1.41 2002/09/21 16:51:25 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -115,6 +115,8 @@ components_in_intformat( GLint format ) case GL_DEPTH_COMPONENT24_SGIX: case GL_DEPTH_COMPONENT32_SGIX: return 1; + case GL_YCBCR_MESA: + return 2; /* Y + (Cb or Cr) */ default: return -1; /* error */ } @@ -255,6 +257,27 @@ transfer_teximage(GLcontext *ctx, GLuint dimensions, dest += dstImageStride; } } + else if (texDestFormat == GL_YCBCR_MESA) { + /* YCbCr texture */ + GLint img, row; + GLushort *dest = (GLushort *) texDestAddr + + dstZoffset * (dstImageStride / sizeof(GLushort)) + + dstYoffset * (dstRowStride / sizeof(GLushort)) + + dstXoffset * texComponents; + ASSERT(ctx->Extensions.MESA_ycbcr_texture); + printf("copy ycbcr\n"); + for (img = 0; img < srcDepth; img++) { + GLushort *destRow = dest; + for (row = 0; row < srcHeight; row++) { + const GLvoid *srcRow = _mesa_image_address(srcPacking, + srcAddr, srcWidth, srcHeight, + srcFormat, srcType, img, row, 0); + MEMCPY(destRow, srcRow, srcWidth * sizeof(GLushort)); + destRow += (dstRowStride / sizeof(GLushort)); + } + dest += dstImageStride / sizeof(GLushort); + } + } else if (texDestFormat == GL_DEPTH_COMPONENT) { /* Depth texture (shadow maps) */ GLint img, row; |