diff options
author | marha <marha@users.sourceforge.net> | 2013-01-16 08:45:43 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2013-01-16 08:45:43 +0100 |
commit | b8219a4680768e14b7fe4930adf86e9be261b31f (patch) | |
tree | 193855ef8d48765d67cc11153a15e3c1e2568e50 /mesalib/src/gallium/auxiliary/util/u_simple_shaders.c | |
parent | 15cdb95b194cb051a5d469cc9eb73eb0eed4db41 (diff) | |
parent | 811d1bcf6d61ea49551abdd7f2294c5af2776913 (diff) | |
download | vcxsrv-b8219a4680768e14b7fe4930adf86e9be261b31f.tar.gz vcxsrv-b8219a4680768e14b7fe4930adf86e9be261b31f.tar.bz2 vcxsrv-b8219a4680768e14b7fe4930adf86e9be261b31f.zip |
Merge remote-tracking branch 'origin/released'
* origin/released:
Switched to xcalc-1.0.5
Switched to bdftopcf-1.0.4
libxtrans fontconfig glproto libX11 libXau libXext libXft libXinerama libXmu libfontenc mesa xkeyboard-config
Diffstat (limited to 'mesalib/src/gallium/auxiliary/util/u_simple_shaders.c')
-rw-r--r-- | mesalib/src/gallium/auxiliary/util/u_simple_shaders.c | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/mesalib/src/gallium/auxiliary/util/u_simple_shaders.c b/mesalib/src/gallium/auxiliary/util/u_simple_shaders.c index 5f0134d70..7e3666122 100644 --- a/mesalib/src/gallium/auxiliary/util/u_simple_shaders.c +++ b/mesalib/src/gallium/auxiliary/util/u_simple_shaders.c @@ -316,13 +316,39 @@ util_make_fragment_tex_shader_writestencil(struct pipe_context *pipe, /** - * Make simple fragment color pass-through shader. + * Make simple fragment color pass-through shader that replicates OUT[0] + * to all bound colorbuffers. */ void * -util_make_fragment_passthrough_shader(struct pipe_context *pipe) +util_make_fragment_passthrough_shader(struct pipe_context *pipe, + int input_semantic, + int input_interpolate) { - return util_make_fragment_cloneinput_shader(pipe, 1, TGSI_SEMANTIC_COLOR, - TGSI_INTERPOLATE_PERSPECTIVE); + static const char shader_templ[] = + "FRAG\n" + "PROPERTY FS_COLOR0_WRITES_ALL_CBUFS 1\n" + "DCL IN[0], %s[0], %s\n" + "DCL OUT[0], COLOR[0]\n" + + "MOV OUT[0], IN[0]\n" + "END\n"; + + char text[sizeof(shader_templ)+100]; + struct tgsi_token tokens[1000]; + struct pipe_shader_state state = {tokens}; + + sprintf(text, shader_templ, tgsi_semantic_names[input_semantic], + tgsi_interpolate_names[input_interpolate]); + + if (!tgsi_text_translate(text, tokens, Elements(tokens))) { + assert(0); + return NULL; + } +#if 0 + tgsi_dump(state.tokens, 0); +#endif + + return pipe->create_fs_state(pipe, &state); } |