hud->fs_color =
util_make_fragment_passthrough_shader(pipe,
TGSI_SEMANTIC_COLOR,
- TGSI_INTERPOLATE_CONSTANT);
+ TGSI_INTERPOLATE_CONSTANT,
+ TRUE);
{
/* Read a texture and do .xxxx swizzling. */
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"
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))) {
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 *
switch (id) {
case RENDERER_FS_COLOR:
fs = util_make_fragment_passthrough_shader(r->pipe,
- TGSI_SEMANTIC_COLOR, TGSI_INTERPOLATE_PERSPECTIVE);
+ TGSI_SEMANTIC_COLOR, TGSI_INTERPOLATE_PERSPECTIVE,
+ TRUE);
break;
case RENDERER_FS_TEXTURE:
fs = util_make_fragment_tex_shader(r->pipe,
/* fragment shader */
p->fs = util_make_fragment_passthrough_shader(p->pipe,
- TGSI_SEMANTIC_COLOR, TGSI_INTERPOLATE_PERSPECTIVE);
+ TGSI_SEMANTIC_COLOR, TGSI_INTERPOLATE_PERSPECTIVE, TRUE);
}
static void close_prog(struct program *p)
if (!st->passthrough_fs) {
st->passthrough_fs =
util_make_fragment_passthrough_shader(st->pipe, TGSI_SEMANTIC_COLOR,
- TGSI_INTERPOLATE_PERSPECTIVE);
+ TGSI_INTERPOLATE_PERSPECTIVE,
+ TRUE);
}
return st->passthrough_fs;
if (!st->clear.fs)
st->clear.fs =
util_make_fragment_passthrough_shader(st->pipe, TGSI_SEMANTIC_GENERIC,
- TGSI_INTERPOLATE_CONSTANT);
+ TGSI_INTERPOLATE_CONSTANT,
+ TRUE);
cso_set_fragment_shader_handle(st->cso_context, st->clear.fs);
}