Lines Matching defs:batch
289 if (ctx->batch->cbufs[0] && resource == ctx->batch->cbufs[0]->texture)
291 if (ctx->batch->zsbuf && resource == ctx->batch->zsbuf->texture)
393 if (ctx->batch->clear | ctx->batch->draw)
396 ctx->batch->clear |= buffers;
399 memcpy(ctx->batch->clear_color, color->f, sizeof(color->f));
402 ctx->batch->clear_depth = depth;
405 ctx->batch->clear_stencil = stencil;
429 if (!(ctx->batch->draw | ctx->batch->clear))
434 memcpy(ctx->batch->encoder_current, stop, sizeof(stop));
443 _mesa_float_to_half(ctx->batch->clear_color[0]),
444 _mesa_float_to_half(ctx->batch->clear_color[1]),
445 _mesa_float_to_half(ctx->batch->clear_color[2]),
446 _mesa_float_to_half(ctx->batch->clear_color[3])
451 agx_pool_upload(&ctx->batch->pool, clear_colour, sizeof(clear_colour)));
453 if (ctx->batch->cbufs[0]) {
454 enum pipe_format fmt = ctx->batch->cbufs[0]->format;
459 ctx->batch->cbufs[0]);
462 if (ctx->batch->cbufs[0] && !(ctx->batch->clear & PIPE_CLEAR_COLOR0)) {
469 if (ctx->batch->cbufs[0]) {
473 agx_pool_upload(&ctx->batch->pool, ctx->render_target[0], sizeof(ctx->render_target)));
477 for (unsigned i = 0; i < ctx->batch->nr_cbufs; ++i) {
478 struct agx_resource *rt = agx_resource(ctx->batch->cbufs[i]->texture);
482 struct agx_resource *zbuf = ctx->batch->zsbuf ?
483 agx_resource(ctx->batch->zsbuf->texture) : NULL;
492 /* BO list for a given batch consists of:
493 * - BOs for the batch's framebuffer surfaces
494 * - BOs for the batch's pools
497 * - BOs added to the batch explicitly
499 struct agx_batch *batch = ctx->batch;
501 agx_batch_add_bo(batch, batch->encoder);
502 agx_batch_add_bo(batch, batch->scissor.bo);
503 agx_batch_add_bo(batch, batch->depth_bias.bo);
504 agx_batch_add_bo(batch, dev->internal.bo);
505 agx_batch_add_bo(batch, dev->reload.bo);
507 for (unsigned i = 0; i < batch->nr_cbufs; ++i) {
508 struct pipe_surface *surf = batch->cbufs[i];
511 agx_batch_add_bo(batch, rsrc->bo);
514 if (batch->zsbuf) {
515 struct pipe_surface *surf = batch->zsbuf;
517 agx_batch_add_bo(batch, rsrc->bo);
520 agx_batch_add_bo(batch, rsrc->separate_stencil->bo);
524 BITSET_COUNT(batch->bo_list) +
525 agx_pool_num_bos(&batch->pool) +
526 agx_pool_num_bos(&batch->pipeline_pool);
531 BITSET_FOREACH_SET(handle, batch->bo_list, sizeof(batch->bo_list) * 8) {
535 agx_pool_get_bo_handles(&batch->pool, handles + handle_i);
536 handle_i += agx_pool_num_bos(&batch->pool);
538 agx_pool_get_bo_handles(&batch->pipeline_pool, handles + handle_i);
539 handle_i += agx_pool_num_bos(&batch->pipeline_pool);
549 &ctx->batch->pool,
551 ctx->batch->encoder->ptr.gpu,
553 ctx->batch->scissor.bo->ptr.gpu,
554 ctx->batch->depth_bias.bo->ptr.gpu,
559 ctx->batch->clear_depth,
560 ctx->batch->clear_stencil);
577 memset(batch->bo_list, 0, sizeof(batch->bo_list));
578 agx_pool_cleanup(&ctx->batch->pool);
579 agx_pool_cleanup(&ctx->batch->pipeline_pool);
580 agx_pool_init(&ctx->batch->pool, dev, AGX_MEMORY_TYPE_FRAMEBUFFER, true);
581 agx_pool_init(&ctx->batch->pipeline_pool, dev, AGX_MEMORY_TYPE_CMDBUF_32, true);
582 ctx->batch->clear = 0;
583 ctx->batch->draw = 0;
584 ctx->batch->encoder_current = ctx->batch->encoder->ptr.cpu;
585 ctx->batch->scissor.count = 0;
624 ctx->batch = CALLOC_STRUCT(agx_batch);
625 agx_pool_init(&ctx->batch->pool,
627 agx_pool_init(&ctx->batch->pipeline_pool,
629 ctx->batch->encoder = agx_bo_create(agx_device(screen), 0x80000, AGX_MEMORY_TYPE_FRAMEBUFFER);
630 ctx->batch->encoder_current = ctx->batch->encoder->ptr.cpu;
631 ctx->batch->scissor.bo = agx_bo_create(agx_device(screen), 0x80000, AGX_MEMORY_TYPE_FRAMEBUFFER);
632 ctx->batch->depth_bias.bo = agx_bo_create(agx_device(screen), 0x80000, AGX_MEMORY_TYPE_FRAMEBUFFER);