r300g: Make invariant state into an atom.

This commit is contained in:
Corbin Simpson 2010-01-19 17:56:12 -08:00
parent 5e8240320a
commit fcbd285e42
5 changed files with 7 additions and 4 deletions

View File

@ -129,6 +129,7 @@ static void r300_setup_atoms(struct r300_context* r300)
* an upper bound on each atom, to keep the emission machinery from
* underallocating space. */
make_empty_list(&r300->atom_list);
R300_INIT_ATOM(invariant, 73);
R300_INIT_ATOM(ztop, 2);
R300_INIT_ATOM(blend, 8);
R300_INIT_ATOM(blend_color, 3);
@ -208,7 +209,7 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen,
r300_init_state_functions(r300);
r300_emit_invariant_state(r300);
r300->invariant_state.dirty = TRUE;
r300->winsys->set_flush_cb(r300->winsys, r300_flush_cb, r300);
r300->dirty_state = R300_NEW_KITCHEN_SINK;

View File

@ -313,6 +313,9 @@ struct r300_context {
/* ZTOP state. */
struct r300_atom ztop_state;
/* Invariant state. This must be emitted to get the engine started. */
struct r300_atom invariant_state;
/* Vertex buffers for Gallium. */
struct pipe_vertex_buffer vertex_buffer[PIPE_MAX_ATTRIBS];
int vertex_buffer_count;

View File

@ -53,7 +53,6 @@ static void r300_flush(struct pipe_context* pipe,
if (r300->dirty_hw) {
FLUSH_CS;
r300_emit_invariant_state(r300);
r300->dirty_state = R300_NEW_KITCHEN_SINK;
r300->dirty_hw = 0;

View File

@ -38,7 +38,7 @@ struct pipe_viewport_state r300_viewport_identity = {
*
* Note that eventually this should be empty, but it's useful for development
* and general unduplication of code. */
void r300_emit_invariant_state(struct r300_context* r300)
void r300_emit_invariant_state(struct r300_context* r300, void* state)
{
struct r300_capabilities* caps = r300_screen(r300->context.screen)->caps;
CS_LOCALS(r300);

View File

@ -25,6 +25,6 @@
struct r300_context;
void r300_emit_invariant_state(struct r300_context* r300);
void r300_emit_invariant_state(struct r300_context* r300, void* state);
#endif /* R300_STATE_INVARIANT_H */