glsl2: Add and use new variable mode ir_var_temporary
[mesa/nouveau-pmpeg.git] / src / gallium / drivers / i965 / brw_swtnl.c
blobf96301e99e6d04896c8207f051b513abc511401b
2 #include "brw_context.h"
3 #include "brw_pipe_rast.h"
6 #if 0
8 static GLboolean need_swtnl( struct brw_context *brw )
10 const struct pipe_rasterizer_state *rast = &brw->curr.rast->templ;
12 /* If we don't require strict OpenGL conformance, never
13 * use fallbacks. If we're forcing fallbacks, always
14 * use fallfacks.
16 if (brw->flags.no_swtnl)
17 return FALSE;
19 if (brw->flags.force_swtnl)
20 return TRUE;
22 /* Exceeding hw limits on number of VS inputs?
24 if (brw->curr.num_vertex_elements == 0 ||
25 brw->curr.num_vertex_elements >= BRW_VEP_MAX) {
26 return TRUE;
29 /* Position array with zero stride?
31 * XXX: position isn't always at zero...
32 * XXX: eliminate zero-stride arrays
35 int ve0_vb = brw->curr.vertex_element[0].vertex_buffer_index;
37 if (brw->curr.vertex_buffer[ve0_vb].stride == 0)
38 return TRUE;
41 /* XXX: short-circuit
43 return FALSE;
45 if (brw->reduced_primitive == PIPE_PRIM_TRIANGLES) {
46 if (rast->poly_smooth)
47 return TRUE;
51 if (brw->reduced_primitive == PIPE_PRIM_LINES ||
52 (brw->reduced_primitive == PIPE_PRIM_TRIANGLES &&
53 (rast->fill_cw == PIPE_POLYGON_MODE_LINE ||
54 rast->fill_ccw == PIPE_POLYGON_MODE_LINE)))
56 /* BRW hardware will do AA lines, but they are non-conformant it
57 * seems. TBD whether we keep this fallback:
59 if (rast->line_smooth)
60 return TRUE;
62 /* XXX: was a fallback in mesa (gs doesn't get enough
63 * information to know when to reset stipple counter), but there
64 * must be a way around it.
66 if (rast->line_stipple_enable &&
67 (brw->reduced_primitive == PIPE_PRIM_TRIANGLES ||
68 brw->primitive == PIPE_PRIM_LINE_LOOP ||
69 brw->primitive == PIPE_PRIM_LINE_STRIP))
70 return TRUE;
74 if (brw->reduced_primitive == PIPE_PRIM_POINTS ||
75 (brw->reduced_primitive == PIPE_PRIM_TRIANGLES &&
76 (rast->fill_cw == PIPE_POLYGON_MODE_POINT ||
77 rast->fill_ccw == PIPE_POLYGON_MODE_POINT)))
79 if (rast->point_smooth)
80 return TRUE;
83 /* BRW hardware doesn't handle CLAMP texturing correctly;
84 * brw_wm_sampler_state:translate_wrap_mode() treats CLAMP
85 * as CLAMP_TO_EDGE instead. If we're using CLAMP, and
86 * we want strict conformance, force the fallback.
88 * XXX: need a workaround for this.
91 /* Nothing stopping us from the fast path now */
92 return FALSE;
95 #endif