* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#if DIM == 1
#define TEXEL_ADDR( type, image, i, j, k, size ) \
- ((void) (j), (void) (k), ((type *)(image)->Data + (i) * (size)))
+ ((void) (j), (void) (k), ((type *)(image)->Map + (i) * (size)))
#define FETCH(x) fetch_texel_1d_##x
#define TEXEL_ADDR( type, image, i, j, k, size ) \
((void) (k), \
- ((type *)(image)->Data + ((image)->RowStride * (j) + (i)) * (size)))
+ ((type *)(image)->Map + ((image)->RowStride * (j) + (i)) * (size)))
#define FETCH(x) fetch_texel_2d_##x
#elif DIM == 3
#define TEXEL_ADDR( type, image, i, j, k, size ) \
- ((type *)(image)->Data + ((image)->ImageOffsets[k] \
+ ((type *)(image)->Map + ((image)->ImageOffsets[k] \
+ (image)->RowStride * (j) + (i)) * (size))
#define FETCH(x) fetch_texel_3d_##x
texel[0] = src[0] * (1.0F / 0xffffffff);
}
-#if DIM == 3
-static void store_texel_z32(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLuint *depth = (const GLuint *) texel;
- GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1);
- dst[0] = *depth;
-}
-#endif
-
/* MESA_FORMAT_Z16 ***********************************************************/
texel[0] = src[0] * (1.0F / 65535.0F);
}
-#if DIM == 3
-static void store_texel_z16(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLushort *depth = (const GLushort *) texel;
- GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1);
- dst[0] = *depth;
-}
-#endif
/* MESA_FORMAT_RGBA_F32 ******************************************************/
texel[ACOMP] = src[3];
}
-#if DIM == 3
-static void store_texel_rgba_f32(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLfloat *depth = (const GLfloat *) texel;
- GLfloat *dst = TEXEL_ADDR(GLfloat, texImage, i, j, k, 4);
- dst[0] = depth[RCOMP];
- dst[1] = depth[GCOMP];
- dst[2] = depth[BCOMP];
- dst[3] = depth[ACOMP];
-}
-#endif
+
/* MESA_FORMAT_RGBA_F16 ******************************************************/
texel[ACOMP] = _mesa_half_to_float(src[3]);
}
-#if DIM == 3
-static void store_texel_rgba_f16(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLfloat *src = (const GLfloat *) texel;
- GLhalfARB *dst = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 4);
- dst[0] = _mesa_float_to_half(src[RCOMP]);
- dst[1] = _mesa_float_to_half(src[GCOMP]);
- dst[2] = _mesa_float_to_half(src[BCOMP]);
- dst[3] = _mesa_float_to_half(src[ACOMP]);
-}
-#endif
+
/* MESA_FORMAT_RGB_F32 *******************************************************/
texel[ACOMP] = 1.0F;
}
-#if DIM == 3
-static void store_texel_rgb_f32(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLfloat *src = (const GLfloat *) texel;
- GLfloat *dst = TEXEL_ADDR(GLfloat, texImage, i, j, k, 3);
- dst[0] = src[RCOMP];
- dst[1] = src[GCOMP];
- dst[2] = src[BCOMP];
-}
-#endif
+
/* MESA_FORMAT_RGB_F16 *******************************************************/
texel[ACOMP] = 1.0F;
}
-#if DIM == 3
-static void store_texel_rgb_f16(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLfloat *src = (const GLfloat *) texel;
- GLhalfARB *dst = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 3);
- dst[0] = _mesa_float_to_half(src[RCOMP]);
- dst[1] = _mesa_float_to_half(src[GCOMP]);
- dst[2] = _mesa_float_to_half(src[BCOMP]);
-}
-#endif
+
/* MESA_FORMAT_ALPHA_F32 *****************************************************/
texel[ACOMP] = src[0];
}
-#if DIM == 3
-static void store_texel_alpha_f32(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLfloat *rgba = (const GLfloat *) texel;
- GLfloat *dst = TEXEL_ADDR(GLfloat, texImage, i, j, k, 1);
- dst[0] = rgba[ACOMP];
-}
-#endif
+
/* MESA_FORMAT_ALPHA_F32 *****************************************************/
texel[ACOMP] = _mesa_half_to_float(src[0]);
}
-#if DIM == 3
-static void store_texel_alpha_f16(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLfloat *rgba = (const GLfloat *) texel;
- GLhalfARB *dst = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1);
- dst[0] = _mesa_float_to_half(rgba[ACOMP]);
-}
-#endif
+
/* MESA_FORMAT_LUMINANCE_F32 *************************************************/
texel[ACOMP] = 1.0F;
}
-#if DIM == 3
-static void store_texel_luminance_f32(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLfloat *rgba = (const GLfloat *) texel;
- GLfloat *dst = TEXEL_ADDR(GLfloat, texImage, i, j, k, 1);
- dst[0] = rgba[RCOMP];
-}
-#endif
+
/* MESA_FORMAT_LUMINANCE_F16 *************************************************/
texel[ACOMP] = 1.0F;
}
-#if DIM == 3
-static void store_texel_luminance_f16(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLfloat *rgba = (const GLfloat *) texel;
- GLhalfARB *dst = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1);
- dst[0] = _mesa_float_to_half(rgba[RCOMP]);
-}
-#endif
+
/* MESA_FORMAT_LUMINANCE_ALPHA_F32 *******************************************/
texel[ACOMP] = src[1];
}
-#if DIM == 3
-static void store_texel_luminance_alpha_f32(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLfloat *rgba = (const GLfloat *) texel;
- GLfloat *dst = TEXEL_ADDR(GLfloat, texImage, i, j, k, 2);
- dst[0] = rgba[RCOMP];
- dst[1] = rgba[ACOMP];
-}
-#endif
+
/* MESA_FORMAT_LUMINANCE_ALPHA_F16 *******************************************/
texel[ACOMP] = _mesa_half_to_float(src[1]);
}
-#if DIM == 3
-static void store_texel_luminance_alpha_f16(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLfloat *rgba = (const GLfloat *) texel;
- GLhalfARB *dst = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 2);
- dst[0] = _mesa_float_to_half(rgba[RCOMP]);
- dst[1] = _mesa_float_to_half(rgba[ACOMP]);
-}
-#endif
+
/* MESA_FORMAT_INTENSITY_F32 *************************************************/
texel[ACOMP] = src[0];
}
-#if DIM == 3
-static void store_texel_intensity_f32(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLfloat *rgba = (const GLfloat *) texel;
- GLfloat *dst = TEXEL_ADDR(GLfloat, texImage, i, j, k, 1);
- dst[0] = rgba[RCOMP];
-}
-#endif
+
/* MESA_FORMAT_INTENSITY_F16 *************************************************/
texel[ACOMP] = _mesa_half_to_float(src[0]);
}
-#if DIM == 3
-static void store_texel_intensity_f16(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLfloat *rgba = (const GLfloat *) texel;
- GLhalfARB *dst = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1);
- dst[0] = _mesa_float_to_half(rgba[RCOMP]);
-}
-#endif
+
/* MESA_FORMAT_R_FLOAT32 *****************************************************/
texel[ACOMP] = 1.0F;
}
-#if DIM == 3
-static void store_texel_r_f32(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLfloat *rgba = (const GLfloat *) texel;
- GLfloat *dst = TEXEL_ADDR(GLfloat, texImage, i, j, k, 1);
- dst[0] = rgba[RCOMP];
-}
-#endif
+
/* MESA_FORMAT_R_FLOAT16 *****************************************************/
texel[ACOMP] = 1.0F;
}
-#if DIM == 3
-static void store_texel_r_f16(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLfloat *rgba = (const GLfloat *) texel;
- GLhalfARB *dst = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1);
- dst[0] = _mesa_float_to_half(rgba[RCOMP]);
-}
-#endif
+
/* MESA_FORMAT_RG_FLOAT32 ****************************************************/
texel[ACOMP] = 1.0F;
}
-#if DIM == 3
-static void store_texel_rg_f32(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLfloat *rgba = (const GLfloat *) texel;
- GLfloat *dst = TEXEL_ADDR(GLfloat, texImage, i, j, k, 2);
- dst[0] = rgba[RCOMP];
- dst[1] = rgba[GCOMP];
-}
-#endif
+
/* MESA_FORMAT_RG_FLOAT16 ****************************************************/
texel[ACOMP] = 1.0F;
}
-#if DIM == 3
-static void store_texel_rg_f16(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLfloat *rgba = (const GLfloat *) texel;
- GLhalfARB *dst = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 2);
- dst[0] = _mesa_float_to_half(rgba[RCOMP]);
- dst[1] = _mesa_float_to_half(rgba[GCOMP]);
-}
-#endif
+
/*
-#if DIM == 3
-static void store_texel_rgba8888(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLubyte *rgba = (const GLubyte *) texel;
- GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1);
- *dst = PACK_COLOR_8888(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]);
-}
-#endif
+
/* MESA_FORMAT_RGBA888_REV ***************************************************/
texel[ACOMP] = UBYTE_TO_FLOAT( (s >> 24) );
}
-#if DIM == 3
-static void store_texel_rgba8888_rev(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLubyte *rgba = (const GLubyte *) texel;
- GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1);
- *dst = PACK_COLOR_8888_REV(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]);
-}
-#endif
+
/* MESA_FORMAT_ARGB8888 ******************************************************/
texel[ACOMP] = UBYTE_TO_FLOAT( (s >> 24) );
}
-#if DIM == 3
-static void store_texel_argb8888(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLubyte *rgba = (const GLubyte *) texel;
- GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1);
- *dst = PACK_COLOR_8888(rgba[ACOMP], rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]);
-}
-#endif
+
/* MESA_FORMAT_ARGB8888_REV **************************************************/
texel[ACOMP] = UBYTE_TO_FLOAT( (s ) & 0xff );
}
-#if DIM == 3
-static void store_texel_argb8888_rev(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLubyte *rgba = (const GLubyte *) texel;
- GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1);
- *dst = PACK_COLOR_8888(rgba[BCOMP], rgba[GCOMP], rgba[RCOMP], rgba[ACOMP]);
-}
-#endif
+
/* MESA_FORMAT_RGBX8888 ******************************************************/
texel[ACOMP] = 1.0f;
}
-#if DIM == 3
-static void store_texel_rgbx8888(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLubyte *rgba = (const GLubyte *) texel;
- GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1);
- *dst = PACK_COLOR_8888(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], 0xff);
-}
-#endif
+
/* MESA_FORMAT_RGBX888_REV ***************************************************/
texel[ACOMP] = 1.0f;
}
-#if DIM == 3
-static void store_texel_rgbx8888_rev(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLubyte *rgba = (const GLubyte *) texel;
- GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1);
- *dst = PACK_COLOR_8888_REV(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], 0xff);
-}
-#endif
+
/* MESA_FORMAT_XRGB8888 ******************************************************/
texel[ACOMP] = 1.0f;
}
-#if DIM == 3
-static void store_texel_xrgb8888(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLubyte *rgba = (const GLubyte *) texel;
- GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1);
- *dst = PACK_COLOR_8888(0xff, rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]);
-}
-#endif
+
/* MESA_FORMAT_XRGB8888_REV **************************************************/
texel[ACOMP] = 1.0f;
}
-#if DIM == 3
-static void store_texel_xrgb8888_rev(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLubyte *rgba = (const GLubyte *) texel;
- GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1);
- *dst = PACK_COLOR_8888(rgba[BCOMP], rgba[GCOMP], rgba[RCOMP], 0xff);
-}
-#endif
+
/* MESA_FORMAT_RGB888 ********************************************************/
texel[ACOMP] = 1.0F;
}
-#if DIM == 3
-static void store_texel_rgb888(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLubyte *rgba = (const GLubyte *) texel;
- GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 3);
- dst[0] = rgba[BCOMP];
- dst[1] = rgba[GCOMP];
- dst[2] = rgba[RCOMP];
-}
-#endif
+
/* MESA_FORMAT_BGR888 ********************************************************/
texel[ACOMP] = 1.0F;
}
-#if DIM == 3
-static void store_texel_bgr888(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLubyte *rgba = (const GLubyte *) texel;
- GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 3);
- dst[0] = rgba[RCOMP];
- dst[1] = rgba[GCOMP];
- dst[2] = rgba[BCOMP];
-}
-#endif
+
/* use color expansion like (g << 2) | (g >> 4) (does somewhat random rounding)
texel[ACOMP] = 1.0F;
}
-#if DIM == 3
-static void store_texel_rgb565(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLubyte *rgba = (const GLubyte *) texel;
- GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1);
- *dst = PACK_COLOR_565(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]);
-}
-#endif
+
/* MESA_FORMAT_RGB565_REV ****************************************************/
texel[ACOMP] = 1.0F;
}
-#if DIM == 3
-static void store_texel_rgb565_rev(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLchan *rgba = (const GLchan *) texel;
- GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1);
- GLushort p = PACK_COLOR_565(CHAN_TO_UBYTE(rgba[RCOMP]),
- CHAN_TO_UBYTE(rgba[GCOMP]),
- CHAN_TO_UBYTE(rgba[BCOMP]));
- *dst = (p >> 8) | (p << 8); /* byte swap */
-}
-#endif
+
/* MESA_FORMAT_ARGB4444 ******************************************************/
texel[ACOMP] = ((s >> 12) & 0xf) * (1.0F / 15.0F);
}
-#if DIM == 3
-static void store_texel_argb4444(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLchan *rgba = (const GLchan *) texel;
- GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1);
- *dst = PACK_COLOR_4444(CHAN_TO_UBYTE(rgba[ACOMP]),
- CHAN_TO_UBYTE(rgba[RCOMP]),
- CHAN_TO_UBYTE(rgba[GCOMP]),
- CHAN_TO_UBYTE(rgba[BCOMP]));
-}
-#endif
+
/* MESA_FORMAT_ARGB4444_REV **************************************************/
texel[ACOMP] = ((s >> 4) & 0xf) * (1.0F / 15.0F);
}
-#if DIM == 3
-static void store_texel_argb4444_rev(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLchan *rgba = (const GLchan *) texel;
- GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1);
- *dst = PACK_COLOR_4444(CHAN_TO_UBYTE(rgba[GCOMP]),
- CHAN_TO_UBYTE(rgba[BCOMP]),
- CHAN_TO_UBYTE(rgba[ACOMP]),
- CHAN_TO_UBYTE(rgba[RCOMP]));
-}
-#endif
+
/* MESA_FORMAT_RGBA5551 ******************************************************/
texel[ACOMP] = ((s ) & 0x01) * 1.0F;
}
-#if DIM == 3
-static void store_texel_rgba5551(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLubyte *rgba = (const GLubyte *) texel;
- GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1);
- *dst = PACK_COLOR_5551(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]);
-}
-#endif
+
/* MESA_FORMAT_ARGB1555 ******************************************************/
texel[ACOMP] = ((s >> 15) & 0x01) * 1.0F;
}
-#if DIM == 3
-static void store_texel_argb1555(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLubyte *rgba = (const GLubyte *) texel;
- GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1);
- *dst = PACK_COLOR_1555(rgba[ACOMP], rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]);
-}
-#endif
+
/* MESA_FORMAT_ARGB1555_REV **************************************************/
texel[ACOMP] = UBYTE_TO_FLOAT( ((s >> 15) & 0x01) * 255 );
}
-#if DIM == 3
-static void store_texel_argb1555_rev(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLubyte *rgba = (const GLubyte *) texel;
- GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1);
- *dst = PACK_COLOR_1555_REV(rgba[ACOMP], rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]);
-}
-#endif
+
/* MESA_FORMAT_ARGB2101010 ***************************************************/
texel[ACOMP] = ((s >> 30) & 0x03) * (1.0F / 3.0F);
}
-#if DIM == 3
-static void store_texel_argb2101010(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLchan *rgba = (const GLchan *) texel;
- GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1);
- GLushort r = CHAN_TO_USHORT(rgba[RCOMP]);
- GLushort g = CHAN_TO_USHORT(rgba[GCOMP]);
- GLushort b = CHAN_TO_USHORT(rgba[BCOMP]);
- GLushort a = CHAN_TO_USHORT(rgba[ACOMP]);
- *dst = PACK_COLOR_2101010_US(a, r, g, b);
-}
-#endif
+
/* MESA_FORMAT_GR88 **********************************************************/
texel[ACOMP] = 1.0;
}
-#if DIM == 3
-static void store_texel_gr88(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLchan *rgba = (const GLchan *) texel;
- GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1);
- GLubyte r = CHAN_TO_UBYTE(rgba[RCOMP]);
- GLubyte g = CHAN_TO_UBYTE(rgba[GCOMP]);
- *dst = PACK_COLOR_88(g, r);
-}
-#endif
+
/* MESA_FORMAT_RG88 ******************************************************/
texel[ACOMP] = 1.0;
}
-#if DIM == 3
-static void store_texel_rg88(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLubyte *rgba = (const GLubyte *) texel;
- GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1);
- *dst = PACK_COLOR_88(rgba[RCOMP], rgba[GCOMP]);
-}
-#endif
+
/* MESA_FORMAT_AL44 **********************************************************/
texel[ACOMP] = ((s >> 4) & 0xf) * (1.0F / 15.0F);
}
-#if DIM == 3
-static void store_texel_al44(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLubyte *rgba = (const GLubyte *) texel;
- GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1);
- *dst = PACK_COLOR_44(rgba[ACOMP], rgba[RCOMP]);
-}
-#endif
+
/* MESA_FORMAT_AL88 **********************************************************/
texel[ACOMP] = UBYTE_TO_FLOAT( s >> 8 );
}
-#if DIM == 3
-static void store_texel_al88(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLubyte *rgba = (const GLubyte *) texel;
- GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1);
- *dst = PACK_COLOR_88(rgba[ACOMP], rgba[RCOMP]);
-}
-#endif
+
/* MESA_FORMAT_R8 ************************************************************/
texel[ACOMP] = 1.0;
}
-#if DIM == 3
-static void store_texel_r8(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLubyte *rgba = (const GLubyte *) texel;
- GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1);
- *dst = rgba[RCOMP];
-}
-#endif
+
/* MESA_FORMAT_R16 ***********************************************************/
texel[ACOMP] = 1.0;
}
-#if DIM == 3
-static void store_texel_r16(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLchan *rgba = (const GLchan *) texel;
- GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1);
- *dst = CHAN_TO_USHORT(rgba[RCOMP]);
-}
-#endif
+
/* MESA_FORMAT_AL88_REV ******************************************************/
texel[ACOMP] = UBYTE_TO_FLOAT( s & 0xff );
}
-#if DIM == 3
-static void store_texel_al88_rev(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLubyte *rgba = (const GLubyte *) texel;
- GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1);
- *dst = PACK_COLOR_88(rgba[RCOMP], rgba[ACOMP]);
-}
-#endif
-/* MESA_FORMAT_RG1616 ********************************************************/
+
+/* MESA_FORMAT_GR1616 ********************************************************/
/* Fetch texel from 1D, 2D or 3D rg1616 texture, return 4 GLchans */
static void FETCH(f_rg1616)( const struct swrast_texture_image *texImage,
texel[ACOMP] = 1.0;
}
-#if DIM == 3
-static void store_texel_rg1616(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLchan *rgba = (const GLchan *) texel;
- GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1);
- GLushort r = CHAN_TO_USHORT(rgba[RCOMP]);
- GLushort g = CHAN_TO_USHORT(rgba[GCOMP]);
- *dst = PACK_COLOR_1616(g, r);
-}
-#endif
-/* MESA_FORMAT_RG1616_REV ****************************************************/
+
+/* MESA_FORMAT_RG1616 ****************************************************/
/* Fetch texel from 1D, 2D or 3D rg1616_rev texture, return 4 GLchans */
static void FETCH(f_rg1616_rev)( const struct swrast_texture_image *texImage,
texel[ACOMP] = 1.0;
}
-#if DIM == 3
-static void store_texel_rg1616_rev(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLubyte *rgba = (const GLubyte *) texel;
- GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1);
- *dst = PACK_COLOR_1616(rgba[GCOMP], rgba[RCOMP]);
-}
-#endif
+
/* MESA_FORMAT_AL1616 ********************************************************/
texel[ACOMP] = USHORT_TO_FLOAT( s >> 16 );
}
-#if DIM == 3
-static void store_texel_al1616(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLchan *rgba = (const GLchan *) texel;
- GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1);
- GLushort l = CHAN_TO_USHORT(rgba[RCOMP]);
- GLushort a = CHAN_TO_USHORT(rgba[ACOMP]);
- *dst = PACK_COLOR_1616(a, l);
-}
-#endif
+
/* MESA_FORMAT_AL1616_REV ****************************************************/
texel[ACOMP] = USHORT_TO_FLOAT( s & 0xffff );
}
-#if DIM == 3
-static void store_texel_al1616_rev(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLushort *rgba = (const GLushort *) texel;
- GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1);
- *dst = PACK_COLOR_1616(rgba[RCOMP], rgba[ACOMP]);
-}
-#endif
+
/* MESA_FORMAT_RGB332 ********************************************************/
texel[ACOMP] = 1.0F;
}
-#if DIM == 3
-static void store_texel_rgb332(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLubyte *rgba = (const GLubyte *) texel;
- GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1);
- *dst = PACK_COLOR_332(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]);
-}
-#endif
+
/* MESA_FORMAT_A8 ************************************************************/
texel[ACOMP] = UBYTE_TO_FLOAT( src[0] );
}
-#if DIM == 3
-static void store_texel_a8(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLubyte *rgba = (const GLubyte *) texel;
- GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1);
- *dst = rgba[ACOMP];
-}
-#endif
+
/* MESA_FORMAT_A16 ************************************************************/
texel[ACOMP] = USHORT_TO_FLOAT( src[0] );
}
-#if DIM == 3
-static void store_texel_a16(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLchan *rgba = (const GLchan *) texel;
- GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1);
- *dst = CHAN_TO_USHORT(rgba[ACOMP]);
-}
-#endif
+
/* MESA_FORMAT_L8 ************************************************************/
texel[ACOMP] = 1.0F;
}
-#if DIM == 3
-static void store_texel_l8(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLubyte *rgba = (const GLubyte *) texel;
- GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1);
- *dst = rgba[RCOMP];
-}
-#endif
+
/* MESA_FORMAT_L16 ***********************************************************/
texel[ACOMP] = 1.0F;
}
-#if DIM == 3
-static void store_texel_l16(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLchan *rgba = (const GLchan *) texel;
- GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1);
- *dst = CHAN_TO_USHORT(rgba[RCOMP]);
-}
-#endif
+
/* MESA_FORMAT_I8 ************************************************************/
texel[ACOMP] = UBYTE_TO_FLOAT( src[0] );
}
-#if DIM == 3
-static void store_texel_i8(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLubyte *rgba = (const GLubyte *) texel;
- GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1);
- *dst = rgba[RCOMP];
-}
-#endif
+
/* MESA_FORMAT_I16 ***********************************************************/
texel[ACOMP] = USHORT_TO_FLOAT( src[0] );
}
-#if DIM == 3
-static void store_texel_i16(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLchan *rgba = (const GLchan *) texel;
- GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1);
- *dst = CHAN_TO_USHORT(rgba[RCOMP]);
-}
-#endif
+
/* Fetch texel from 1D, 2D or 3D srgb8 texture, return 4 GLfloats */
texel[ACOMP] = 1.0F;
}
-#if DIM == 3
-static void store_texel_srgb8(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLubyte *rgba = (const GLubyte *) texel;
- GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 3);
- dst[0] = rgba[BCOMP]; /* no conversion */
- dst[1] = rgba[GCOMP];
- dst[2] = rgba[RCOMP];
-}
-#endif
+
/* Fetch texel from 1D, 2D or 3D srgba8 texture, return 4 GLfloats */
static void FETCH(srgba8)(const struct swrast_texture_image *texImage,
texel[ACOMP] = UBYTE_TO_FLOAT( (s ) & 0xff ); /* linear! */
}
-#if DIM == 3
-static void store_texel_srgba8(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLubyte *rgba = (const GLubyte *) texel;
- GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1);
- *dst = PACK_COLOR_8888(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]);
-}
-#endif
+
/* Fetch texel from 1D, 2D or 3D sargb8 texture, return 4 GLfloats */
static void FETCH(sargb8)(const struct swrast_texture_image *texImage,
texel[ACOMP] = UBYTE_TO_FLOAT( (s >> 24) ); /* linear! */
}
-#if DIM == 3
-static void store_texel_sargb8(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLubyte *rgba = (const GLubyte *) texel;
- GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1);
- *dst = PACK_COLOR_8888(rgba[ACOMP], rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]);
-}
-#endif
+
/* Fetch texel from 1D, 2D or 3D sl8 texture, return 4 GLfloats */
static void FETCH(sl8)(const struct swrast_texture_image *texImage,
texel[ACOMP] = 1.0F;
}
-#if DIM == 3
-static void store_texel_sl8(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLubyte *rgba = (const GLubyte *) texel;
- GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1);
- dst[0] = rgba[RCOMP];
-}
-#endif
+
/* Fetch texel from 1D, 2D or 3D sla8 texture, return 4 GLfloats */
static void FETCH(sla8)(const struct swrast_texture_image *texImage,
texel[ACOMP] = UBYTE_TO_FLOAT(src[1]); /* linear */
}
-#if DIM == 3
-static void store_texel_sla8(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLubyte *rgba = (const GLubyte *) texel;
- GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 2);
- dst[0] = rgba[RCOMP];
- dst[1] = rgba[ACOMP];
-}
-#endif
+
/* MESA_FORMAT_RGBA_INT8 **************************************************/
texel[ACOMP] = (GLfloat) src[3];
}
-#if DIM == 3
-static void
-store_texel_rgba_int8(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLbyte *rgba = (const GLbyte *) texel;
- GLbyte *dst = TEXEL_ADDR(GLbyte, texImage, i, j, k, 4);
- dst[0] = rgba[RCOMP];
- dst[1] = rgba[GCOMP];
- dst[2] = rgba[BCOMP];
- dst[3] = rgba[ACOMP];
-}
-#endif
+
/* MESA_FORMAT_RGBA_INT16 **************************************************/
texel[ACOMP] = (GLfloat) src[3];
}
-#if DIM == 3
-static void
-store_texel_rgba_int16(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLshort *rgba = (const GLshort *) texel;
- GLshort *dst = TEXEL_ADDR(GLshort, texImage, i, j, k, 4);
- dst[0] = rgba[RCOMP];
- dst[1] = rgba[GCOMP];
- dst[2] = rgba[BCOMP];
- dst[3] = rgba[ACOMP];
-}
-#endif
+
/* MESA_FORMAT_RGBA_INT32 **************************************************/
texel[ACOMP] = (GLfloat) src[3];
}
-#if DIM == 3
-static void
-store_texel_rgba_int32(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLint *rgba = (const GLint *) texel;
- GLint *dst = TEXEL_ADDR(GLint, texImage, i, j, k, 4);
- dst[0] = rgba[RCOMP];
- dst[1] = rgba[GCOMP];
- dst[2] = rgba[BCOMP];
- dst[3] = rgba[ACOMP];
-}
-#endif
+
/* MESA_FORMAT_RGBA_UINT8 **************************************************/
texel[ACOMP] = (GLfloat) src[3];
}
-#if DIM == 3
-static void
-store_texel_rgba_uint8(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLubyte *rgba = (const GLubyte *) texel;
- GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 4);
- dst[0] = rgba[RCOMP];
- dst[1] = rgba[GCOMP];
- dst[2] = rgba[BCOMP];
- dst[3] = rgba[ACOMP];
-}
-#endif
+
/* MESA_FORMAT_RGBA_UINT16 **************************************************/
texel[ACOMP] = (GLfloat) src[3];
}
-#if DIM == 3
-static void
-store_texel_rgba_uint16(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLushort *rgba = (const GLushort *) texel;
- GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 4);
- dst[0] = rgba[RCOMP];
- dst[1] = rgba[GCOMP];
- dst[2] = rgba[BCOMP];
- dst[3] = rgba[ACOMP];
-}
-#endif
+
/* MESA_FORMAT_RGBA_UINT32 **************************************************/
texel[ACOMP] = (GLfloat) src[3];
}
-#if DIM == 3
-static void
-store_texel_rgba_uint32(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLuint *rgba = (const GLuint *) texel;
- GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 4);
- dst[0] = rgba[RCOMP];
- dst[1] = rgba[GCOMP];
- dst[2] = rgba[BCOMP];
- dst[3] = rgba[ACOMP];
-}
-#endif
+
/* MESA_FORMAT_DUDV8 ********************************************************/
texel[ACOMP] = 1.0F;
}
-#if DIM == 3
-static void store_texel_signed_r8(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLbyte *rgba = (const GLbyte *) texel;
- GLbyte *dst = TEXEL_ADDR(GLbyte, texImage, i, j, k, 1);
- *dst = rgba[RCOMP];
-}
-#endif
+
/* MESA_FORMAT_SIGNED_A8 ***********************************************/
texel[ACOMP] = BYTE_TO_FLOAT_TEX( s );
}
-#if DIM == 3
-static void store_texel_signed_a8(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLbyte *rgba = (const GLbyte *) texel;
- GLbyte *dst = TEXEL_ADDR(GLbyte, texImage, i, j, k, 1);
- *dst = rgba[ACOMP];
-}
-#endif
+
/* MESA_FORMAT_SIGNED_L8 ***********************************************/
texel[ACOMP] = 1.0F;
}
-#if DIM == 3
-static void store_texel_signed_l8(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLbyte *rgba = (const GLbyte *) texel;
- GLbyte *dst = TEXEL_ADDR(GLbyte, texImage, i, j, k, 1);
- *dst = rgba[RCOMP];
-}
-#endif
+
/* MESA_FORMAT_SIGNED_I8 ***********************************************/
texel[ACOMP] = BYTE_TO_FLOAT_TEX( s );
}
-#if DIM == 3
-static void store_texel_signed_i8(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLbyte *rgba = (const GLbyte *) texel;
- GLbyte *dst = TEXEL_ADDR(GLbyte, texImage, i, j, k, 1);
- *dst = rgba[RCOMP];
-}
-#endif
+
/* MESA_FORMAT_SIGNED_RG88_REV ***********************************************/
texel[ACOMP] = 1.0F;
}
-#if DIM == 3
-static void store_texel_signed_rg88_rev(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLbyte *rg = (const GLbyte *) texel;
- GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1);
- dst[0] = PACK_COLOR_88(rg[GCOMP], rg[RCOMP]);
-}
-#endif
+
/* MESA_FORMAT_SIGNED_AL88 ***********************************************/
texel[ACOMP] = BYTE_TO_FLOAT_TEX( (GLbyte) (s >> 8) );
}
-#if DIM == 3
-static void store_texel_signed_al88(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLbyte *rg = (const GLbyte *) texel;
- GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1);
- dst[0] = PACK_COLOR_88(rg[ACOMP], rg[RCOMP]);
-}
-#endif
+
/* MESA_FORMAT_SIGNED_RGBX8888 ***********************************************/
texel[ACOMP] = 1.0f;
}
-#if DIM == 3
-static void store_texel_signed_rgbx8888(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLbyte *rgba = (const GLbyte *) texel;
- GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1);
- *dst = PACK_COLOR_8888(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], 255);
-}
-#endif
+
/* MESA_FORMAT_SIGNED_RGBA8888 ***********************************************/
texel[ACOMP] = BYTE_TO_FLOAT_TEX( (GLbyte) (s ) );
}
-#if DIM == 3
-static void store_texel_signed_rgba8888(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLbyte *rgba = (const GLbyte *) texel;
- GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1);
- *dst = PACK_COLOR_8888(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]);
-}
-#endif
+
static void FETCH(signed_rgba8888_rev)( const struct swrast_texture_image *texImage,
GLint i, GLint j, GLint k, GLfloat *texel )
texel[ACOMP] = BYTE_TO_FLOAT_TEX( (GLbyte) (s >> 24) );
}
-#if DIM == 3
-static void store_texel_signed_rgba8888_rev(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLubyte *rgba = (const GLubyte *) texel;
- GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1);
- *dst = PACK_COLOR_8888_REV(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]);
-}
-#endif
+
texel[ACOMP] = 1.0F;
}
-#if DIM == 3
-static void
-store_texel_signed_r16(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLshort *rgba = (const GLshort *) texel;
- GLshort *dst = TEXEL_ADDR(GLshort, texImage, i, j, k, 1);
- *dst = rgba[0];
-}
-#endif
+
/* MESA_FORMAT_SIGNED_A16 ***********************************************/
texel[ACOMP] = SHORT_TO_FLOAT_TEX( s );
}
-#if DIM == 3
-static void
-store_texel_signed_a16(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLshort *rgba = (const GLshort *) texel;
- GLshort *dst = TEXEL_ADDR(GLshort, texImage, i, j, k, 1);
- *dst = rgba[ACOMP];
-}
-#endif
+
/* MESA_FORMAT_SIGNED_L16 ***********************************************/
texel[ACOMP] = 1.0F;
}
-#if DIM == 3
-static void
-store_texel_signed_l16(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLshort *rgba = (const GLshort *) texel;
- GLshort *dst = TEXEL_ADDR(GLshort, texImage, i, j, k, 1);
- *dst = rgba[RCOMP];
-}
-#endif
+
/* MESA_FORMAT_SIGNED_I16 ***********************************************/
texel[ACOMP] = SHORT_TO_FLOAT_TEX( s );
}
-#if DIM == 3
-static void
-store_texel_signed_i16(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLshort *rgba = (const GLshort *) texel;
- GLshort *dst = TEXEL_ADDR(GLshort, texImage, i, j, k, 1);
- *dst = rgba[RCOMP];
-}
-#endif
+
/* MESA_FORMAT_SIGNED_RG1616 ***********************************************/
texel[ACOMP] = 1.0F;
}
-#if DIM == 3
-static void
-store_texel_signed_rg1616(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLchan *rgba = (const GLchan *) texel;
- GLshort *dst = TEXEL_ADDR(GLshort, texImage, i, j, k, 2);
- dst[0] = CHAN_TO_SHORT(rgba[RCOMP]);
- dst[1] = CHAN_TO_SHORT(rgba[GCOMP]);
-}
-#endif
+
/* MESA_FORMAT_SIGNED_AL1616 ***********************************************/
texel[ACOMP] = SHORT_TO_FLOAT_TEX( s[1] );
}
-#if DIM == 3
-static void
-store_texel_signed_al1616(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLchan *rgba = (const GLchan *) texel;
- GLshort *dst = TEXEL_ADDR(GLshort, texImage, i, j, k, 2);
- dst[0] = CHAN_TO_SHORT(rgba[RCOMP]);
- dst[1] = CHAN_TO_SHORT(rgba[ACOMP]);
-}
-#endif
+
/* MESA_FORMAT_SIGNED_RGB_16 ***********************************************/
texel[ACOMP] = 1.0F;
}
-#if DIM == 3
-static void
-store_texel_signed_rgb_16(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLchan *rgba = (const GLchan *) texel;
- GLshort *dst = TEXEL_ADDR(GLshort, texImage, i, j, k, 3);
- dst[0] = CHAN_TO_SHORT(rgba[RCOMP]);
- dst[1] = CHAN_TO_SHORT(rgba[GCOMP]);
- dst[2] = CHAN_TO_SHORT(rgba[BCOMP]);
-}
-#endif
+
/* MESA_FORMAT_SIGNED_RGBA_16 ***********************************************/
texel[ACOMP] = SHORT_TO_FLOAT_TEX( s[3] );
}
-#if DIM == 3
-static void
-store_texel_signed_rgba_16(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLchan *rgba = (const GLchan *) texel;
- GLshort *dst = TEXEL_ADDR(GLshort, texImage, i, j, k, 4);
- dst[0] = CHAN_TO_SHORT(rgba[RCOMP]);
- dst[1] = CHAN_TO_SHORT(rgba[GCOMP]);
- dst[2] = CHAN_TO_SHORT(rgba[BCOMP]);
- dst[3] = CHAN_TO_SHORT(rgba[ACOMP]);
-}
-#endif
+
texel[ACOMP] = USHORT_TO_FLOAT( s[3] );
}
-#if DIM == 3
-static void
-store_texel_rgba_16(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLchan *rgba = (const GLchan *) texel;
- GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 4);
- dst[0] = CHAN_TO_USHORT(rgba[RCOMP]);
- dst[1] = CHAN_TO_USHORT(rgba[GCOMP]);
- dst[2] = CHAN_TO_USHORT(rgba[BCOMP]);
- dst[3] = CHAN_TO_USHORT(rgba[ACOMP]);
-}
-#endif
+
texel[ACOMP] = 1.0F;
}
-#if DIM == 3
-static void store_texel_ycbcr(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- (void) texImage;
- (void) i;
- (void) j;
- (void) k;
- (void) texel;
- /* XXX to do */
-}
-#endif
+
/* MESA_FORMAT_YCBCR_REV *****************************************************/
texel[ACOMP] = 1.0F;
}
-#if DIM == 3
-static void store_texel_ycbcr_rev(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- (void) texImage;
- (void) i;
- (void) j;
- (void) k;
- (void) texel;
- /* XXX to do */
-}
-#endif
+
/* MESA_TEXFORMAT_Z24_S8 ***************************************************/
ASSERT(texel[0] <= 1.0F);
}
-#if DIM == 3
-static void store_texel_z24_s8(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- /* only store Z, not stencil */
- GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1);
- GLfloat depth = *((GLfloat *) texel);
- GLuint zi = ((GLuint) (depth * 0xffffff)) << 8;
- *dst = zi | (*dst & 0xff);
-}
-#endif
+
/* MESA_TEXFORMAT_S8_Z24 ***************************************************/
ASSERT(texel[0] <= 1.0F);
}
-#if DIM == 3
-static void store_texel_s8_z24(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- /* only store Z, not stencil */
- GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1);
- GLfloat depth = *((GLfloat *) texel);
- GLuint zi = (GLuint) (depth * 0xffffff);
- *dst = zi | (*dst & 0xff000000);
-}
-#endif
+
/* MESA_FORMAT_RGB9_E5 ******************************************************/
texel[ACOMP] = 1.0F;
}
-#if DIM == 3
-static void store_texel_rgb9_e5(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLfloat *src = (const GLfloat *) texel;
- GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1);
- *dst = float3_to_rgb9e5(src);
-}
-#endif
+
/* MESA_FORMAT_R11_G11_B10_FLOAT *********************************************/
texel[ACOMP] = 1.0F;
}
-#if DIM == 3
-static void store_texel_r11_g11_b10f(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLfloat *src = (const GLfloat *) texel;
- GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1);
- *dst = float3_to_r11g11b10f(src);
-}
-#endif
+
/* MESA_FORMAT_Z32_FLOAT_X24S8 ***********************************************/
texel[ACOMP] = 1.0F;
}
-#if DIM == 3
-static void store_texel_z32f_x24s8(struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLfloat *src = (const GLfloat *) texel;
- GLfloat *dst = TEXEL_ADDR(GLfloat, texImage, i, j, k, 2);
- dst[0] = src[0];
-}
-#endif
#undef TEXEL_ADDR