Lines Matching refs:batch
46 resource_read(struct fd_batch *batch, struct pipe_resource *prsc) assert_dt
50 fd_batch_resource_read(batch, fd_resource(prsc));
54 resource_written(struct fd_batch *batch, struct pipe_resource *prsc) assert_dt
58 fd_batch_resource_write(batch, fd_resource(prsc));
62 batch_draw_tracking_for_dirty_bits(struct fd_batch *batch) assert_dt
64 struct fd_context *ctx = batch->ctx;
65 struct pipe_framebuffer_state *pfb = &batch->framebuffer;
78 batch->invalidated |= FD_BUFFER_DEPTH;
80 batch->gmem_reason |= FD_GMEM_DEPTH_ENABLED;
83 resource_written(batch, pfb->zsbuf->texture);
85 resource_read(batch, pfb->zsbuf->texture);
98 batch->invalidated |= FD_BUFFER_STENCIL;
100 batch->gmem_reason |= FD_GMEM_STENCIL_ENABLED;
102 resource_written(batch, pfb->zsbuf->texture);
118 batch->invalidated |= PIPE_CLEAR_COLOR0 << i;
124 resource_written(batch, pfb->cbufs[i]->texture);
130 batch->gmem_reason |= FD_GMEM_LOGICOP_ENABLED;
133 batch->gmem_reason |= FD_GMEM_BLEND_ENABLED;
143 resource_written(batch, so->sb[i].buffer);
146 resource_read(batch, so->sb[i].buffer);
154 resource_written(batch, img->resource);
156 resource_read(batch, img->resource);
164 resource_read(batch, ctx->constbuf[s].cb[i].buffer);
170 resource_read(batch, ctx->tex[s].textures[i]->texture);
178 resource_read(batch, ctx->vtx.vertexbuf.vb[i].buffer.resource);
186 resource_written(batch, ctx->streamout.targets[i]->buffer);
190 batch->restore |= restore_buffers & (FD_BUFFER_ALL & ~batch->invalidated);
192 batch->resolve |= buffers;
196 batch_draw_tracking(struct fd_batch *batch, const struct pipe_draw_info *info,
199 struct fd_context *ctx = batch->ctx;
201 /* NOTE: needs to be before resource_written(batch->query_buf), otherwise
204 fd_batch_update_queries(batch);
213 batch_draw_tracking_for_dirty_bits(batch);
217 resource_read(batch, info->index.resource);
222 resource_read(batch, indirect->buffer);
225 batch, fd_stream_output_target(indirect->count_from_stream_output)
229 resource_written(batch, batch->query_buf);
232 resource_written(batch, aq->prsc);
326 struct fd_batch *batch = fd_context_batch(ctx);
328 batch_draw_tracking(batch, info, indirect);
330 while (unlikely(!fd_batch_lock_submit(batch))) {
331 /* The current batch was flushed in batch_draw_tracking()
333 * since we are dealing with a fresh batch:
335 fd_batch_reference(&batch, NULL);
336 batch = fd_context_batch(ctx);
337 batch_draw_tracking(batch, info, indirect);
338 assert(ctx->batch == batch);
341 batch->num_draws++;
343 /* Marking the batch as needing flush must come after the batch
347 fd_batch_needs_flush(batch);
349 struct pipe_framebuffer_state *pfb = &batch->framebuffer;
350 DBG("%p: %ux%u num_draws=%u (%s/%s)", batch, pfb->width, pfb->height,
351 batch->num_draws,
355 batch->cost += ctx->draw_cost;
360 batch->num_vertices += draws[i].count * info->instance_count;
374 assert(!batch->flushed);
376 fd_batch_unlock_submit(batch);
377 fd_batch_check_size(batch);
378 fd_batch_reference(&batch, NULL);
385 batch_clear_tracking(struct fd_batch *batch, unsigned buffers) assert_dt
387 struct fd_context *ctx = batch->ctx;
388 struct pipe_framebuffer_state *pfb = &batch->framebuffer;
394 batch->max_scissor.minx = 0;
395 batch->max_scissor.miny = 0;
396 batch->max_scissor.maxx = pfb->width;
397 batch->max_scissor.maxy = pfb->height;
406 cleared_buffers = buffers & (FD_BUFFER_ALL & ~batch->restore);
407 batch->cleared |= buffers;
408 batch->invalidated |= cleared_buffers;
410 batch->resolve |= buffers;
417 resource_written(batch, pfb->cbufs[i]->texture);
420 resource_written(batch, pfb->zsbuf->texture);
421 batch->gmem_reason |= FD_GMEM_CLEARS_DEPTH_STENCIL;
424 resource_written(batch, batch->query_buf);
427 resource_written(batch, aq->prsc);
444 struct fd_batch *batch = fd_context_batch(ctx);
446 batch_clear_tracking(batch, buffers);
448 while (unlikely(!fd_batch_lock_submit(batch))) {
449 /* The current batch was flushed in batch_clear_tracking()
451 * since we are dealing with a fresh batch:
453 fd_batch_reference(&batch, NULL);
454 batch = fd_context_batch(ctx);
455 batch_clear_tracking(batch, buffers);
456 assert(ctx->batch == batch);
459 /* Marking the batch as needing flush must come after the batch
463 fd_batch_needs_flush(batch);
465 struct pipe_framebuffer_state *pfb = &batch->framebuffer;
466 DBG("%p: %x %ux%u depth=%f, stencil=%u (%s/%s)", batch, buffers, pfb->width,
477 fd_batch_update_queries(batch);
487 assert(!batch->flushed);
489 fd_batch_unlock_submit(batch);
495 fd_batch_check_size(batch);
497 fd_batch_reference(&batch, NULL);
526 struct fd_batch *batch, *save_batch = NULL;
528 batch = fd_bc_alloc_batch(ctx, true);
529 fd_batch_reference(&save_batch, ctx->batch);
530 fd_batch_reference(&ctx->batch, batch);
537 resource_written(batch, so->sb[i].buffer);
540 resource_read(batch, so->sb[i].buffer);
545 resource_written(batch, img->resource);
547 resource_read(batch, img->resource);
552 resource_read(batch, ctx->constbuf[PIPE_SHADER_COMPUTE].cb[i].buffer);
556 resource_read(batch, ctx->tex[PIPE_SHADER_COMPUTE].textures[i]->texture);
562 resource_written(batch, ctx->global_bindings.buf[i]);
565 resource_read(batch, info->indirect);
570 batch, info->work_dim,
574 fd_batch_needs_flush(batch);
577 fd_batch_flush(batch);
579 fd_batch_reference(&ctx->batch, save_batch);
582 fd_batch_reference(&batch, NULL);