mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-02 10:24:12 +01:00
[d3d11] Implement 2D<->3D image copies in CopySubresourceRegion
This commit is contained in:
parent
9a8263f465
commit
fcdba67b88
@ -298,7 +298,13 @@ namespace dxvk {
|
|||||||
pDstResource->GetType(&dstResourceDim);
|
pDstResource->GetType(&dstResourceDim);
|
||||||
pSrcResource->GetType(&srcResourceDim);
|
pSrcResource->GetType(&srcResourceDim);
|
||||||
|
|
||||||
if (dstResourceDim != srcResourceDim) {
|
// Copying 2D image slices to 3D images and vice versa is legal
|
||||||
|
const bool copy2Dto3D = dstResourceDim == D3D11_RESOURCE_DIMENSION_TEXTURE3D
|
||||||
|
&& srcResourceDim == D3D11_RESOURCE_DIMENSION_TEXTURE2D;
|
||||||
|
const bool copy3Dto2D = dstResourceDim == D3D11_RESOURCE_DIMENSION_TEXTURE2D
|
||||||
|
&& srcResourceDim == D3D11_RESOURCE_DIMENSION_TEXTURE3D;
|
||||||
|
|
||||||
|
if (dstResourceDim != srcResourceDim && !copy2Dto3D && !copy3Dto2D) {
|
||||||
Logger::err(str::format(
|
Logger::err(str::format(
|
||||||
"D3D11: CopySubresourceRegion: Incompatible resources",
|
"D3D11: CopySubresourceRegion: Incompatible resources",
|
||||||
"\n Dst resource type: ", dstResourceDim,
|
"\n Dst resource type: ", dstResourceDim,
|
||||||
@ -368,16 +374,24 @@ namespace dxvk {
|
|||||||
extent.depth = pSrcBox->back - pSrcBox->front;
|
extent.depth = pSrcBox->back - pSrcBox->front;
|
||||||
}
|
}
|
||||||
|
|
||||||
const VkImageSubresourceLayers dstLayers = {
|
VkImageSubresourceLayers dstLayers = {
|
||||||
dstSubresource.aspectMask,
|
dstSubresource.aspectMask,
|
||||||
dstSubresource.mipLevel,
|
dstSubresource.mipLevel,
|
||||||
dstSubresource.arrayLayer, 1 };
|
dstSubresource.arrayLayer, 1 };
|
||||||
|
|
||||||
const VkImageSubresourceLayers srcLayers = {
|
VkImageSubresourceLayers srcLayers = {
|
||||||
srcSubresource.aspectMask,
|
srcSubresource.aspectMask,
|
||||||
srcSubresource.mipLevel,
|
srcSubresource.mipLevel,
|
||||||
srcSubresource.arrayLayer, 1 };
|
srcSubresource.arrayLayer, 1 };
|
||||||
|
|
||||||
|
// Copying multiple slices does not
|
||||||
|
// seem to be supported in D3D11
|
||||||
|
if (copy2Dto3D || copy3Dto2D) {
|
||||||
|
extent.depth = 1;
|
||||||
|
dstLayers.layerCount = 1;
|
||||||
|
srcLayers.layerCount = 1;
|
||||||
|
}
|
||||||
|
|
||||||
EmitCs([
|
EmitCs([
|
||||||
cDstImage = dstImage,
|
cDstImage = dstImage,
|
||||||
cSrcImage = srcImage,
|
cSrcImage = srcImage,
|
||||||
|
Loading…
Reference in New Issue
Block a user