return prim_to_hw_prim[mode];
}
+static GLuint gen6_set_prim(struct brw_context *brw,
+ const struct _mesa_prim *prim)
+{
+ DBG("PRIM: %s\n", _mesa_lookup_enum_by_nr(prim->mode));
+
+ if (prim->mode != brw->primitive) {
+ brw->primitive = prim->mode;
+ brw->state.dirty.brw |= BRW_NEW_PRIMITIVE;
+ }
+
+ return prim_to_hw_prim[mode];
+}
+
static GLuint trim(GLenum prim, GLuint length)
{
OUT_BATCH(base_vertex_location);
ADVANCE_BATCH();
+ intel->batch.need_workaround_flush = true;
+
if (intel->always_flush_cache) {
intel_batchbuffer_emit_mi_flush(intel);
}
brw->state.dirty.brw |= BRW_NEW_INPUT_DIMENSIONS;
}
-/* XXX: could split the primitive list to fallback only on the
- * non-conformant primitives.
- */
-static GLboolean check_fallbacks( struct brw_context *brw,
- const struct _mesa_prim *prim,
- GLuint nr_prims )
-{
- struct gl_context *ctx = &brw->intel.ctx;
- GLuint i;
-
- /* If we don't require strict OpenGL conformance, never
- * use fallbacks. If we're forcing fallbacks, always
- * use fallfacks.
- */
- if (brw->intel.conformance_mode == 0)
- return GL_FALSE;
-
- if (brw->intel.conformance_mode == 2)
- return GL_TRUE;
-
- if (ctx->Polygon.SmoothFlag) {
- for (i = 0; i < nr_prims; i++)
- if (reduced_prim[prim[i].mode] == GL_TRIANGLES)
- return GL_TRUE;
- }
-
- /* BRW hardware will do AA lines, but they are non-conformant it
- * seems. TBD whether we keep this fallback:
- */
- if (ctx->Line.SmoothFlag) {
- for (i = 0; i < nr_prims; i++)
- if (reduced_prim[prim[i].mode] == GL_LINES)
- return GL_TRUE;
- }
-
- /* Stipple -- these fallbacks could be resolved with a little
- * bit of work?
- */
- if (ctx->Line.StippleFlag) {
- for (i = 0; i < nr_prims; i++) {
- /* GS doesn't get enough information to know when to reset
- * the stipple counter?!?
- */
- if (prim[i].mode == GL_LINE_LOOP || prim[i].mode == GL_LINE_STRIP)
- return GL_TRUE;
-
- if (prim[i].mode == GL_POLYGON &&
- (ctx->Polygon.FrontMode == GL_LINE ||
- ctx->Polygon.BackMode == GL_LINE))
- return GL_TRUE;
- }
- }
-
- if (ctx->Point.SmoothFlag) {
- for (i = 0; i < nr_prims; i++)
- if (prim[i].mode == GL_POINTS)
- return GL_TRUE;
- }
-
- /* Nothing stopping us from the fast path now */
- return GL_FALSE;
-}
-
/* May fail if out of video memory for texture or vbo upload, or on
* fallback conditions.
*/
*/
brw_validate_textures( brw );
- if (check_fallbacks(brw, prim, nr_prims))
- return GL_FALSE;
-
/* Bind all inputs, derive varying and size information:
*/
brw_merge_inputs( brw, arrays );
*/
intel_batchbuffer_require_space(intel, estimated_max_prim_size, false);
- hw_prim = brw_set_prim(brw, &prim[i]);
+ if (intel->gen < 6)
+ hw_prim = brw_set_prim(brw, &prim[i]);
+ else
+ hw_prim = gen6_set_prim(brw, &prim[i]);
+
if (brw->state.dirty.brw) {
brw_validate_state(brw);
*/
if (!retval) {
_swsetup_Wakeup(ctx);
+ _tnl_wakeup(ctx);
_tnl_draw_prims(ctx, arrays, prim, nr_prims, ib, min_index, max_index);
}