include surface.offset in address calculations
[mesa.git] / src / mesa / pipe / softpipe / sp_quad.c
1
2
3 #include "sp_context.h"
4
5
6
7 void
8 sp_build_quad_pipeline(struct softpipe_context *sp)
9 {
10 /* build up the pipeline in reverse order... */
11
12 sp->quad.first = sp->quad.output;
13
14 if (sp->blend.colormask != 0xf) {
15 sp->quad.colormask->next = sp->quad.first;
16 sp->quad.first = sp->quad.colormask;
17 }
18
19 if (sp->blend.blend_enable) {
20 sp->quad.blend->next = sp->quad.first;
21 sp->quad.first = sp->quad.blend;
22 }
23
24 if (sp->framebuffer.num_cbufs == 1) {
25 /* the usual case: write to exactly one colorbuf */
26 sp->cbuf = sp->framebuffer.cbufs[0];
27 }
28 else {
29 /* insert bufloop stage */
30 sp->quad.bufloop->next = sp->quad.first;
31 sp->quad.first = sp->quad.bufloop;
32 }
33
34 if (sp->depth_test.occlusion_count) {
35 sp->quad.occlusion->next = sp->quad.first;
36 sp->quad.first = sp->quad.occlusion;
37 }
38
39 if (sp->setup.poly_smooth ||
40 sp->setup.line_smooth ||
41 sp->setup.point_smooth) {
42 sp->quad.coverage->next = sp->quad.first;
43 sp->quad.first = sp->quad.coverage;
44 }
45
46 if ( sp->stencil.front_enabled
47 || sp->stencil.front_enabled) {
48 sp->quad.stencil_test->next = sp->quad.first;
49 sp->quad.first = sp->quad.stencil_test;
50 }
51 else if (sp->depth_test.enabled) {
52 sp->quad.depth_test->next = sp->quad.first;
53 sp->quad.first = sp->quad.depth_test;
54 }
55
56 if (sp->alpha_test.enabled) {
57 sp->quad.alpha_test->next = sp->quad.first;
58 sp->quad.first = sp->quad.alpha_test;
59 }
60
61 /* XXX always enable shader? */
62 if (1) {
63 sp->quad.shade->next = sp->quad.first;
64 sp->quad.first = sp->quad.shade;
65 }
66
67 if (sp->setup.poly_stipple_enable) {
68 sp->quad.polygon_stipple->next = sp->quad.first;
69 sp->quad.first = sp->quad.polygon_stipple;
70 }
71 }