diff options
author | Brian Paul <[email protected]> | 2009-09-27 19:58:18 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2009-09-27 19:58:18 -0600 |
commit | b58bc12ed4a3de6c828bd26c4820d7ddbb1eabd6 (patch) | |
tree | b041de3a7c93e9291576f3070c79fdc4614b85c5 /src/mesa/drivers/dri | |
parent | 21db8959c1134b43c9fe6d6179ee8fd9cde0b911 (diff) |
via: use mesa texture format helper functions
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r-- | src/mesa/drivers/dri/unichrome/via_tex.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/mesa/drivers/dri/unichrome/via_tex.c b/src/mesa/drivers/dri/unichrome/via_tex.c index 388fd9392cf..02a0043bbe3 100644 --- a/src/mesa/drivers/dri/unichrome/via_tex.c +++ b/src/mesa/drivers/dri/unichrome/via_tex.c @@ -30,6 +30,7 @@ #include "main/macros.h" #include "main/mtypes.h" #include "main/enums.h" +#include "main/formats.h" #include "main/colortab.h" #include "main/convolve.h" #include "main/context.h" @@ -689,15 +690,9 @@ static void viaTexImage(GLcontext *ctx, assert(texImage->TexFormat); - if (dims == 1) { - texImage->FetchTexelc = texImage->TexFormat->FetchTexel1D; - texImage->FetchTexelf = texImage->TexFormat->FetchTexel1Df; - } - else { - texImage->FetchTexelc = texImage->TexFormat->FetchTexel2D; - texImage->FetchTexelf = texImage->TexFormat->FetchTexel2Df; - } - texelBytes = texImage->TexFormat->TexelBytes; + _mesa_set_fetch_functions(texImage, dims); + + texelBytes = _mesa_get_format_bytes(texImage->TexFormat->MesaFormat); if (texelBytes == 0) { /* compressed format */ @@ -804,7 +799,7 @@ static void viaTexImage(GLcontext *ctx, dstRowStride = _mesa_compressed_row_stride(texImage->TexFormat->MesaFormat, width); } else { - dstRowStride = postConvWidth * texImage->TexFormat->TexelBytes; + dstRowStride = postConvWidth * _mesa_get_format_bytes(texImage->TexFormat->MesaFormat); } ASSERT(storeImage); success = storeImage(ctx, dims, |