Lines Matching refs:ctx

39 copy_buffer_region_no_barriers(struct d3d12_context *ctx,
50 ctx->cmdlist->CopyBufferRegion(dst_buf, dst_offset + dst_off,
113 blit_resolve(struct d3d12_context *ctx, const struct pipe_blit_info *info)
115 struct d3d12_batch *batch = d3d12_current_batch(ctx);
119 d3d12_transition_resource_state(ctx, src,
122 d3d12_transition_resource_state(ctx, dst,
126 d3d12_apply_resource_states(ctx, false);
134 ctx->cmdlist->ResolveSubresource(
265 copy_subregion_no_barriers(struct d3d12_context *ctx,
274 UNUSED struct d3d12_screen *screen = d3d12_screen(ctx->base.screen);
341 ctx->cmdlist->CopyTextureRegion(&dst_loc, dstx, dsty, dstz,
359 ctx->cmdlist->CopyTextureRegion(&dst_loc, dstx, dsty, dstz,
366 copy_resource_y_flipped_no_barriers(struct d3d12_context *ctx,
396 copy_subregion_no_barriers(ctx, dst, dst_level,
403 d3d12_direct_copy(struct d3d12_context *ctx,
412 struct d3d12_batch *batch = d3d12_current_batch(ctx);
423 d3d12_transition_subresources_state(ctx, src, src_subres, 1, 0, 1,
429 d3d12_transition_subresources_state(ctx, dst, dst_subres, 1, 0, 1,
435 d3d12_apply_resource_states(ctx, false);
441 copy_buffer_region_no_barriers(ctx, dst, pdst_box->x,
445 copy_subregion_no_barriers(ctx, dst, dst_level,
450 copy_resource_y_flipped_no_barriers(ctx, dst, dst_level, pdst_box,
464 create_staging_resource(struct d3d12_context *ctx,
493 staging_res = ctx->base.screen->resource_create(ctx->base.screen, &templ);
502 d3d12_direct_copy(ctx, d3d12_resource(staging_res), 0, dst_box,
523 blit_same_resource(struct d3d12_context *ctx,
529 dst_info.src.resource = create_staging_resource(ctx, d3d12_resource(info->src.resource),
533 ctx->base.blit(&ctx->base, &dst_info);
538 util_blit_save_state(struct d3d12_context *ctx)
540 util_blitter_save_blend(ctx->blitter, ctx->gfx_pipeline_state.blend);
541 util_blitter_save_depth_stencil_alpha(ctx->blitter, ctx->gfx_pipeline_state.zsa);
542 util_blitter_save_vertex_elements(ctx->blitter, ctx->gfx_pipeline_state.ves);
543 util_blitter_save_stencil_ref(ctx->blitter, &ctx->stencil_ref);
544 util_blitter_save_rasterizer(ctx->blitter, ctx->gfx_pipeline_state.rast);
545 util_blitter_save_fragment_shader(ctx->blitter, ctx->gfx_stages[PIPE_SHADER_FRAGMENT]);
546 util_blitter_save_vertex_shader(ctx->blitter, ctx->gfx_stages[PIPE_SHADER_VERTEX]);
547 util_blitter_save_geometry_shader(ctx->blitter, ctx->gfx_stages[PIPE_SHADER_GEOMETRY]);
548 util_blitter_save_tessctrl_shader(ctx->blitter, ctx->gfx_stages[PIPE_SHADER_TESS_CTRL]);
549 util_blitter_save_tesseval_shader(ctx->blitter, ctx->gfx_stages[PIPE_SHADER_TESS_EVAL]);
551 util_blitter_save_framebuffer(ctx->blitter, &ctx->fb);
552 util_blitter_save_viewport(ctx->blitter, ctx->viewport_states);
553 util_blitter_save_scissor(ctx->blitter, ctx->scissor_states);
554 util_blitter_save_fragment_sampler_states(ctx->blitter,
555 ctx->num_samplers[PIPE_SHADER_FRAGMENT],
556 (void **)ctx->samplers[PIPE_SHADER_FRAGMENT]);
557 util_blitter_save_fragment_sampler_views(ctx->blitter,
558 ctx->num_sampler_views[PIPE_SHADER_FRAGMENT],
559 ctx->sampler_views[PIPE_SHADER_FRAGMENT]);
560 util_blitter_save_fragment_constant_buffer_slot(ctx->blitter, ctx->cbufs[PIPE_SHADER_FRAGMENT]);
561 util_blitter_save_vertex_buffer_slot(ctx->blitter, ctx->vbs);
562 util_blitter_save_sample_mask(ctx->blitter, ctx->gfx_pipeline_state.sample_mask, 0);
563 util_blitter_save_so_targets(ctx->blitter, ctx->gfx_pipeline_state.num_so_targets, ctx->so_targets);
567 util_blit(struct d3d12_context *ctx,
570 util_blit_save_state(ctx);
572 util_blitter_blit(ctx->blitter, info);
576 resolve_stencil_supported(struct d3d12_context *ctx,
589 !util_blitter_is_blit_supported(ctx->blitter, &new_info))
595 return util_blitter_is_blit_supported(ctx->blitter, &new_info);
617 get_stencil_resolve_vs(struct d3d12_context *ctx)
619 if (ctx->stencil_resolve_vs)
620 return ctx->stencil_resolve_vs;
623 &d3d12_screen(ctx->base.screen)->nir_options,
639 ctx->stencil_resolve_vs = ctx->base.create_vs_state(&ctx->base, &state);
641 return ctx->stencil_resolve_vs;
645 get_stencil_resolve_fs(struct d3d12_context *ctx, bool no_flip)
647 if (!no_flip && ctx->stencil_resolve_fs)
648 return ctx->stencil_resolve_fs;
650 if (no_flip && ctx->stencil_resolve_fs_no_flip)
651 return ctx->stencil_resolve_fs_no_flip;
654 &d3d12_screen(ctx->base.screen)->nir_options,
728 result = ctx->base.create_fs_state(&ctx->base, &state);
729 ctx->stencil_resolve_fs_no_flip = result;
731 result = ctx->base.create_fs_state(&ctx->base, &state);
732 ctx->stencil_resolve_fs = result;
739 get_sampler_state(struct d3d12_context *ctx)
741 if (ctx->sampler_state)
742 return ctx->sampler_state;
751 return ctx->sampler_state = ctx->base.create_sampler_state(&ctx->base, &state);
755 resolve_stencil_to_temp(struct d3d12_context *ctx,
758 struct pipe_context *pctx = &ctx->base;
777 util_blitter_default_src_texture(ctx->blitter, &src_templ,
782 void *sampler_state = get_sampler_state(ctx);
784 util_blit_save_state(ctx);
787 util_blitter_custom_shader(ctx->blitter, dst_surf,
788 get_stencil_resolve_vs(ctx),
789 get_stencil_resolve_fs(ctx, info->src.box.height == info->dst.box.height));
790 util_blitter_restore_textures(ctx->blitter);
797 blit_resolve_stencil(struct d3d12_context *ctx,
811 blit_resolve(ctx, &new_info);
813 util_blit(ctx, &new_info);
816 struct pipe_resource *tmp = resolve_stencil_to_temp(ctx, info);
821 d3d12_transition_subresources_state(ctx, d3d12_resource(tmp),
825 d3d12_transition_subresources_state(ctx, dst,
829 d3d12_apply_resource_states(ctx, false);
831 struct d3d12_batch *batch = d3d12_current_batch(ctx);
851 ctx->cmdlist->CopyTextureRegion(&dst_loc, info->dst.box.x,
859 replicate_stencil_supported(struct d3d12_context *ctx,
869 if (!util_blitter_is_blit_supported(ctx->blitter, &new_info))
877 blit_replicate_stencil(struct d3d12_context *ctx,
889 util_blit(ctx, &new_info);
892 util_blit_save_state(ctx);
893 util_blitter_stencil_fallback(ctx->blitter, info->dst.resource,
906 struct d3d12_context *ctx = d3d12_context(pctx);
908 if (!info->render_condition_enable && ctx->current_predication) {
911 ctx->cmdlist->SetPredication(nullptr, 0, D3D12_PREDICATION_OP_EQUAL_ZERO);
932 blit_same_resource(ctx, info);
935 blit_resolve(ctx, info);
936 else if (util_blitter_is_blit_supported(ctx->blitter, info))
937 util_blit(ctx, info);
938 else if (resolve_stencil_supported(ctx, info))
939 blit_resolve_stencil(ctx, info);
945 ctx->current_predication != nullptr))
946 d3d12_direct_copy(ctx, d3d12_resource(info->dst.resource),
950 else if (util_blitter_is_blit_supported(ctx->blitter, info))
951 util_blit(ctx, info);
952 else if (replicate_stencil_supported(ctx, info))
953 blit_replicate_stencil(ctx, info);
959 if (!info->render_condition_enable && ctx->current_predication) {
960 d3d12_enable_predication(ctx);
976 struct d3d12_context *ctx = d3d12_context(pctx);
996 staging_res = create_staging_resource(ctx, src, src_level, psrc_box, &staging_box, PIPE_MASK_RGBAZS);
1008 d3d12_direct_copy(ctx, dst, dst_level, &dst_box,
1016 d3d12_context_blit_init(struct pipe_context *ctx)
1018 ctx->resource_copy_region = d3d12_resource_copy_region;
1019 ctx->blit = d3d12_blit;