summaryrefslogtreecommitdiff
path: root/src/mesa/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/texformat.c27
-rw-r--r--src/mesa/main/texformat.h25
-rw-r--r--src/mesa/main/texstore.c26
-rw-r--r--src/mesa/main/texstore.h1
4 files changed, 64 insertions, 15 deletions
diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c
index c709004784..19c92838e0 100644
--- a/src/mesa/main/texformat.c
+++ b/src/mesa/main/texformat.c
@@ -87,30 +87,33 @@ nonlinear_to_linear(GLubyte cs8)
*
* Have to have this so the FetchTexel function pointer is never NULL.
*/
-static void fetch_null_texel( const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *texel )
+void
+_mesa_texformat_fetch_texel_null(const struct gl_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLchan *texel)
{
(void) texImage; (void) i; (void) j; (void) k;
texel[RCOMP] = 0;
texel[GCOMP] = 0;
texel[BCOMP] = 0;
texel[ACOMP] = 0;
- _mesa_warning(NULL, "fetch_null_texel() called!");
+ _mesa_warning(NULL, "_mesa_texformat_fetch_texel_null() called!");
}
-static void fetch_null_texelf( const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel )
+void
+_mesa_texformat_fetch_texel_f_null(const struct gl_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLfloat *texel)
{
(void) texImage; (void) i; (void) j; (void) k;
texel[RCOMP] = 0.0;
texel[GCOMP] = 0.0;
texel[BCOMP] = 0.0;
texel[ACOMP] = 0.0;
- _mesa_warning(NULL, "fetch_null_texelf() called!");
+ _mesa_warning(NULL, "_mesa_texformat_fetch_texel_f_null() called!");
}
-static void store_null_texel(struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
+void
+_mesa_texformat_store_texel_null(struct gl_texture_image *texImage,
+ GLint i, GLint j, GLint k, const void *texel)
{
(void) texImage;
(void) i;
@@ -1448,13 +1451,7 @@ const struct gl_texture_format _mesa_null_texformat = {
0, /* StencilBits */
0, /* TexelBytes */
NULL, /* StoreTexImageFunc */
- fetch_null_texel, /* FetchTexel1D */
- fetch_null_texel, /* FetchTexel2D */
- fetch_null_texel, /* FetchTexel3D */
- fetch_null_texelf, /* FetchTexel1Df */
- fetch_null_texelf, /* FetchTexel2Df */
- fetch_null_texelf, /* FetchTexel3Df */
- store_null_texel /* StoreTexel */
+ _MESA_TEXFORMAT_NULL_OPS
};
/*@}*/
diff --git a/src/mesa/main/texformat.h b/src/mesa/main/texformat.h
index 5aa1d756cb..b029fd8a74 100644
--- a/src/mesa/main/texformat.h
+++ b/src/mesa/main/texformat.h
@@ -39,6 +39,16 @@
#include "mtypes.h"
+#define _MESA_TEXFORMAT_NULL_OPS \
+ _mesa_texformat_fetch_texel_null, /* FetchTexel1D */ \
+ _mesa_texformat_fetch_texel_null, /* FetchTexel2D */ \
+ _mesa_texformat_fetch_texel_null, /* FetchTexel3D */ \
+ _mesa_texformat_fetch_texel_f_null, /* FetchTexel1Df */ \
+ _mesa_texformat_fetch_texel_f_null, /* FetchTexel2Df */ \
+ _mesa_texformat_fetch_texel_f_null, /* FetchTexel3Df */ \
+ _mesa_texformat_store_texel_null /* StoreTexel */
+
+
/**
* Mesa internal texture image formats.
* All texture images are stored in one of these formats.
@@ -290,4 +300,19 @@ _mesa_format_to_type_and_comps(const struct gl_texture_format *format,
GLenum *datatype, GLuint *comps);
+extern void
+_mesa_texformat_fetch_texel_null(const struct gl_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLchan *texel);
+
+
+extern void
+_mesa_texformat_fetch_texel_f_null(const struct gl_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLfloat *texel);
+
+
+extern void
+_mesa_texformat_store_texel_null(struct gl_texture_image *texImage,
+ GLint i, GLint j, GLint k, const void *texel);
+
+
#endif
diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
index fce01b185e..352c88e673 100644
--- a/src/mesa/main/texstore.c
+++ b/src/mesa/main/texstore.c
@@ -980,6 +980,32 @@ memcpy_texture(GLcontext *ctx,
}
+/**
+ * no-op store
+ */
+GLboolean
+_mesa_texstore_null(TEXSTORE_PARAMS)
+{
+ (void) ctx;
+ (void) dims;
+ (void) baseInternalFormat;
+ (void) dstFormat;
+ (void) dstAddr;
+ (void) dstXoffset;
+ (void) dstYoffset;
+ (void) dstZoffset;
+ (void) dstRowStride;
+ (void) dstImageOffsets;
+ (void) srcWidth;
+ (void) srcHeight;
+ (void) srcDepth;
+ (void) srcFormat;
+ (void) srcType;
+ (void) srcAddr;
+ (void) srcPacking;
+ return GL_TRUE;
+}
+
/**
* Store an image in any of the formats:
diff --git a/src/mesa/main/texstore.h b/src/mesa/main/texstore.h
index 313f2d6a59..e1b12dfa95 100644
--- a/src/mesa/main/texstore.h
+++ b/src/mesa/main/texstore.h
@@ -39,6 +39,7 @@
#include "mtypes.h"
+extern GLboolean _mesa_texstore_null(TEXSTORE_PARAMS);
extern GLboolean _mesa_texstore_rgba(TEXSTORE_PARAMS);
extern GLboolean _mesa_texstore_color_index(TEXSTORE_PARAMS);
extern GLboolean _mesa_texstore_rgba8888(TEXSTORE_PARAMS);