From 114152e068ec919feb0a57a1259c2ada970b9f02 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Thu, 12 Mar 2009 15:01:16 +0100 Subject: mesa: add support for ATI_envmap_bumpmap add new entrypoints, new texture format, etc translate in texenvprogram.c for drivers using the mesa-generated tex env fragment program also handled in swrast, but not tested (cannot work due to negative texel results not handled correctly) --- src/mesa/main/mipmap.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/mesa/main/mipmap.c') diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c index 3dd4b3391b..af2bf8fe22 100644 --- a/src/mesa/main/mipmap.c +++ b/src/mesa/main/mipmap.c @@ -85,7 +85,7 @@ bytes_per_pixel(GLenum datatype, GLuint comps) rowC[j][e], rowC[k][e], \ rowD[j][e], rowD[k][e]); \ } while(0) - + #define FILTER_F_3D(e) \ do { \ dst[i][e] = (rowA[j][e] + rowA[k][e] \ @@ -226,7 +226,6 @@ do_row(GLenum datatype, GLuint comps, GLint srcWidth, dst[i] = (rowA[j] + rowA[k] + rowB[j] + rowB[k]) / 4; } } - else if (datatype == GL_FLOAT && comps == 4) { GLuint i, j, k; const GLfloat(*rowA)[4] = (const GLfloat(*)[4]) srcRowA; @@ -471,6 +470,17 @@ do_row(GLenum datatype, GLuint comps, GLint srcWidth, dst[i] = (blue << 5) | (green << 2) | red; } } + else if (datatype == GL_BYTE && comps == 2) { + GLuint i, j, k; + const GLbyte(*rowA)[2] = (const GLbyte(*)[2]) srcRowA; + const GLbyte(*rowB)[2] = (const GLbyte(*)[2]) srcRowB; + GLbyte(*dst)[2] = (GLbyte(*)[2]) dstRow; + for (i = j = 0, k = k0; i < (GLuint) dstWidth; + i++, j += colStride, k += colStride) { + dst[i][0] = (rowA[j][0] + rowA[k][0] + rowB[j][0] + rowB[k][0]) >> 2; + dst[i][1] = (rowA[j][1] + rowA[k][1] + rowB[j][1] + rowB[k][1]) >> 2; + } + } else { _mesa_problem(NULL, "bad format in do_row()"); } -- cgit v1.2.3