[d3d11] Implement and advertize support for CopyWithOverlap feature

This commit is contained in:
Philip Rebohle 2018-09-18 16:22:47 +02:00
parent e3c2815782
commit d9009efd22
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 31 additions and 11 deletions

View File

@ -342,12 +342,22 @@ namespace dxvk {
cDstSlice = dstBuffer.subSlice(dstOffset, regLength),
cSrcSlice = srcBuffer.subSlice(srcOffset, regLength)
] (DxvkContext* ctx) {
ctx->copyBuffer(
cDstSlice.buffer(),
cDstSlice.offset(),
cSrcSlice.buffer(),
cSrcSlice.offset(),
cSrcSlice.length());
bool sameResource = cDstSlice.buffer() == cSrcSlice.buffer();
if (!sameResource) {
ctx->copyBuffer(
cDstSlice.buffer(),
cDstSlice.offset(),
cSrcSlice.buffer(),
cSrcSlice.offset(),
cSrcSlice.length());
} else {
ctx->copyBufferRegion(
cDstSlice.buffer(),
cDstSlice.offset(),
cSrcSlice.offset(),
cSrcSlice.length());
}
});
} else {
const D3D11CommonTexture* dstTextureInfo = GetCommonTexture(pDstResource);
@ -476,10 +486,20 @@ namespace dxvk {
cSrcOffset = srcOffset,
cExtent = regExtent
] (DxvkContext* ctx) {
ctx->copyImage(
cDstImage, cDstLayers, cDstOffset,
cSrcImage, cSrcLayers, cSrcOffset,
cExtent);
bool sameSubresource = cDstImage == cSrcImage
&& cDstLayers == cSrcLayers;
if (!sameSubresource) {
ctx->copyImage(
cDstImage, cDstLayers, cDstOffset,
cSrcImage, cSrcLayers, cSrcOffset,
cExtent);
} else {
ctx->copyImageRegion(
cDstImage, cDstLayers,
cDstOffset, cSrcOffset,
cExtent);
}
});
}
}

View File

@ -1153,7 +1153,7 @@ namespace dxvk {
info->DiscardAPIsSeenByDriver = TRUE;
info->FlagsForUpdateAndCopySeenByDriver = TRUE;
info->ClearView = TRUE;
info->CopyWithOverlap = FALSE;
info->CopyWithOverlap = TRUE;
info->ConstantBufferPartialUpdate = TRUE;
info->ConstantBufferOffsetting = TRUE;
info->MapNoOverwriteOnDynamicConstantBuffer = TRUE;