summaryrefslogtreecommitdiff
path: root/src/mesa/main/texcompress.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2004-04-27 13:39:20 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2004-04-27 13:39:20 +0000
commit8f04c12e0ad876baa7eb9ed379e2b00150b376e0 (patch)
tree2d30ddd41662329fd0041dc530bce31945775813 /src/mesa/main/texcompress.c
parent186d4d8cf4bd99c46b388e6ea0c60ec1d039be07 (diff)
Removed the old teximage code.
Moved all code related to specific texture compression modes into new texcompress_s3tc.c and texcompress_fxt1.c files (but not implemented).
Diffstat (limited to 'src/mesa/main/texcompress.c')
-rw-r--r--src/mesa/main/texcompress.c75
1 files changed, 27 insertions, 48 deletions
diff --git a/src/mesa/main/texcompress.c b/src/mesa/main/texcompress.c
index 4c6eaae4cf3..3d0326fccac 100644
--- a/src/mesa/main/texcompress.c
+++ b/src/mesa/main/texcompress.c
@@ -1,13 +1,8 @@
-/**
- * \file texcompress.c
- * Compressed textures functions.
- */
-
/*
* Mesa 3-D graphics library
- * Version: 5.1
+ * Version: 6.1
*
- * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -28,17 +23,24 @@
*/
+/**
+ * \file texcompress.c
+ * Helper functions for texture compression.
+ */
+
+
#include "glheader.h"
#include "imports.h"
+#include "colormac.h"
#include "context.h"
#include "image.h"
#include "texcompress.h"
#include "texformat.h"
-
+#include "texstore.h"
/**
* Get the list of supported internal compression formats.
- *
+ *
* \param ctx GL context.
* \param formats the resulting format list (may be NULL).
*
@@ -89,16 +91,19 @@ _mesa_get_compressed_formats( GLcontext *ctx, GLint *formats )
}
+
/**
- * Return bytes of storage needed for the given texture size and
- * compressed format.
- *
+ * Return number of bytes needed to store a texture of the given size
+ * using the specified compressed format.
+ * This is called via the ctx->Driver.CompressedTextureSize function,
+ * unless a device driver overrides it.
+ *
* \param width texture width in texels.
* \param height texture height in texels.
* \param depth texture depth in texels.
- * \param texFormat one of the compressed format enums
- *
- * \return size in bytes, or zero if bad \p texFormat.
+ * \param format - one of the specific compressed texture formats
+ *
+ * \return size in bytes, or zero if bad format
*/
GLuint
_mesa_compressed_texture_size( GLcontext *ctx,
@@ -107,10 +112,6 @@ _mesa_compressed_texture_size( GLcontext *ctx,
{
GLuint size;
- if (ctx->Driver.CompressedTextureSize) {
- return ctx->Driver.CompressedTextureSize(ctx, width, height, depth, format);
- }
-
ASSERT(depth == 1);
switch (format) {
@@ -164,7 +165,7 @@ _mesa_compressed_texture_size( GLcontext *ctx,
}
-/**
+/*
* Compute the bytes per row in a compressed texture image.
* We use this for computing the destination address for sub-texture updates.
* \param format one of the specific texture compression formats
@@ -201,18 +202,14 @@ _mesa_compressed_row_stride(GLenum format, GLsizei width)
}
-/**
+/*
* Return the address of the pixel at (col, row, img) in a
* compressed texture image.
- *
- * \param col image position.
- * \param row image position.
- * \param img image position.
- * \param format compressed image format.
- * \param width image width.
- * \param image the image address.
- *
- * \return address of pixel at (row, col).
+ * \param col, row, img - image position (3D)
+ * \param format - compressed image format
+ * \param width - image width
+ * \param image - the image address
+ * \return address of pixel at (row, col)
*/
GLubyte *
_mesa_compressed_image_address(GLint col, GLint row, GLint img,
@@ -254,21 +251,3 @@ _mesa_compressed_image_address(GLint col, GLint row, GLint img,
return addr;
}
-
-
-/**
- * \param srcRowStride source stride, in pixels
- */
-void
-_mesa_compress_teximage( GLcontext *ctx, GLsizei width, GLsizei height,
- GLenum srcFormat, const GLchan *source,
- GLint srcRowStride,
- const struct gl_texture_format *dstFormat,
- GLubyte *dest, GLint dstRowStride )
-{
- switch (dstFormat->MesaFormat) {
- default:
- _mesa_problem(ctx, "Bad dstFormat in _mesa_compress_teximage()");
- return;
- }
-}