summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-04-22 09:14:16 -0600
committerBrian Paul <brianp@vmware.com>2009-04-22 09:14:16 -0600
commit1dbab84e21cad81e971265db3dbc8dc6c344b340 (patch)
tree344bde4256173e336e87a19bcd5bad27f645fc5d /src/mesa/drivers/dri/i965/brw_wm_surface_state.c
parent6b6a23c0f7e042d71764a2028f3d33b59076ac7c (diff)
i965: use _NEW_PROGRAM_CONSTANTS and always create new const buffers
When program constants change we create a new VS constant buffer instead of re-using the old one. This allows us to have several const buffers in flight with vertex rendering.
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_wm_surface_state.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm_surface_state.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
index 71840d1e4e..89c456e62c 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
@@ -456,17 +456,14 @@ brw_update_vs_constant_surface( GLcontext *ctx,
assert(surf == 0);
- /* free old const buffer if too small */
- if (const_buffer && const_buffer->size < size) {
- dri_bo_unreference(const_buffer);
- const_buffer = NULL;
- }
+ /* We always create a new VS constant buffer so that several can be
+ * in flight at a time. Free the old one first...
+ */
+ dri_bo_unreference(const_buffer);
- /* alloc new buffer if needed */
- if (!const_buffer) {
- const_buffer =
- drm_intel_bo_alloc(intel->bufmgr, "vp_const_buffer", size, 64);
- }
+ /* alloc new buffer */
+ const_buffer =
+ drm_intel_bo_alloc(intel->bufmgr, "vp_const_buffer", size, 64);
memset(&key, 0, sizeof(key));
@@ -783,8 +780,7 @@ brw_vs_get_binding_table(struct brw_context *brw)
/**
- * Vertex shader surfaces. Just constant buffer for now. Could add vertex
- * shader textures in the future.
+ * Vertex shader surfaces (constant buffer).
*/
static void prepare_vs_surfaces(struct brw_context *brw )
{
@@ -820,8 +816,12 @@ prepare_surfaces(struct brw_context *brw)
const struct brw_tracked_state brw_wm_surfaces = {
.dirty = {
- .mesa = _NEW_COLOR | _NEW_TEXTURE | _NEW_BUFFERS | _NEW_PROGRAM,
- .brw = BRW_NEW_CONTEXT,
+ .mesa = (_NEW_COLOR |
+ _NEW_TEXTURE |
+ _NEW_BUFFERS |
+ _NEW_PROGRAM |
+ _NEW_PROGRAM_CONSTANTS),
+ .brw = (BRW_NEW_CONTEXT),
.cache = 0
},
.prepare = prepare_surfaces,