diff options
author | Kenneth Graunke <[email protected]> | 2011-10-30 16:03:13 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2011-11-10 22:51:19 -0800 |
commit | e7c29c5de82f6de3d30ed1143d9672dd2e25f0e7 (patch) | |
tree | 212ea9e77676e30c1f1a7eead1749131a6306159 /src/mesa/drivers/dri/i965/brw_vs_surface_state.c | |
parent | 4a42bd3931d6298ab9a84b76957ce5d83d289f69 (diff) |
i965: Use a single binding table for all pipeline stages.
Although the hardware supports separate binding tables for each pipeline
stage, we don't see much advantage over a single shared table.
Consider the contents of the binding table:
- Textures (16)
- Draw buffers (8)
- Pull constant buffers (1 for VS, 1 for WM)
OpenGL's texture bindings are global: the same set of textures is
available to all shader targets. So our binding table entries for
textures would be exactly the same in every table.
There are only two pull constant buffers (not many), and although draw
buffers aren't interesting to the VS, it shouldn't hurt to have them in
the table. The hardware supports up to 254 binding table entries, and
we currently only use 26.
Signed-off-by: Kenneth Graunke <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Reviewed-by: Paul Berry <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_vs_surface_state.c')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_vs_surface_state.c | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vs_surface_state.c b/src/mesa/drivers/dri/i965/brw_vs_surface_state.c index 4c99185010f..66d5545b7a9 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_vs_surface_state.c @@ -119,19 +119,17 @@ brw_update_vs_constant_surface( struct gl_context *ctx, (struct brw_vertex_program *) brw->vertex_program; const struct gl_program_parameter_list *params = vp->program.Base.Parameters; - assert(surf == 0); - /* If there's no constant buffer, then no surface BO is needed to point at * it. */ if (brw->vs.const_bo == NULL) { - brw->vs.surf_offset[surf] = 0; + brw->bind.surf_offset[surf] = 0; return; } intel->vtbl.create_constant_surface(brw, brw->vs.const_bo, params->NumParameters, - &brw->vs.surf_offset[surf]); + &brw->bind.surf_offset[surf]); } /** @@ -141,32 +139,11 @@ static void brw_upload_vs_surfaces(struct brw_context *brw) { struct gl_context *ctx = &brw->intel.ctx; - uint32_t *bind; - int i; - int nr_surfaces = 0; /* BRW_NEW_VS_CONSTBUF */ if (brw->vs.const_bo) { - nr_surfaces = 1; brw_update_vs_constant_surface(ctx, SURF_INDEX_VERT_CONST_BUFFER); } - - if (nr_surfaces != 0) { - bind = brw_state_batch(brw, AUB_TRACE_SURFACE_STATE, - sizeof(uint32_t) * nr_surfaces, - 32, &brw->vs.bind_bo_offset); - - for (i = 0; i < nr_surfaces; i++) { - /* BRW_NEW_VS_CONSTBUF */ - bind[i] = brw->vs.surf_offset[i]; - } - brw->state.dirty.brw |= BRW_NEW_VS_BINDING_TABLE; - } else { - if (brw->vs.bind_bo_offset) { - brw->state.dirty.brw |= BRW_NEW_VS_BINDING_TABLE; - brw->vs.bind_bo_offset = 0; - } - } } const struct brw_tracked_state brw_vs_surfaces = { |