summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/util
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2013-05-29 14:11:58 +0200
committerMarek Olšák <[email protected]>2013-06-13 03:54:13 +0200
commitde1c38299ceb3160ed0c163d4dd8944ec6589a7f (patch)
tree44ae0b0e88815cc1725ee35883c7964da13fe094 /src/gallium/auxiliary/util
parent45595d506646f560ab16af58acdea2fc563e942b (diff)
gallium/util: make WRITES_ALL_CBUFS optional in the passthrough fragment shader
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/util')
-rw-r--r--src/gallium/auxiliary/util/u_simple_shaders.c9
-rw-r--r--src/gallium/auxiliary/util/u_simple_shaders.h3
2 files changed, 8 insertions, 4 deletions
diff --git a/src/gallium/auxiliary/util/u_simple_shaders.c b/src/gallium/auxiliary/util/u_simple_shaders.c
index c53c2d024fb..6ca073dbc46 100644
--- a/src/gallium/auxiliary/util/u_simple_shaders.c
+++ b/src/gallium/auxiliary/util/u_simple_shaders.c
@@ -322,11 +322,12 @@ util_make_fragment_tex_shader_writestencil(struct pipe_context *pipe,
void *
util_make_fragment_passthrough_shader(struct pipe_context *pipe,
int input_semantic,
- int input_interpolate)
+ int input_interpolate,
+ boolean write_all_cbufs)
{
static const char shader_templ[] =
"FRAG\n"
- "PROPERTY FS_COLOR0_WRITES_ALL_CBUFS 1\n"
+ "%s"
"DCL IN[0], %s[0], %s\n"
"DCL OUT[0], COLOR[0]\n"
@@ -337,7 +338,9 @@ util_make_fragment_passthrough_shader(struct pipe_context *pipe,
struct tgsi_token tokens[1000];
struct pipe_shader_state state = {tokens};
- sprintf(text, shader_templ, tgsi_semantic_names[input_semantic],
+ sprintf(text, shader_templ,
+ write_all_cbufs ? "PROPERTY FS_COLOR0_WRITES_ALL_CBUFS 1\n" : "",
+ tgsi_semantic_names[input_semantic],
tgsi_interpolate_names[input_interpolate]);
if (!tgsi_text_translate(text, tokens, Elements(tokens))) {
diff --git a/src/gallium/auxiliary/util/u_simple_shaders.h b/src/gallium/auxiliary/util/u_simple_shaders.h
index 22b9cee4de6..06da2490ec7 100644
--- a/src/gallium/auxiliary/util/u_simple_shaders.h
+++ b/src/gallium/auxiliary/util/u_simple_shaders.h
@@ -89,7 +89,8 @@ util_make_fragment_tex_shader_writestencil(struct pipe_context *pipe,
extern void *
util_make_fragment_passthrough_shader(struct pipe_context *pipe,
int input_semantic,
- int input_interpolate);
+ int input_interpolate,
+ boolean write_all_cbufs);
extern void *