diff options
author | Brian Paul <[email protected]> | 2001-10-17 13:31:07 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2001-10-17 13:31:07 +0000 |
commit | e11f089f821ea90754d8cbe56278eba4cf5665f4 (patch) | |
tree | a4a6e49a2fc7f250328ccfdf7bd62ce4be9b3e65 /src/mesa/swrast | |
parent | 470d3cd4a2c49a36babfc66933140d57535d724f (diff) |
added GL_ARB_texture_mirrored_repeat
Diffstat (limited to 'src/mesa/swrast')
-rw-r--r-- | src/mesa/swrast/s_texture.c | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/src/mesa/swrast/s_texture.c b/src/mesa/swrast/s_texture.c index 39d9a9c6129..fcbbe73a7a4 100644 --- a/src/mesa/swrast/s_texture.c +++ b/src/mesa/swrast/s_texture.c @@ -1,4 +1,4 @@ -/* $Id: s_texture.c,v 1.39 2001/09/19 20:30:44 kschultz Exp $ */ +/* $Id: s_texture.c,v 1.40 2001/10/17 13:31:07 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -92,6 +92,19 @@ I0 = IFLOOR(U); \ I1 = I0 + 1; \ } \ + else if (wrapMode == GL_MIRRORED_REPEAT_ARB) { \ + const GLint flr = IFLOOR(S); \ + if (flr & 1) \ + U = 1.0 - (S - (GLfloat) flr); /* flr is odd */ \ + else \ + U = S - (GLfloat) flr; /* flr is even */ \ + I0 = IFLOOR(U); \ + I1 = I0 + 1; \ + if (I0 < 0) \ + I0 = 0; \ + if (I1 >= (GLint) SIZE) \ + I1 = SIZE - 1; \ + } \ else { \ ASSERT(wrapMode == GL_CLAMP); \ if (S <= 0.0F) \ @@ -142,6 +155,22 @@ else \ I = IFLOOR(S * SIZE); \ } \ + else if (wrapMode == GL_MIRRORED_REPEAT_ARB) { \ + const GLfloat min = 1.0F / (2.0F * SIZE); \ + const GLfloat max = 1.0F - min; \ + const GLint flr = IFLOOR(S); \ + GLfloat u; \ + if (flr & 1) \ + u = 1.0 - (S - (GLfloat) flr); /* flr is odd */ \ + else \ + u = S - (GLfloat) flr; /* flr is even */ \ + if (u < min) \ + I = 0; \ + else if (u > max) \ + I = SIZE - 1; \ + else \ + I = IFLOOR(u * SIZE); \ + } \ else { \ ASSERT(wrapMode == GL_CLAMP); \ /* s limited to [0,1] */ \ @@ -2133,8 +2162,6 @@ texture_combine(const GLcontext *ctx, } } break; - case GL_DOT3_RGB_EXT: - case GL_DOT3_RGBA_EXT: case GL_DOT3_RGB_ARB: case GL_DOT3_RGBA_ARB: { |