summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2004-01-23 01:59:54 +0000
committerBrian Paul <[email protected]>2004-01-23 01:59:54 +0000
commit4f295cee73bae1f687efe2dc062522b40d90b1e4 (patch)
tree82efe0da331881d5b63bf6805985e909369b58bf /src/mesa/drivers
parentedd1d86c740811e59272e2ba0f7ebe0caf9cf57c (diff)
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.
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/tdfx/tdfx_tex.c40
1 files changed, 16 insertions, 24 deletions
diff --git a/src/mesa/drivers/dri/tdfx/tdfx_tex.c b/src/mesa/drivers/dri/tdfx/tdfx_tex.c
index 3463cc5a6d8..9942166de67 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;