We don't want to set the flag for Gallium.
I think only swrast needs the flag to be set for occlusion queries.
v2: fix stats_wm updates in i965
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
const struct brw_tracked_state brw_cc_unit = {
.dirty = {
.mesa = _NEW_STENCIL | _NEW_COLOR | _NEW_DEPTH,
- .brw = BRW_NEW_BATCH,
+ .brw = BRW_NEW_BATCH | BRW_NEW_STATS_WM,
.cache = CACHE_NEW_CC_VP
},
.emit = upload_cc_unit,
BRW_STATE_VUE_MAP_GEOM_OUT,
BRW_STATE_TRANSFORM_FEEDBACK,
BRW_STATE_RASTERIZER_DISCARD,
+ BRW_STATE_STATS_WM,
};
#define BRW_NEW_URB_FENCE (1 << BRW_STATE_URB_FENCE)
#define BRW_NEW_VUE_MAP_GEOM_OUT (1 << BRW_STATE_VUE_MAP_GEOM_OUT)
#define BRW_NEW_TRANSFORM_FEEDBACK (1 << BRW_STATE_TRANSFORM_FEEDBACK)
#define BRW_NEW_RASTERIZER_DISCARD (1 << BRW_STATE_RASTERIZER_DISCARD)
+#define BRW_NEW_STATS_WM (1 << BRW_STATE_STATS_WM)
struct brw_state_flags {
/** State update flags signalled by mesa internals */
* so turn them on now.
*/
intel->stats_wm++;
+ brw->state.dirty.brw |= BRW_NEW_STATS_WM;
break;
case GL_PRIMITIVES_GENERATED:
brw->query.obj = NULL;
intel->stats_wm--;
+ brw->state.dirty.brw |= BRW_NEW_STATS_WM;
break;
case GL_PRIMITIVES_GENERATED:
_NEW_MULTISAMPLE),
.brw = (BRW_NEW_FRAGMENT_PROGRAM |
BRW_NEW_REDUCED_PRIMITIVE |
- BRW_NEW_VUE_MAP_GEOM_OUT)
+ BRW_NEW_VUE_MAP_GEOM_OUT |
+ BRW_NEW_STATS_WM)
},
.emit = brw_upload_wm_prog
};
/* _NEW_LINE */
wm->wm5.line_stipple = ctx->Line.StippleFlag;
- /* _NEW_DEPTH */
+ /* BRW_NEW_STATS_WM */
if (unlikely(INTEL_DEBUG & DEBUG_STATS) || intel->stats_wm)
wm->wm4.stats_enable = 1;
_NEW_POLYGONSTIPPLE |
_NEW_LINE |
_NEW_COLOR |
- _NEW_DEPTH |
_NEW_BUFFERS),
.brw = (BRW_NEW_BATCH |
BRW_NEW_PROGRAM_CACHE |
BRW_NEW_FRAGMENT_PROGRAM |
- BRW_NEW_CURBE_OFFSETS),
+ BRW_NEW_CURBE_OFFSETS |
+ BRW_NEW_STATS_WM),
.cache = (CACHE_NEW_WM_PROG |
CACHE_NEW_SAMPLER)
static void
_mesa_begin_query(struct gl_context *ctx, struct gl_query_object *q)
{
- /* no-op */
+ ctx->NewState |= _NEW_DEPTH; /* for swrast */
}
static void
_mesa_end_query(struct gl_context *ctx, struct gl_query_object *q)
{
+ ctx->NewState |= _NEW_DEPTH; /* for swrast */
q->Ready = GL_TRUE;
}
if (!query_error_check_index(ctx, target, index))
return;
- FLUSH_VERTICES(ctx, _NEW_DEPTH);
+ FLUSH_VERTICES(ctx, 0);
bindpt = get_query_binding_point(ctx, target);
if (!bindpt) {
if (!query_error_check_index(ctx, target, index))
return;
- FLUSH_VERTICES(ctx, _NEW_DEPTH);
+ FLUSH_VERTICES(ctx, 0);
bindpt = get_query_binding_point(ctx, target);
if (!bindpt) {