From 4f295cee73bae1f687efe2dc062522b40d90b1e4 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 23 Jan 2004 01:59:54 +0000 Subject: Initial support for floating point and signed texture formats. New "FetchTexelFuncF()" function returns texels in floating point format. Only used for depth component images at this time. Changed original FetchTexelFunc to return GLchan instead of GLvoid, removing need for a bunch of ugly casts. --- src/mesa/drivers/dri/tdfx/tdfx_tex.c | 40 +++++++++++++++--------------------- 1 file changed, 16 insertions(+), 24 deletions(-) (limited to 'src/mesa/drivers/dri/tdfx') diff --git a/src/mesa/drivers/dri/tdfx/tdfx_tex.c b/src/mesa/drivers/dri/tdfx/tdfx_tex.c index 3463cc5a6d..9942166de6 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_tex.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_tex.c @@ -705,9 +705,8 @@ fxGlideFormat(GLint mesaFormat) static void fetch_intensity8(const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLvoid * texelOut) + GLint i, GLint j, GLint k, GLchan * rgba) { - GLchan *rgba = (GLchan *) texelOut; const tdfxMipMapLevel *mml = TDFX_TEXIMAGE_DATA(texImage); const GLubyte *texel; @@ -724,9 +723,8 @@ fetch_intensity8(const struct gl_texture_image *texImage, static void fetch_luminance8(const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLvoid * texelOut) + GLint i, GLint j, GLint k, GLchan * rgba) { - GLchan *rgba = (GLchan *) texelOut; const tdfxMipMapLevel *mml = TDFX_TEXIMAGE_DATA(texImage); const GLubyte *texel; @@ -743,9 +741,8 @@ fetch_luminance8(const struct gl_texture_image *texImage, static void fetch_alpha8(const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLvoid * texelOut) + GLint i, GLint j, GLint k, GLchan * rgba) { - GLchan *rgba = (GLchan *) texelOut; const tdfxMipMapLevel *mml = TDFX_TEXIMAGE_DATA(texImage); const GLubyte *texel; @@ -764,7 +761,7 @@ fetch_alpha8(const struct gl_texture_image *texImage, static void fetch_index8(const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLvoid * texelOut) + GLint i, GLint j, GLint k, GLchan * rgba) { const tdfxMipMapLevel *mml = TDFX_TEXIMAGE_DATA(texImage); (void) mml; @@ -774,28 +771,26 @@ fetch_index8(const struct gl_texture_image *texImage, static void fetch_luminance8_alpha8(const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLvoid * texelOut) + GLint i, GLint j, GLint k, GLchan * rgba) { - GLchan *rgba = (GLchan *) texelOut; const tdfxMipMapLevel *mml = TDFX_TEXIMAGE_DATA(texImage); const GLubyte *texel; - i = i * mml->wScale; - j = j * mml->hScale; + i = i * mml->wScale; + j = j * mml->hScale; - texel = ((GLubyte *) texImage->Data) + (j * mml->width + i) * 2; - rgba[RCOMP] = texel[0]; - rgba[GCOMP] = texel[0]; - rgba[BCOMP] = texel[0]; - rgba[ACOMP] = texel[1]; + texel = ((GLubyte *) texImage->Data) + (j * mml->width + i) * 2; + rgba[RCOMP] = texel[0]; + rgba[GCOMP] = texel[0]; + rgba[BCOMP] = texel[0]; + rgba[ACOMP] = texel[1]; } static void fetch_r5g6b5(const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLvoid * texelOut) + GLint i, GLint j, GLint k, GLchan * rgba) { - GLchan *rgba = (GLchan *) texelOut; const tdfxMipMapLevel *mml = TDFX_TEXIMAGE_DATA(texImage); const GLushort *texel; @@ -812,9 +807,8 @@ fetch_r5g6b5(const struct gl_texture_image *texImage, static void fetch_r4g4b4a4(const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLvoid * texelOut) + GLint i, GLint j, GLint k, GLchan * rgba) { - GLchan *rgba = (GLchan *) texelOut; const tdfxMipMapLevel *mml = TDFX_TEXIMAGE_DATA(texImage); const GLushort *texel; @@ -831,9 +825,8 @@ fetch_r4g4b4a4(const struct gl_texture_image *texImage, static void fetch_r5g5b5a1(const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLvoid * texelOut) + GLint i, GLint j, GLint k, GLchan * rgba) { - GLchan *rgba = (GLchan *) texelOut; const tdfxMipMapLevel *mml = TDFX_TEXIMAGE_DATA(texImage); const GLushort *texel; @@ -850,9 +843,8 @@ fetch_r5g5b5a1(const struct gl_texture_image *texImage, static void fetch_a8r8g8b8(const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLvoid * texelOut) + GLint i, GLint j, GLint k, GLchan * rgba) { - GLchan *rgba = (GLchan *) texelOut; const tdfxMipMapLevel *mml = TDFX_TEXIMAGE_DATA(texImage); const GLuint *texel; -- cgit v1.2.3