From c260175677c20ed4f11a6679c45391783d07aaeb Mon Sep 17 00:00:00 2001 From: Nicolai Hähnle Date: Thu, 21 Jan 2016 16:10:11 -0500 Subject: draw: use util_pstipple_* function for stipple pattern textures and samplers This reduces code duplication. Suggested-by: Jose Fonseca Reviewed-by: Brian Paul Reviewed-by: Jose Fonseca --- src/gallium/auxiliary/util/u_pstipple.c | 4 ++-- src/gallium/auxiliary/util/u_pstipple.h | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'src/gallium/auxiliary/util') diff --git a/src/gallium/auxiliary/util/u_pstipple.c b/src/gallium/auxiliary/util/u_pstipple.c index 3428172203b..74e6f99da67 100644 --- a/src/gallium/auxiliary/util/u_pstipple.c +++ b/src/gallium/auxiliary/util/u_pstipple.c @@ -58,7 +58,7 @@ #define NUM_NEW_TOKENS 53 -static void +void util_pstipple_update_stipple_texture(struct pipe_context *pipe, struct pipe_resource *tex, const uint32_t pattern[32]) @@ -118,7 +118,7 @@ util_pstipple_create_stipple_texture(struct pipe_context *pipe, tex = screen->resource_create(screen, &templat); - if (tex) + if (tex && pattern) util_pstipple_update_stipple_texture(pipe, tex, pattern); return tex; diff --git a/src/gallium/auxiliary/util/u_pstipple.h b/src/gallium/auxiliary/util/u_pstipple.h index ef8396f4318..d1662be2839 100644 --- a/src/gallium/auxiliary/util/u_pstipple.h +++ b/src/gallium/auxiliary/util/u_pstipple.h @@ -36,6 +36,11 @@ struct pipe_resource; struct pipe_shader_state; +extern void +util_pstipple_update_stipple_texture(struct pipe_context *pipe, + struct pipe_resource *tex, + const uint32_t pattern[32]); + extern struct pipe_resource * util_pstipple_create_stipple_texture(struct pipe_context *pipe, const uint32_t pattern[32]); -- cgit v1.2.3