#define CACHE_NEW_CLIP_UNIT (1<<BRW_CLIP_UNIT)
#define CACHE_NEW_CLIP_PROG (1<<BRW_CLIP_PROG)
-struct brw_cached_batch_item {
- struct header *header;
- GLuint sz;
- struct brw_cached_batch_item *next;
-};
-
struct brw_vertex_buffer {
/** Buffer object containing the uploaded vertex data */
drm_intel_bo *bo;
drm_intel_bo *workaround_bo;
bool need_workaround_flush;
- struct cached_batch_item *cached_items;
-
uint16_t emit, total;
uint16_t used, reserved_space;
uint32_t *map;
} state;
struct brw_cache cache;
- struct brw_cached_batch_item *cached_batch_items;
/* Whether a meta-operation is in progress. */
bool meta_in_progress;
static void
intel_batchbuffer_reset(struct brw_context *brw);
-struct cached_batch_item {
- struct cached_batch_item *next;
- uint16_t header;
- uint16_t size;
-};
-
-void
-intel_batchbuffer_clear_cache(struct brw_context *brw)
-{
- struct cached_batch_item *item = brw->batch.cached_items;
-
- while (item) {
- struct cached_batch_item *next = item->next;
- free(item);
- item = next;
- }
-
- brw->batch.cached_items = NULL;
-}
-
void
intel_batchbuffer_init(struct brw_context *brw)
{
}
brw->batch.last_bo = brw->batch.bo;
- intel_batchbuffer_clear_cache(brw);
brw_render_cache_set_clear(brw);
brw->batch.bo = drm_intel_bo_alloc(brw->bufmgr, "batchbuffer",
brw->batch.used = brw->batch.saved.used;
if (brw->batch.used == 0)
brw->batch.ring = UNKNOWN_RING;
-
- /* Cached batch state is dead, since we just cleared some unknown part of the
- * batchbuffer. Assume that the caller resets any other state necessary.
- */
- intel_batchbuffer_clear_cache(brw);
}
void
drm_intel_bo_unreference(brw->batch.last_bo);
drm_intel_bo_unreference(brw->batch.bo);
drm_intel_bo_unreference(brw->batch.workaround_bo);
- intel_batchbuffer_clear_cache(brw);
}
static void
void intel_batchbuffer_free(struct brw_context *brw);
void intel_batchbuffer_save_state(struct brw_context *brw);
void intel_batchbuffer_reset_to_saved(struct brw_context *brw);
-void intel_batchbuffer_clear_cache(struct brw_context *brw);
int _intel_batchbuffer_flush(struct brw_context *brw,
const char *file, int line);