[Mesa-dev] [PATCH] st/mesa: fix texture border color for RED and RG base formats

Brian Paul brianp at vmware.com
Mon Nov 29 06:55:33 PST 2010


On 11/28/2010 10:16 PM, Marek Olšák wrote:
> The spec says the border color should be consistent with the internal
> format.
> ---
>   src/mesa/state_tracker/st_atom_sampler.c |   12 ++++++++++++
>   1 files changed, 12 insertions(+), 0 deletions(-)
>
> diff --git a/src/mesa/state_tracker/st_atom_sampler.c b/src/mesa/state_tracker/st_atom_sampler.c
> index f147d76..b67068d 100644
> --- a/src/mesa/state_tracker/st_atom_sampler.c
> +++ b/src/mesa/state_tracker/st_atom_sampler.c
> @@ -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];

Signed-off-by: Brian Paul <brianp at vmware.com>



More information about the mesa-dev mailing list