float y2diff;
float dx, dy;
float area;
+ const float (*pv)[4];
boolean draw_start;
boolean draw_end;
if (0)
print_line(setup, v1, v2);
- if (setup->scissor_test) {
- nr_planes = 8;
- if (setup->viewport_index_slot > 0) {
- unsigned *udata = (unsigned*)v1[setup->viewport_index_slot];
- viewport_index = lp_clamp_viewport_idx(*udata);
- }
+ if (setup->flatshade_first) {
+ pv = v1;
}
else {
- nr_planes = 4;
+ pv = v2;
+ }
+ if (setup->viewport_index_slot > 0) {
+ unsigned *udata = (unsigned*)pv[setup->viewport_index_slot];
+ viewport_index = lp_clamp_viewport_idx(*udata);
}
-
if (setup->layer_slot > 0) {
- layer = *(unsigned*)v1[setup->layer_slot];
+ layer = *(unsigned*)pv[setup->layer_slot];
layer = MIN2(layer, scene->fb_max_layer);
}
+ if (setup->scissor_test) {
+ nr_planes = 8;
+ }
+ else {
+ nr_planes = 4;
+ }
+
dx = v1[0][0] - v2[0][0];
dy = v1[0][1] - v2[0][1];
area = (dx * dx + dy * dy);
int nr_planes = 3;
unsigned viewport_index = 0;
unsigned layer = 0;
+ const float (*pv)[4];
/* Area should always be positive here */
assert(position->area > 0);
if (0)
lp_setup_print_triangle(setup, v0, v1, v2);
- if (setup->scissor_test) {
- nr_planes = 7;
- if (setup->viewport_index_slot > 0) {
- unsigned *udata = (unsigned*)v0[setup->viewport_index_slot];
- viewport_index = lp_clamp_viewport_idx(*udata);
- }
+ if (setup->flatshade_first) {
+ pv = v0;
}
else {
- nr_planes = 3;
+ pv = v2;
+ }
+ if (setup->viewport_index_slot > 0) {
+ unsigned *udata = (unsigned*)pv[setup->viewport_index_slot];
+ viewport_index = lp_clamp_viewport_idx(*udata);
}
if (setup->layer_slot > 0) {
- layer = *(unsigned*)v1[setup->layer_slot];
+ layer = *(unsigned*)pv[setup->layer_slot];
layer = MIN2(layer, scene->fb_max_layer);
}
+ if (setup->scissor_test) {
+ nr_planes = 7;
+ }
+ else {
+ nr_planes = 3;
+ }
+
/* Bounding rectangle (in pixels) */
{
/* Yes this is necessary to accurately calculate bounding boxes