st/mesa: fix texture border color for RED and RG base formats
authorMarek Olšák <maraeo@gmail.com>
Mon, 29 Nov 2010 04:46:15 +0000 (05:46 +0100)
committerMarek Olšák <maraeo@gmail.com>
Mon, 29 Nov 2010 16:26:40 +0000 (17:26 +0100)
The spec says the border color should be consistent with the internal
format.

Signed-off-by: Brian Paul <brianp@vmware.com>
src/mesa/state_tracker/st_atom_sampler.c

index f147d76808469dcf86affa59d20bd90b179ae2e8..b67068df373d7a358c701a08b7714efceda81404 100644 (file)
@@ -121,6 +121,18 @@ static void
 xlate_border_color(const GLfloat *colorIn, GLenum baseFormat, GLfloat *colorOut)
 {
    switch (baseFormat) {
+   case GL_RED:
+      colorOut[0] = colorIn[0];
+      colorOut[1] = 0.0F;
+      colorOut[2] = 0.0F;
+      colorOut[3] = 1.0F;
+      break;
+   case GL_RG:
+      colorOut[0] = colorIn[0];
+      colorOut[1] = colorIn[1];
+      colorOut[2] = 0.0F;
+      colorOut[3] = 1.0F;
+      break;
    case GL_RGB:
       colorOut[0] = colorIn[0];
       colorOut[1] = colorIn[1];