-/**
- * Vertex shader surfaces (constant buffer).
- *
- * This consumes the state updates for the constant buffer needing
- * to be updated, and produces BRW_NEW_NR_VS_SURFACES for the VS unit and
- * CACHE_NEW_SURF_BIND for the binding table upload.
- */
-static void upload_vs_surfaces(struct brw_context *brw)
-{
- GLcontext *ctx = &brw->intel.ctx;
- uint32_t *bind;
- int i;
-
- /* BRW_NEW_NR_VS_SURFACES */
- if (brw->vs.nr_surfaces == 0) {
- if (brw->vs.bind_bo) {
- drm_intel_bo_unreference(brw->vs.bind_bo);
- brw->vs.bind_bo = NULL;
- brw->state.dirty.brw |= BRW_NEW_BINDING_TABLE;
- }
- return;
- }
-
- brw_update_vs_constant_surface(ctx, SURF_INDEX_VERT_CONST_BUFFER);
+const struct brw_tracked_state brw_vs_ubo_surfaces = {
+ .dirty = {
+ .mesa = _NEW_PROGRAM,
+ .brw = BRW_NEW_BATCH | BRW_NEW_UNIFORM_BUFFER,
+ .cache = CACHE_NEW_VS_PROG,
+ },
+ .emit = brw_upload_vs_ubo_surfaces,
+};