2 #include "brw_context.h"
3 #include "brw_pipe_rast.h"
6 static GLboolean
need_swtnl( struct brw_context
*brw
)
8 const struct pipe_rasterizer_state
*rast
= &brw
->curr
.rast
->templ
;
10 /* If we don't require strict OpenGL conformance, never
11 * use fallbacks. If we're forcing fallbacks, always
14 if (brw
->flags
.no_swtnl
)
17 if (brw
->flags
.force_swtnl
)
20 /* Exceeding hw limits on number of VS inputs?
22 if (brw
->curr
.num_vertex_elements
== 0 ||
23 brw
->curr
.num_vertex_elements
>= BRW_VEP_MAX
) {
27 /* Position array with zero stride?
29 * XXX: position isn't always at zero...
30 * XXX: eliminate zero-stride arrays
33 int ve0_vb
= brw
->curr
.vertex_element
[0].vertex_buffer_index
;
35 if (brw
->curr
.vertex_buffer
[ve0_vb
].stride
== 0)
43 if (brw
->reduced_primitive
== PIPE_PRIM_TRIANGLES
) {
44 if (rast
->poly_smooth
)
49 if (brw
->reduced_primitive
== PIPE_PRIM_LINES
||
50 (brw
->reduced_primitive
== PIPE_PRIM_TRIANGLES
&&
51 (rast
->fill_cw
== PIPE_POLYGON_MODE_LINE
||
52 rast
->fill_ccw
== PIPE_POLYGON_MODE_LINE
)))
54 /* BRW hardware will do AA lines, but they are non-conformant it
55 * seems. TBD whether we keep this fallback:
57 if (rast
->line_smooth
)
60 /* XXX: was a fallback in mesa (gs doesn't get enough
61 * information to know when to reset stipple counter), but there
62 * must be a way around it.
64 if (rast
->line_stipple_enable
&&
65 (brw
->reduced_primitive
== PIPE_PRIM_TRIANGLES
||
66 brw
->primitive
== PIPE_PRIM_LINE_LOOP
||
67 brw
->primitive
== PIPE_PRIM_LINE_STRIP
))
72 if (brw
->reduced_primitive
== PIPE_PRIM_POINTS
||
73 (brw
->reduced_primitive
== PIPE_PRIM_TRIANGLES
&&
74 (rast
->fill_cw
== PIPE_POLYGON_MODE_POINT
||
75 rast
->fill_ccw
== PIPE_POLYGON_MODE_POINT
)))
77 if (rast
->point_smooth
)
81 /* BRW hardware doesn't handle CLAMP texturing correctly;
82 * brw_wm_sampler_state:translate_wrap_mode() treats CLAMP
83 * as CLAMP_TO_EDGE instead. If we're using CLAMP, and
84 * we want strict conformance, force the fallback.
86 * XXX: need a workaround for this.
89 /* Nothing stopping us from the fast path now */