r300g: inline FLUSH_CS
[mesa.git] / src / gallium / drivers / r300 / r300_context.c
index 85e45d8647d6b60883df24f2c56a860315e4e952..43e567c432883d9e6909554529bd3095d2430664 100644 (file)
@@ -66,6 +66,8 @@ static void r300_destroy_context(struct pipe_context* context)
     u_upload_destroy(r300->upload_vb);
     u_upload_destroy(r300->upload_ib);
 
+    translate_cache_destroy(r300->tran.translate_cache);
+
     FREE(r300->blend_color_state.state);
     FREE(r300->clip_state.state);
     FREE(r300->fb_state.state);
@@ -227,6 +229,8 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen,
     if (r300->upload_vb == NULL)
         goto no_upload_vb;
 
+    r300->tran.translate_cache = translate_cache_create();
+
     return &r300->context;
 
  no_upload_ib:
@@ -236,6 +240,11 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen,
     return NULL;
 }
 
+boolean r300_check_cs(struct r300_context *r300, unsigned size)
+{
+    return size <= r300->rws->get_cs_free_dwords(r300->rws);
+}
+
 void r300_finish(struct r300_context *r300)
 {
     struct pipe_framebuffer_state *fb;