2 #include "brw_context.h"
3 #include "brw_pipe_rast.h"
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
16 if (brw
->flags
.no_swtnl
)
19 if (brw
->flags
.force_swtnl
)
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
) {
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)
45 if (brw
->reduced_primitive
== PIPE_PRIM_TRIANGLES
) {
46 if (rast
->poly_smooth
)
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
)
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
))
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
)
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 */