Draw can do it just fine.
vs->state.tokens = tgsi_dup_tokens(shader->tokens);
if (r300->screen->caps.has_tcl) {
- r300_init_vs_outputs(vs);
+ r300_init_vs_outputs(r300, vs);
r300_translate_vertex_shader(r300, vs);
} else {
- r300_draw_init_vertex_shader(r300->draw, vs);
+ r300_draw_init_vertex_shader(r300, vs);
}
return vs;
/* Convert info about VS output semantics into r300_shader_semantics. */
static void r300_shader_read_vs_outputs(
+ struct r300_context *r300,
struct tgsi_shader_info* info,
struct r300_shader_semantics* vs_outputs)
{
fprintf(stderr, "r300 VP: cannot handle edgeflag output.\n");
break;
+ case TGSI_SEMANTIC_CLIPVERTEX:
+ assert(index == 0);
+ /* Draw does clip vertex for us. */
+ if (r300->screen->caps.has_tcl) {
+ fprintf(stderr, "r300 VP: cannot handle clip vertex output.\n");
+ }
+ break;
+
default:
fprintf(stderr, "r300 VP: unknown vertex output semantic: %i.\n",
info->output_semantic_name[i]);
c->code->outputs[outputs->wpos] = reg++;
}
-void r300_init_vs_outputs(struct r300_vertex_shader *vs)
+void r300_init_vs_outputs(struct r300_context *r300,
+ struct r300_vertex_shader *vs)
{
tgsi_scan_shader(vs->state.tokens, &vs->info);
- r300_shader_read_vs_outputs(&vs->info, &vs->outputs);
+ r300_shader_read_vs_outputs(r300, &vs->info, &vs->outputs);
}
static void r300_dummy_vertex_shader(
ureg_destroy(ureg);
shader->dummy = TRUE;
- r300_init_vs_outputs(shader);
+ r300_init_vs_outputs(r300, shader);
r300_translate_vertex_shader(r300, shader);
}
void *draw_vs;
};
-void r300_init_vs_outputs(struct r300_vertex_shader *vs);
+void r300_init_vs_outputs(struct r300_context *r300,
+ struct r300_vertex_shader *vs);
void r300_translate_vertex_shader(struct r300_context *r300,
struct r300_vertex_shader *vs);
-void r300_draw_init_vertex_shader(struct draw_context *draw,
+void r300_draw_init_vertex_shader(struct r300_context *r300,
struct r300_vertex_shader *vs);
#endif /* R300_VS_H */
ctx->emit_instruction(ctx, inst);
}
-void r300_draw_init_vertex_shader(struct draw_context *draw,
+void r300_draw_init_vertex_shader(struct r300_context *r300,
struct r300_vertex_shader *vs)
{
+ struct draw_context *draw = r300->draw;
struct pipe_shader_state new_vs;
struct vs_transform_context transform;
const uint newLen = tgsi_num_tokens(vs->state.tokens) + 100 /* XXX */;
vs->state.tokens = new_vs.tokens;
/* Init the VS output table for the rasterizer. */
- r300_init_vs_outputs(vs);
+ r300_init_vs_outputs(r300, vs);
/* Make the last generic be WPOS. */
vs->outputs.wpos = vs->outputs.generic[transform.last_generic + 1];