diff options
author | Francisco Jerez <currojerez@riseup.net> | 2013-10-20 13:09:57 -0700 |
---|---|---|
committer | Francisco Jerez <currojerez@riseup.net> | 2013-10-29 12:40:56 -0700 |
commit | 5809512b17d3216045b612d359f97759644945f1 (patch) | |
tree | 1649365e2a18ad8bff3eb352ccb699057f72f100 /src/mesa/drivers/dri/i965/brw_vs_surface_state.c | |
parent | c4e730e218a5e8fa329bb122b293b456f373b41b (diff) | |
download | external_mesa3d-5809512b17d3216045b612d359f97759644945f1.zip external_mesa3d-5809512b17d3216045b612d359f97759644945f1.tar.gz external_mesa3d-5809512b17d3216045b612d359f97759644945f1.tar.bz2 |
i965: Implement ABO surface state emission.
The maximum number of atomic buffer objects is somewhat arbitrary, we
can change it in the future easily if it turns out it's not enough...
v2: Add comments with the relevant mesa dirty bits. Fix usage of
BRW_NEW_UNIFORM_BUFFER in the GS ABO state atom.
v3: Update binding table layout diagrams.
v4: Resolve conflicts with the recent dynamic surface index assignment changes.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
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 | 23 |
1 files changed, 23 insertions, 0 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 7e4bcc0..ca8577a 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_vs_surface_state.c @@ -148,3 +148,26 @@ const struct brw_tracked_state brw_vs_ubo_surfaces = { }, .emit = brw_upload_vs_ubo_surfaces, }; + +static void +brw_upload_vs_abo_surfaces(struct brw_context *brw) +{ + struct gl_context *ctx = &brw->ctx; + /* _NEW_PROGRAM */ + struct gl_shader_program *prog = ctx->Shader.CurrentVertexProgram; + + if (prog) { + /* CACHE_NEW_VS_PROG */ + brw_upload_abo_surfaces(brw, prog, &brw->vs.base, + &brw->vs.prog_data->base.base); + } +} + +const struct brw_tracked_state brw_vs_abo_surfaces = { + .dirty = { + .mesa = _NEW_PROGRAM, + .brw = BRW_NEW_BATCH | BRW_NEW_ATOMIC_BUFFER, + .cache = CACHE_NEW_VS_PROG, + }, + .emit = brw_upload_vs_abo_surfaces, +}; |