OSDN Git Service

i965: Emit the BLEND_STATE pointer directly rather than via atoms.
authorKenneth Graunke <kenneth@whitecape.org>
Sat, 8 Jun 2013 19:58:17 +0000 (12:58 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 11 Jun 2013 22:42:16 +0000 (15:42 -0700)
commitda1a896b0f95611e506df46e37a8d2b07e1ddd78
tree5be2ce02c80afe3dcece81a4eea77c7561d986e6
parentbabe35a067d1610d9032cc28eec8e16b18685621
i965: Emit the BLEND_STATE pointer directly rather than via atoms.

Previously, we would:
1. Emit the new indirect state.
2. Flag CACHE_NEW_BLEND_STATE.
3. Rely on later state atoms to notice CACHE_NEW_BLEND_STATE and emit a
   pointer to the new indirect state.

This is rather cumbersome: it requires two state atoms instead of one,
and there's a strict ordering dependency in the list.  Plus, the code
gets spread across two functions (or even files in the case of Gen7+).

Gen7+ has a packet to update just the blend state pointer, so it makes a
lot of sense to simply emit that right away.  Gen6 has a combined packet
which updates blending, the color calculator, and depth/stencil state;
however, each can still be modified independently.

This drops the Gen6 micro-optimization where we tried to only emit one
packet that changed all three states.  State updates are pretty cheap.

CACHE_NEW_BLEND_STATE is no longer necessary, so drop it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_context.h
src/mesa/drivers/dri/i965/brw_state.h
src/mesa/drivers/dri/i965/brw_state_upload.c
src/mesa/drivers/dri/i965/gen6_cc.c
src/mesa/drivers/dri/i965/gen7_cc_state.c