[Mesa-dev] [PATCH 1/2] gallium/hud: initialize sampler state

Marek Olšák maraeo at gmail.com
Thu Apr 4 15:52:29 PDT 2013


It would be better to use PIPE_TEX_WRAP_CLAMP_TO_EDGE. In any case:

Reviewed-by: Marek Olšák <maraeo at gmail.com>

Marek


On Fri, Apr 5, 2013 at 12:38 AM, Brian Paul <brianp at vmware.com> wrote:

> The default wrap mode (PIPE_TEX_WRAP_REPEAT) is incompatible with
> unnormalized texcoords (at least for softpipe).
> ---
>  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..5722df3 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;
> +   hud->font_sampler_state.wrap_t = PIPE_TEX_WRAP_CLAMP;
> +   hud->font_sampler_state.wrap_r = PIPE_TEX_WRAP_CLAMP;
> +   hud->font_sampler_state.normalized_coords = 0;
> +
>     /* constants */
>     hud->constbuf.buffer_size = sizeof(hud->constants);
>     hud->constbuf.user_buffer = &hud->constants;
> --
> 1.7.3.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20130405/68ae0eb5/attachment-0001.html>


More information about the mesa-dev mailing list