1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-02 01:24:11 +01:00

[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), cDstSlice = dstBuffer.subSlice(dstOffset, regLength),
cSrcSlice = srcBuffer.subSlice(srcOffset, regLength) cSrcSlice = srcBuffer.subSlice(srcOffset, regLength)
] (DxvkContext* ctx) { ] (DxvkContext* ctx) {
ctx->copyBuffer( bool sameResource = cDstSlice.buffer() == cSrcSlice.buffer();
cDstSlice.buffer(),
cDstSlice.offset(), if (!sameResource) {
cSrcSlice.buffer(), ctx->copyBuffer(
cSrcSlice.offset(), cDstSlice.buffer(),
cSrcSlice.length()); cDstSlice.offset(),
cSrcSlice.buffer(),
cSrcSlice.offset(),
cSrcSlice.length());
} else {
ctx->copyBufferRegion(
cDstSlice.buffer(),
cDstSlice.offset(),
cSrcSlice.offset(),
cSrcSlice.length());
}
}); });
} else { } else {
const D3D11CommonTexture* dstTextureInfo = GetCommonTexture(pDstResource); const D3D11CommonTexture* dstTextureInfo = GetCommonTexture(pDstResource);
@ -476,10 +486,20 @@ namespace dxvk {
cSrcOffset = srcOffset, cSrcOffset = srcOffset,
cExtent = regExtent cExtent = regExtent
] (DxvkContext* ctx) { ] (DxvkContext* ctx) {
ctx->copyImage( bool sameSubresource = cDstImage == cSrcImage
cDstImage, cDstLayers, cDstOffset, && cDstLayers == cSrcLayers;
cSrcImage, cSrcLayers, cSrcOffset,
cExtent); 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->DiscardAPIsSeenByDriver = TRUE;
info->FlagsForUpdateAndCopySeenByDriver = TRUE; info->FlagsForUpdateAndCopySeenByDriver = TRUE;
info->ClearView = TRUE; info->ClearView = TRUE;
info->CopyWithOverlap = FALSE; info->CopyWithOverlap = TRUE;
info->ConstantBufferPartialUpdate = TRUE; info->ConstantBufferPartialUpdate = TRUE;
info->ConstantBufferOffsetting = TRUE; info->ConstantBufferOffsetting = TRUE;
info->MapNoOverwriteOnDynamicConstantBuffer = TRUE; info->MapNoOverwriteOnDynamicConstantBuffer = TRUE;