OSDN Git Service

mesa/main: Export null texformat operations.
authorChia-I Wu <olvaffe@gmail.com>
Wed, 9 Sep 2009 03:54:10 +0000 (11:54 +0800)
committerChia-I Wu <olvaffe@gmail.com>
Sat, 12 Sep 2009 12:55:58 +0000 (20:55 +0800)
src/mesa/main/texformat.c
src/mesa/main/texformat.h
src/mesa/main/texstore.c
src/mesa/main/texstore.h

index c709004..19c9283 100644 (file)
@@ -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
 };
 
 /*@}*/
index 5aa1d75..b029fd8 100644 (file)
 #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
index fce01b1..352c88e 100644 (file)
@@ -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:
index 313f2d6..e1b12df 100644 (file)
@@ -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);