summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texformat.h
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2004-04-22 00:27:31 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2004-04-22 00:27:31 +0000
commitf959f6e1dc27c71fc0ccc56e09b29101b3bf3b97 (patch)
tree15b4171c2b3396e3a05f2776cc24d90cb37c8f84 /src/mesa/main/texformat.h
parent05a6f2fd484bab59c6e6a381f58808adc26619f1 (diff)
downloadexternal_mesa3d-f959f6e1dc27c71fc0ccc56e09b29101b3bf3b97.zip
external_mesa3d-f959f6e1dc27c71fc0ccc56e09b29101b3bf3b97.tar.gz
external_mesa3d-f959f6e1dc27c71fc0ccc56e09b29101b3bf3b97.tar.bz2
New glTexImage code.
The gl_texture_format struct now has a StoreTexImageFunc that's called by glTex[Sub]Image[123]D to convert the user's texture data into the specific texture format layout. Now it's much easier to add new texture formats (like the 16/32-bit floating point formats). The texutil.[ch] and texutil_tmp.h files are obsolete.
Diffstat (limited to 'src/mesa/main/texformat.h')
-rw-r--r--src/mesa/main/texformat.h92
1 files changed, 62 insertions, 30 deletions
diff --git a/src/mesa/main/texformat.h b/src/mesa/main/texformat.h
index df199c5..cc26b79 100644
--- a/src/mesa/main/texformat.h
+++ b/src/mesa/main/texformat.h
@@ -1,15 +1,8 @@
-/**
- * \file texformat.h
- * Texture formats definitions.
- *
- * \author Gareth Hughes
- */
-
/*
* 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"),
@@ -30,16 +23,26 @@
*/
+/**
+ * \file texformat.h
+ * Texture formats definitions.
+ *
+ * \author Gareth Hughes
+ */
+
+
#ifndef TEXFORMAT_H
#define TEXFORMAT_H
+#define NEWTEXSTORE 1
+
+
#include "mtypes.h"
/**
- * Mesa internal texture image types.
- *
- * All texture images must be stored in one of these formats.
+ * Mesa internal texture image formats.
+ * All texture images are stored in one of these formats.
*
* NOTE: when you add a new format, be sure to update the do_row()
* function in texstore.c used for auto mipmap generation.
@@ -111,10 +114,8 @@ enum _format {
/**
* \name Generic GLchan-based formats.
*
- * These are the default formats used by the software rasterizer and, unless
- * the driver overrides the texture image functions, incoming images will be
- * converted to one of these formats. Components are arrays of GLchan
- * values, so there will be no big/little endian issues.
+ * Software-oriented texture formats. Texels are arrays of GLchan
+ * values so there will be no big/little endian issues.
*
* \note Because these are based on the GLchan data type, one cannot assume
* 8 bits per channel with these formats. If you require GLubyte channels,
@@ -131,29 +132,33 @@ enum _format {
/*@}*/
/**
+ * Depth textures
+ */
+ /*@{*/
+ MESA_FORMAT_DEPTH_COMPONENT_FLOAT32,
+ MESA_FORMAT_DEPTH_COMPONENT16,
+ /*@}*/
+
+ /**
* \name Floating point texture formats.
*/
/*@{*/
- MESA_FORMAT_DEPTH_COMPONENT,
MESA_FORMAT_RGBA_FLOAT32,
MESA_FORMAT_RGBA_FLOAT16,
MESA_FORMAT_RGB_FLOAT32,
- MESA_FORMAT_RGB_FLOAT16
+ MESA_FORMAT_RGB_FLOAT16,
+ MESA_FORMAT_ALPHA_FLOAT32,
+ MESA_FORMAT_ALPHA_FLOAT16,
+ MESA_FORMAT_LUMINANCE_FLOAT32,
+ MESA_FORMAT_LUMINANCE_FLOAT16,
+ MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32,
+ MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16,
+ MESA_FORMAT_INTENSITY_FLOAT32,
+ MESA_FORMAT_INTENSITY_FLOAT16
/*@}*/
};
-extern GLboolean
-_mesa_is_hardware_tex_format( const struct gl_texture_format *format );
-
-extern const struct gl_texture_format *
-_mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat,
- GLenum format, GLenum type );
-
-extern GLint
-_mesa_base_compressed_texformat(GLcontext *ctx, GLint intFormat);
-
-
/** The default formats, GLchan per component */
/*@{*/
extern const struct gl_texture_format _mesa_texformat_rgba;
@@ -165,13 +170,26 @@ extern const struct gl_texture_format _mesa_texformat_intensity;
extern const struct gl_texture_format _mesa_texformat_color_index;
/*@}*/
+/** Depth textures */
+/*@{*/
+extern const struct gl_texture_format _mesa_texformat_depth_component_float32;
+extern const struct gl_texture_format _mesa_texformat_depth_component16;
+/*@}*/
+
/** Floating point texture formats */
/*@{*/
-extern const struct gl_texture_format _mesa_texformat_depth_component;
extern const struct gl_texture_format _mesa_texformat_rgba_float32;
extern const struct gl_texture_format _mesa_texformat_rgba_float16;
extern const struct gl_texture_format _mesa_texformat_rgb_float32;
extern const struct gl_texture_format _mesa_texformat_rgb_float16;
+extern const struct gl_texture_format _mesa_texformat_alpha_float32;
+extern const struct gl_texture_format _mesa_texformat_alpha_float16;
+extern const struct gl_texture_format _mesa_texformat_luminance_float32;
+extern const struct gl_texture_format _mesa_texformat_luminance_float16;
+extern const struct gl_texture_format _mesa_texformat_luminance_alpha_float32;
+extern const struct gl_texture_format _mesa_texformat_luminance_alpha_float16;
+extern const struct gl_texture_format _mesa_texformat_intensity_float32;
+extern const struct gl_texture_format _mesa_texformat_intensity_float16;
/*@}*/
/** \name The hardware-friendly formats */
@@ -203,4 +221,18 @@ extern const struct gl_texture_format _mesa_texformat_rgba_dxt5;
extern const struct gl_texture_format _mesa_null_texformat;
/*@}*/
+
+#if !NEWTEXSTORE
+extern GLboolean
+_mesa_is_hardware_tex_format( const struct gl_texture_format *format );
+#endif
+
+extern const struct gl_texture_format *
+_mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat,
+ GLenum format, GLenum type );
+
+extern GLint
+_mesa_base_compressed_texformat(GLcontext *ctx, GLint intFormat);
+
+
#endif