diff options
author | José Fonseca <jrfonseca@tungstengraphics.com> | 2007-11-06 19:16:40 +0000 |
---|---|---|
committer | José Fonseca <jrfonseca@tungstengraphics.com> | 2007-11-07 13:40:35 +0000 |
commit | f39a520892259bc3ff13b47423fb86cd7714c70a (patch) | |
tree | 70f9e0f2bd337b231bfb804f17ece3dbb280a1db /src/mesa/pipe/i915simple/i915_state_immediate.c | |
parent | 85c7683f1f5f1d0d9e95eb59270705a2975fa437 (diff) |
Track hardware vertex buffer state changes.
Diffstat (limited to 'src/mesa/pipe/i915simple/i915_state_immediate.c')
-rw-r--r-- | src/mesa/pipe/i915simple/i915_state_immediate.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/mesa/pipe/i915simple/i915_state_immediate.c b/src/mesa/pipe/i915simple/i915_state_immediate.c index 479d72a87f..d830bb78e8 100644 --- a/src/mesa/pipe/i915simple/i915_state_immediate.c +++ b/src/mesa/pipe/i915simple/i915_state_immediate.c @@ -46,6 +46,46 @@ /*********************************************************************** + * S0,S1: Vertex buffer state. + */ +static void upload_S0S1(struct i915_context *i915) +{ + unsigned LIS0, LIS1; + + /* INTEL_NEW_VBO */ + /* TODO: re-use vertex buffers here? */ + LIS0 = 0; + + /* INTEL_NEW_VERTEX_SIZE -- do this where the vertex size is calculated! + */ + { + unsigned vertex_size = i915->current.vertex_info.size; + + LIS1 = ((vertex_size << 24) | + (vertex_size << 16)); + } + + /* INTEL_NEW_VBO */ + /* TODO: use a vertex generation number to track vbo changes */ + if (1 || + i915->current.immediate[I915_IMMEDIATE_S0] != LIS0 || + i915->current.immediate[I915_IMMEDIATE_S1] != LIS1) + { + i915->current.immediate[I915_IMMEDIATE_S0] = LIS0; + i915->current.immediate[I915_IMMEDIATE_S1] = LIS1; + i915->hardware_dirty |= I915_HW_IMMEDIATE; + } +} + +const struct i915_tracked_state i915_upload_S0S1 = { + .dirty = I915_NEW_VBO | I915_NEW_VERTEX_FORMAT, + .update = upload_S0S1 +}; + + + + +/*********************************************************************** * S4: Vertex format, rasterization state */ static void upload_S2S4(struct i915_context *i915) @@ -166,6 +206,7 @@ const struct i915_tracked_state i915_upload_S7 = { static const struct i915_tracked_state *atoms[] = { + &i915_upload_S0S1, &i915_upload_S2S4, &i915_upload_S5, &i915_upload_S6, |