diff options
author | Roland Scheidegger <[email protected]> | 2009-03-12 15:01:16 +0100 |
---|---|---|
committer | Roland Scheidegger <[email protected]> | 2009-03-12 15:01:16 +0100 |
commit | 114152e068ec919feb0a57a1259c2ada970b9f02 (patch) | |
tree | f424d1c9f88ddf36c94991906879f3a71ca1c36a /src/mesa/main/mipmap.c | |
parent | b7d841b59e9087c0ba8c2726897ab1506375e4e6 (diff) |
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)
Diffstat (limited to 'src/mesa/main/mipmap.c')
-rw-r--r-- | src/mesa/main/mipmap.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c index 3dd4b3391b9..af2bf8fe228 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()"); } |