struct pipe_stencil_ref stencil_ref;
struct pipe_framebuffer_state framebuffer;
+ /** Are depth writes enabled? (Depth buffer may or may not exist.) */
+ bool depth_writes_enabled;
+
+ /** Are stencil writes enabled? (Stencil buffer may or may not exist.) */
+ bool stencil_writes_enabled;
+
/** GenX-specific current state */
struct iris_genx_state *genx;
/** Outbound to BLEND_STATE, 3DSTATE_PS_BLEND, COLOR_CALC_STATE. */
struct pipe_alpha_state alpha;
+
+ /** Outbound to resolve and cache set tracking. */
+ bool depth_writes_enabled;
+ bool stencil_writes_enabled;
};
/**
struct iris_depth_stencil_alpha_state *cso =
malloc(sizeof(struct iris_depth_stencil_alpha_state));
- cso->alpha = state->alpha;
-
bool two_sided_stencil = state->stencil[1].enabled;
+ cso->alpha = state->alpha;
+ cso->depth_writes_enabled = state->depth.writemask;
+ cso->stencil_writes_enabled =
+ state->stencil[0].writemask != 0 ||
+ (two_sided_stencil && state->stencil[1].writemask != 1);
+
/* The state tracker needs to optimize away EQUAL writes for us. */
assert(!(state->depth.func == PIPE_FUNC_EQUAL && state->depth.writemask));
if (cso_changed(alpha.func))
ice->state.dirty |= IRIS_DIRTY_BLEND_STATE;
+
+ ice->state.depth_writes_enabled = new_cso->depth_writes_enabled;
+ ice->state.stencil_writes_enabled = new_cso->stencil_writes_enabled;
}
ice->state.cso_zsa = new_cso;