From 2da7db759bfd55106cab8a0da193f80ce50380fd Mon Sep 17 00:00:00 2001 From: Jesse Natalie Date: Fri, 14 Jan 2022 06:30:27 -0800 Subject: [PATCH] d3d12: Relax multisampling direct copy requirements D3D has supported partial copying of MSAA resources as as long as the sample counts match since D3D10.1 Reviewed-by: Sil Vilerino Part-of: --- src/gallium/drivers/d3d12/d3d12_blit.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/gallium/drivers/d3d12/d3d12_blit.cpp b/src/gallium/drivers/d3d12/d3d12_blit.cpp index 6a5c962f995..9b72feb2432 100644 --- a/src/gallium/drivers/d3d12/d3d12_blit.cpp +++ b/src/gallium/drivers/d3d12/d3d12_blit.cpp @@ -227,7 +227,7 @@ direct_copy_supported(struct d3d12_screen *screen, D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER_NOT_SUPPORTED && (info->src.resource->bind & PIPE_BIND_DEPTH_STENCIL || info->dst.resource->bind & PIPE_BIND_DEPTH_STENCIL)) || - info->src.resource->nr_samples > 1) { + info->src.resource->nr_samples != info->dst.resource->nr_samples) { if (info->dst.box.x != 0 || info->dst.box.y != 0 || @@ -336,8 +336,7 @@ copy_subregion_no_barriers(struct d3d12_context *ctx, D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER_NOT_SUPPORTED || (!util_format_is_depth_or_stencil(dst->base.b.format) && !util_format_is_depth_or_stencil(src->base.b.format) && - dst->base.b.nr_samples <= 1 && - src->base.b.nr_samples <= 1)); + dst->base.b.nr_samples == src->base.b.nr_samples)); ctx->cmdlist->CopyTextureRegion(&dst_loc, dstx, dsty, dstz, &src_loc, NULL); @@ -355,8 +354,7 @@ copy_subregion_no_barriers(struct d3d12_context *ctx, D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER_NOT_SUPPORTED || (!util_format_is_depth_or_stencil(dst->base.b.format) && !util_format_is_depth_or_stencil(src->base.b.format))) && - dst->base.b.nr_samples <= 1 && - src->base.b.nr_samples <= 1); + dst->base.b.nr_samples == src->base.b.nr_samples); ctx->cmdlist->CopyTextureRegion(&dst_loc, dstx, dsty, dstz, &src_loc, &src_box);