Module: Mesa
Branch: master
Commit: 6211c45186745e58e7722f33562c028d4fe2cee3
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=6211c45186745e58e7722f33562c028d4fe2cee3

Author: Brian Paul <bri...@vmware.com>
Date:   Thu Apr  4 16:24:40 2013 -0600

gallium/hud: initialize sampler state

The default wrap mode (PIPE_TEX_WRAP_REPEAT) is incompatible with
unnormalized texcoords (at least for softpipe).

v2: use PIPE_TEX_WRAP_CLAMP_TO_EDGE

Reviewed-by: Marek Olšák <mar...@gmail.com>

---

 src/gallium/auxiliary/hud/hud_context.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/gallium/auxiliary/hud/hud_context.c 
b/src/gallium/auxiliary/hud/hud_context.c
index b417f5d..bbefdd2 100644
--- a/src/gallium/auxiliary/hud/hud_context.c
+++ b/src/gallium/auxiliary/hud/hud_context.c
@@ -1018,6 +1018,12 @@ hud_create(struct pipe_context *pipe, struct cso_context 
*cso)
    hud->font_sampler_view = pipe->create_sampler_view(pipe, hud->font.texture,
                                                       &view_templ);
 
+   /* sampler state (for font drawing) */
+   hud->font_sampler_state.wrap_s = PIPE_TEX_WRAP_CLAMP_TO_EDGE;
+   hud->font_sampler_state.wrap_t = PIPE_TEX_WRAP_CLAMP_TO_EDGE;
+   hud->font_sampler_state.wrap_r = PIPE_TEX_WRAP_CLAMP_TO_EDGE;
+   hud->font_sampler_state.normalized_coords = 0;
+
    /* constants */
    hud->constbuf.buffer_size = sizeof(hud->constants);
    hud->constbuf.user_buffer = &hud->constants;

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to