Exemplo n.º 1
0
/* emit accumulated render cmds, needed for example if render target has
 * changed, or for flush()
 */
void
fd_context_render(struct pipe_context *pctx)
{
	struct fd_context *ctx = fd_context(pctx);
	struct pipe_framebuffer_state *pfb = &ctx->framebuffer;

	DBG("needs_flush: %d", ctx->needs_flush);

	if (!ctx->needs_flush)
		return;

	fd_gmem_render_tiles(pctx);

	DBG("%p/%p/%p", ctx->ring->start, ctx->ring->cur, ctx->ring->end);

	/* if size in dwords is more than half the buffer size, then wait and
	 * wrap around:
	 */
	if ((ctx->ring->cur - ctx->ring->start) > ctx->ring->size/8)
		fd_context_wait(pctx);

	ctx->needs_flush = false;
	ctx->cleared = ctx->restore = ctx->resolve = 0;
	ctx->gmem_reason = 0;
	ctx->num_draws = 0;

	if (pfb->cbufs[0])
		fd_resource(pfb->cbufs[0]->texture)->dirty = false;
	if (pfb->zsbuf)
		fd_resource(pfb->zsbuf->texture)->dirty = false;
}
Exemplo n.º 2
0
static void
fd_context_flush(struct pipe_context *pctx, struct pipe_fence_handle **fence,
		enum pipe_flush_flags flags)
{
	DBG("fence=%p", fence);

#if 0
	if (fence) {
		fd_fence_ref(ctx->screen->fence.current,
				(struct fd_fence **)fence);
	}
#endif

	fd_context_render(pctx);
	fd_context_wait(pctx);
}