aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_atom_sampler.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2012-10-15 03:55:23 +0200
committerMarek Olšák <[email protected]>2012-10-15 16:04:09 +0200
commit2bbd307fa638f6d256d020ddf1cff5fc7f735fd2 (patch)
treedf24d603b4c95e371d5c3ec4164a55607722dc77 /src/mesa/state_tracker/st_atom_sampler.c
parent1ec12c53ba71622dc5dcf62c23972aa539792ccb (diff)
st/mesa: fix integer texture border color for some formats (v2)
And the clear color too, though that may be an issue only with GL_RGB if it's actually RGBA in the driver. NOTE: This is a candidate for the stable branches. Reviewed-by: Brian Paul <[email protected]> v2: The types of st_translate_color parameters were changed to gl_color_union and pipe_color_union as per Brian's comment.
Diffstat (limited to 'src/mesa/state_tracker/st_atom_sampler.c')
-rw-r--r--src/mesa/state_tracker/st_atom_sampler.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/mesa/state_tracker/st_atom_sampler.c b/src/mesa/state_tracker/st_atom_sampler.c
index adcc7b50547..3eba5b13cae 100644
--- a/src/mesa/state_tracker/st_atom_sampler.c
+++ b/src/mesa/state_tracker/st_atom_sampler.c
@@ -34,6 +34,7 @@
#include "main/macros.h"
#include "main/mtypes.h"
+#include "main/glformats.h"
#include "main/samplerobj.h"
#include "main/texobj.h"
@@ -172,12 +173,17 @@ convert_sampler(struct st_context *st,
msamp->BorderColor.ui[2] ||
msamp->BorderColor.ui[3]) {
struct gl_texture_image *teximg;
+ GLboolean is_integer = GL_FALSE;
teximg = texobj->Image[0][texobj->BaseLevel];
- st_translate_color(msamp->BorderColor.f,
- teximg ? teximg->_BaseFormat : GL_RGBA,
- sampler->border_color.f);
+ if (teximg) {
+ is_integer = _mesa_is_enum_format_integer(teximg->InternalFormat);
+ }
+
+ st_translate_color(&msamp->BorderColor,
+ &sampler->border_color,
+ teximg ? teximg->_BaseFormat : GL_RGBA, is_integer);
}
sampler->max_anisotropy = (msamp->MaxAnisotropy == 1.0 ?