Mesa (master): gallium/hud: use u_sampler_view_default_template helper

Ilia Mirkin imirkin at kemper.freedesktop.org
Thu Oct 2 16:20:43 UTC 2014


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

Author: Ilia Mirkin <imirkin at alum.mit.edu>
Date:   Wed Oct  1 19:43:38 2014 -0400

gallium/hud: use u_sampler_view_default_template helper

The existing code was not setting several fields, most importantly the
target, which is required on nv50/nvc0.

Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>

---

 src/gallium/auxiliary/hud/hud_context.c |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/gallium/auxiliary/hud/hud_context.c b/src/gallium/auxiliary/hud/hud_context.c
index b6e0184..18a8781 100644
--- a/src/gallium/auxiliary/hud/hud_context.c
+++ b/src/gallium/auxiliary/hud/hud_context.c
@@ -44,6 +44,7 @@
 #include "util/u_inlines.h"
 #include "util/u_memory.h"
 #include "util/u_math.h"
+#include "util/u_sampler.h"
 #include "util/u_simple_shaders.h"
 #include "util/u_string.h"
 #include "util/u_upload_mgr.h"
@@ -1050,12 +1051,8 @@ hud_create(struct pipe_context *pipe, struct cso_context *cso)
    }
 
    /* sampler view */
-   memset(&view_templ, 0, sizeof(view_templ));
-   view_templ.format = hud->font.texture->format;
-   view_templ.swizzle_r = PIPE_SWIZZLE_RED;
-   view_templ.swizzle_g = PIPE_SWIZZLE_GREEN;
-   view_templ.swizzle_b = PIPE_SWIZZLE_BLUE;
-   view_templ.swizzle_a = PIPE_SWIZZLE_ALPHA;
+   u_sampler_view_default_template(
+         &view_templ, hud->font.texture, hud->font.texture->format);
    hud->font_sampler_view = pipe->create_sampler_view(pipe, hud->font.texture,
                                                       &view_templ);
 




More information about the mesa-commit mailing list