summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/util
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2016-01-21 16:10:11 -0500
committerNicolai Hähnle <[email protected]>2016-02-09 10:01:57 -0500
commitc260175677c20ed4f11a6679c45391783d07aaeb (patch)
tree7ea8b8351a90f3ae00c3653361647551b4377842 /src/gallium/auxiliary/util
parent452e51bf1ea6d6896f944192d40547f334f09676 (diff)
draw: use util_pstipple_* function for stipple pattern textures and samplers
This reduces code duplication. Suggested-by: Jose Fonseca <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/util')
-rw-r--r--src/gallium/auxiliary/util/u_pstipple.c4
-rw-r--r--src/gallium/auxiliary/util/u_pstipple.h5
2 files changed, 7 insertions, 2 deletions
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]);