llvmpipe: don't interpolate front face or prim id
The loop was iterating over all the fs inputs and setting them to perspective interpolation, then after the loop we were creating extra output slots with the correct interpolation. Instead of injecting bogus extra outputs, just set the interpolation on front face and prim id correctly when doing the initial scan of fs inputs. Signed-off-by: Zack Rusin <zackr@vmware.com> Reviewed-by: Roland Scheidegger <sroland@vmware.com> Reviewed-by: Jose Fonseca <jfonseca@vmware.com> Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
parent
8e77e5e543
commit
bff0d87668
|
@ -69,8 +69,8 @@ compute_vertex_info(struct llvmpipe_context *llvmpipe)
|
||||||
vinfo->num_attribs = 0;
|
vinfo->num_attribs = 0;
|
||||||
|
|
||||||
vs_index = draw_find_shader_output(llvmpipe->draw,
|
vs_index = draw_find_shader_output(llvmpipe->draw,
|
||||||
TGSI_SEMANTIC_POSITION,
|
TGSI_SEMANTIC_POSITION,
|
||||||
0);
|
0);
|
||||||
|
|
||||||
draw_emit_vertex_attr(vinfo, EMIT_4F, INTERP_PERSPECTIVE, vs_index);
|
draw_emit_vertex_attr(vinfo, EMIT_4F, INTERP_PERSPECTIVE, vs_index);
|
||||||
|
|
||||||
|
@ -89,12 +89,18 @@ compute_vertex_info(struct llvmpipe_context *llvmpipe)
|
||||||
llvmpipe->color_slot[idx] = (int)vinfo->num_attribs;
|
llvmpipe->color_slot[idx] = (int)vinfo->num_attribs;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
if (lpfs->info.base.input_semantic_name[i] == TGSI_SEMANTIC_FACE) {
|
||||||
* Emit the requested fs attribute for all but position.
|
llvmpipe->face_slot = vinfo->num_attribs;
|
||||||
*/
|
draw_emit_vertex_attr(vinfo, EMIT_4F, INTERP_CONSTANT, vs_index);
|
||||||
draw_emit_vertex_attr(vinfo, EMIT_4F, INTERP_PERSPECTIVE, vs_index);
|
} else if (lpfs->info.base.input_semantic_name[i] == TGSI_SEMANTIC_PRIMID) {
|
||||||
|
draw_emit_vertex_attr(vinfo, EMIT_4F, INTERP_CONSTANT, vs_index);
|
||||||
|
} else {
|
||||||
|
/*
|
||||||
|
* Emit the requested fs attribute for all but position.
|
||||||
|
*/
|
||||||
|
draw_emit_vertex_attr(vinfo, EMIT_4F, INTERP_PERSPECTIVE, vs_index);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Figure out if we need bcolor as well.
|
/* Figure out if we need bcolor as well.
|
||||||
*/
|
*/
|
||||||
for (i = 0; i < 2; i++) {
|
for (i = 0; i < 2; i++) {
|
||||||
|
@ -140,14 +146,6 @@ compute_vertex_info(struct llvmpipe_context *llvmpipe)
|
||||||
llvmpipe->layer_slot = 0;
|
llvmpipe->layer_slot = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check for a fake front face for unfilled primitives*/
|
|
||||||
vs_index = draw_find_shader_output(llvmpipe->draw,
|
|
||||||
TGSI_SEMANTIC_FACE, 0);
|
|
||||||
if (vs_index >= 0) {
|
|
||||||
llvmpipe->face_slot = vinfo->num_attribs;
|
|
||||||
draw_emit_vertex_attr(vinfo, EMIT_4F, INTERP_CONSTANT, vs_index);
|
|
||||||
}
|
|
||||||
|
|
||||||
draw_compute_vertex_size(vinfo);
|
draw_compute_vertex_size(vinfo);
|
||||||
lp_setup_set_vertex_info(llvmpipe->setup, vinfo);
|
lp_setup_set_vertex_info(llvmpipe->setup, vinfo);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue