draw_destroy(r300->draw);
FREE(r300->blend_color_state);
+ FREE(r300->rs_block);
FREE(r300->scissor_state);
FREE(r300);
}
draw_set_rasterize_stage(r300->draw, r300_draw_swtcl_stage(r300));
r300->blend_color_state = CALLOC_STRUCT(r300_blend_color_state);
+ r300->rs_block = CALLOC_STRUCT(r300_rs_block);
r300->scissor_state = CALLOC_STRUCT(r300_scissor_state);
r300_init_flush_functions(r300);
break;
case TGSI_SEMANTIC_FOG:
fog = TRUE;
+ tab[i] = 6 + texs++;
break;
case TGSI_SEMANTIC_PSIZE:
psize = TRUE;
if (!pos) {
debug_printf("r300: Forcing vertex position attribute emit...\n");
+ /* Make room for the position attribute
+ * at the beginning of the tab. */
+ for (i = 1; i < 16; i++) {
+ tab[i] = tab[i-1];
+ }
tab[0] = 0;
}
vinfo.hwfmt[2] |= (R300_VAP_OUTPUT_VTX_FMT_0__COLOR_0_PRESENT << i);
}
- if (fog) {
+ for (i = 0; i < texs; i++) {
draw_emit_vertex_attr(&vinfo, EMIT_4F, INTERP_PERSPECTIVE,
- draw_find_vs_output(r300->draw, TGSI_SEMANTIC_FOG, 0));
- vinfo.hwfmt[2] |=
- (R300_VAP_OUTPUT_VTX_FMT_0__COLOR_0_PRESENT << cols);
+ draw_find_vs_output(r300->draw, TGSI_SEMANTIC_GENERIC, i));
+ vinfo.hwfmt[1] |= (R300_INPUT_CNTL_TC0 << i);
+ vinfo.hwfmt[3] |= (4 << (3 * i));
}
- for (i = 0; i < texs; i++) {
+ if (fog) {
+ i++;
draw_emit_vertex_attr(&vinfo, EMIT_4F, INTERP_PERSPECTIVE,
- draw_find_vs_output(r300->draw, TGSI_SEMANTIC_GENERIC, i));
+ draw_find_vs_output(r300->draw, TGSI_SEMANTIC_FOG, 0));
vinfo.hwfmt[1] |= (R300_INPUT_CNTL_TC0 << i);
vinfo.hwfmt[3] |= (4 << (3 * i));
}
for (i = 0; i < vinfo.num_attribs; i++) {
/* Make sure we have a proper destination for our attribute */
- if (tab[i] != -1) {
+ if (tab[i] == -1) {
+ debug_printf("attrib count: %d, fp input count: %d\n",
+ vinfo.num_attribs, info->num_inputs);
+ for (i = 0; i < vinfo.num_attribs; i++) {
+ debug_printf("attrib: offset %d, interp %d, size %d,"
+ " tab %d\n", vinfo.attrib[i].src_index,
+ vinfo.attrib[i].interp_mode, vinfo.attrib[i].emit,
+ tab[i]);
+ }
assert(0);
}