gallium/u_blit: don't release vertex buffer at end of frame / in glFlush
authorMarek Olšák <maraeo@gmail.com>
Fri, 13 Apr 2012 19:20:18 +0000 (21:20 +0200)
committerMarek Olšák <maraeo@gmail.com>
Wed, 18 Apr 2012 14:19:39 +0000 (16:19 +0200)
There's no reason to do that. The buffer being used for rendering is always
mapped as unsynchronized.

src/gallium/auxiliary/util/u_blit.c
src/gallium/auxiliary/util/u_blit.h
src/mesa/state_tracker/st_cb_flush.c

index 1279733881a3f79a053da8c8b561f95b7a390786..e5b97f720ab7fd59da82acff8621f7cb6d0c47b5 100644 (file)
@@ -232,8 +232,10 @@ get_next_slot( struct blit_state *ctx )
 {
    const unsigned max_slots = 4096 / sizeof ctx->vertices;
 
-   if (ctx->vbuf_slot >= max_slots) 
-      util_blit_flush( ctx );
+   if (ctx->vbuf_slot >= max_slots) {
+      pipe_resource_reference(&ctx->vbuf, NULL);
+      ctx->vbuf_slot = 0;
+   }
 
    if (!ctx->vbuf) {
       ctx->vbuf = pipe_buffer_create(ctx->pipe->screen,
@@ -674,17 +676,6 @@ util_blit_pixels(struct blit_state *ctx,
 }
 
 
-/* Release vertex buffer at end of frame to avoid synchronous
- * rendering.
- */
-void util_blit_flush( struct blit_state *ctx )
-{
-   pipe_resource_reference(&ctx->vbuf, NULL);
-   ctx->vbuf_slot = 0;
-} 
-
-
-
 /**
  * Copy pixel block from src texture to dst surface.
  * The sampler view's first_level field indicates the source
index 3009e25eca3d4107e40d0b94b80769c70a637e52..810d01b0486607c9bf96c09c6dbcc6217f6209f3 100644 (file)
@@ -86,11 +86,6 @@ util_blit_pixels_tex(struct blit_state *ctx,
                      int dstX1, int dstY1,
                      float z, uint filter);
 
-/* Call at end of frame to avoid synchronous rendering.
- */
-extern void
-util_blit_flush( struct blit_state *ctx );
-
 #ifdef __cplusplus
 }
 #endif
index 724bc1971b476e971b8c1f31c6cc45472ec15cd0..4cde84a8e5b3452705add436e0fb104dd42635d3 100644 (file)
@@ -85,7 +85,6 @@ void st_flush( struct st_context *st,
     * successive frames:
     */
    st_flush_bitmap(st);
-   util_blit_flush(st->blit);
    util_gen_mipmap_flush(st->gen_mipmap);
 
    st->pipe->flush( st->pipe, fence );