#define SHADER_TIME_STRIDE 64
enum brw_cache_id {
- BRW_BLEND_STATE,
BRW_DEPTH_STENCIL_STATE,
BRW_COLOR_CALC_STATE,
BRW_CC_VP,
/* Flags for brw->state.cache.
*/
-#define CACHE_NEW_BLEND_STATE (1<<BRW_BLEND_STATE)
#define CACHE_NEW_DEPTH_STENCIL_STATE (1<<BRW_DEPTH_STENCIL_STATE)
#define CACHE_NEW_COLOR_CALC_STATE (1<<BRW_COLOR_CALC_STATE)
#define CACHE_NEW_CC_VP (1<<BRW_CC_VP)
extern const struct brw_tracked_state gen6_wm_push_constants;
extern const struct brw_tracked_state gen6_wm_state;
extern const struct brw_tracked_state gen7_depthbuffer;
-extern const struct brw_tracked_state gen7_blend_state_pointer;
extern const struct brw_tracked_state gen7_cc_state_pointer;
extern const struct brw_tracked_state gen7_cc_viewport_state_pointer;
extern const struct brw_tracked_state gen7_clip_state;
&gen6_blend_state, /* must do before cc unit */
&gen6_color_calc_state, /* must do before cc unit */
&gen6_depth_stencil_state, /* must do before cc unit */
- &gen7_blend_state_pointer,
&gen7_cc_state_pointer,
&gen7_depth_stencil_state_pointer,
};
static struct dirty_bit_map cache_bits[] = {
- DEFINE_BIT(CACHE_NEW_BLEND_STATE),
DEFINE_BIT(CACHE_NEW_DEPTH_STENCIL_STATE),
DEFINE_BIT(CACHE_NEW_COLOR_CALC_STATE),
DEFINE_BIT(CACHE_NEW_CC_VP),
gen6_upload_blend_state(struct brw_context *brw)
{
bool is_buffer_zero_integer_format = false;
+ struct intel_context *intel = &brw->intel;
struct gl_context *ctx = &brw->intel.ctx;
struct gen6_blend_state *blend;
int b;
}
}
- brw->state.dirty.cache |= CACHE_NEW_BLEND_STATE;
+ /* Point the GPU at the new indirect state. */
+ if (intel->gen == 6) {
+ BEGIN_BATCH(4);
+ OUT_BATCH(_3DSTATE_CC_STATE_POINTERS << 16 | (4 - 2));
+ OUT_BATCH(brw->cc.blend_state_offset | 1);
+ OUT_BATCH(0);
+ OUT_BATCH(0);
+ ADVANCE_BATCH();
+ } else {
+ BEGIN_BATCH(2);
+ OUT_BATCH(_3DSTATE_BLEND_STATE_POINTERS << 16 | (2 - 2));
+ OUT_BATCH(brw->cc.blend_state_offset | 1);
+ ADVANCE_BATCH();
+ }
}
const struct brw_tracked_state gen6_blend_state = {
.mesa = (_NEW_COLOR |
_NEW_BUFFERS |
_NEW_MULTISAMPLE),
- .brw = BRW_NEW_BATCH,
+ .brw = BRW_NEW_BATCH | BRW_NEW_STATE_BASE_ADDRESS,
.cache = 0,
},
.emit = gen6_upload_blend_state,
BEGIN_BATCH(4);
OUT_BATCH(_3DSTATE_CC_STATE_POINTERS << 16 | (4 - 2));
- OUT_BATCH(brw->cc.blend_state_offset | 1);
+ OUT_BATCH(0);
OUT_BATCH(brw->cc.depth_stencil_state_offset | 1);
OUT_BATCH(brw->cc.state_offset | 1);
ADVANCE_BATCH();
.mesa = 0,
.brw = (BRW_NEW_BATCH |
BRW_NEW_STATE_BASE_ADDRESS),
- .cache = (CACHE_NEW_BLEND_STATE |
- CACHE_NEW_COLOR_CALC_STATE |
+ .cache = (CACHE_NEW_COLOR_CALC_STATE |
CACHE_NEW_DEPTH_STENCIL_STATE)
},
.emit = upload_cc_state_pointers,
.emit = upload_cc_state_pointers,
};
-static void
-upload_blend_state_pointer(struct brw_context *brw)
-{
- struct intel_context *intel = &brw->intel;
-
- BEGIN_BATCH(2);
- OUT_BATCH(_3DSTATE_BLEND_STATE_POINTERS << 16 | (2 - 2));
- OUT_BATCH(brw->cc.blend_state_offset | 1);
- ADVANCE_BATCH();
-}
-
-const struct brw_tracked_state gen7_blend_state_pointer = {
- .dirty = {
- .mesa = 0,
- .brw = BRW_NEW_BATCH,
- .cache = CACHE_NEW_BLEND_STATE
- },
- .emit = upload_blend_state_pointer,
-};
-
static void
upload_depth_stencil_state_pointer(struct brw_context *brw)
{