r300-gallium: A handful of fixups.
This commit is contained in:
@@ -97,6 +97,7 @@ static void r300_destroy_context(struct pipe_context* context) {
|
||||
draw_destroy(r300->draw);
|
||||
|
||||
FREE(r300->blend_color_state);
|
||||
FREE(r300->rs_block);
|
||||
FREE(r300->scissor_state);
|
||||
FREE(r300);
|
||||
}
|
||||
@@ -126,6 +127,7 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen,
|
||||
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);
|
||||
|
||||
@@ -83,6 +83,7 @@ static void r300_update_vertex_layout(struct r300_context* r300)
|
||||
break;
|
||||
case TGSI_SEMANTIC_FOG:
|
||||
fog = TRUE;
|
||||
tab[i] = 6 + texs++;
|
||||
break;
|
||||
case TGSI_SEMANTIC_PSIZE:
|
||||
psize = TRUE;
|
||||
@@ -110,6 +111,11 @@ static void r300_update_vertex_layout(struct r300_context* r300)
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -131,13 +137,6 @@ static void r300_update_vertex_layout(struct r300_context* r300)
|
||||
vinfo.hwfmt[2] |= (R300_VAP_OUTPUT_VTX_FMT_0__COLOR_0_PRESENT << i);
|
||||
}
|
||||
|
||||
if (fog) {
|
||||
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);
|
||||
}
|
||||
|
||||
for (i = 0; i < texs; i++) {
|
||||
draw_emit_vertex_attr(&vinfo, EMIT_4F, INTERP_PERSPECTIVE,
|
||||
draw_find_vs_output(r300->draw, TGSI_SEMANTIC_GENERIC, i));
|
||||
@@ -145,6 +144,14 @@ static void r300_update_vertex_layout(struct r300_context* r300)
|
||||
vinfo.hwfmt[3] |= (4 << (3 * i));
|
||||
}
|
||||
|
||||
if (fog) {
|
||||
i++;
|
||||
draw_emit_vertex_attr(&vinfo, EMIT_4F, INTERP_PERSPECTIVE,
|
||||
draw_find_vs_output(r300->draw, TGSI_SEMANTIC_FOG, 0));
|
||||
vinfo.hwfmt[1] |= (R300_INPUT_CNTL_TC0 << i);
|
||||
vinfo.hwfmt[3] |= (4 << (3 * i));
|
||||
}
|
||||
|
||||
draw_compute_vertex_size(&vinfo);
|
||||
|
||||
if (memcmp(&r300->vertex_info, &vinfo, sizeof(struct vertex_info))) {
|
||||
@@ -159,7 +166,15 @@ static void r300_update_vertex_layout(struct r300_context* r300)
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user