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

[d3d11] support textures in CopyResource

fixes green textures and log spam with TrackMania
This commit is contained in:
Clément Guérin 2018-01-14 01:39:59 -08:00
parent fc43b83623
commit 482147d929

View File

@ -488,7 +488,26 @@ namespace dxvk {
srcBuffer.offset(), srcBuffer.offset(),
srcBuffer.length()); srcBuffer.length());
} else { } else {
Logger::err("D3D11DeviceContext::CopyResource: Images not supported"); const D3D11TextureInfo* dstTextureInfo = GetCommonTextureInfo(pDstResource);
const D3D11TextureInfo* srcTextureInfo = GetCommonTextureInfo(pSrcResource);
VkExtent3D extent = srcTextureInfo->image->mipLevelExtent(
dstTextureInfo->mappedSubresource.mipLevel);
const VkImageSubresourceLayers dstLayers = {
dstTextureInfo->mappedSubresource.aspectMask,
dstTextureInfo->mappedSubresource.mipLevel,
dstTextureInfo->mappedSubresource.arrayLayer, 1 };
const VkImageSubresourceLayers srcLayers = {
srcTextureInfo->mappedSubresource.aspectMask,
srcTextureInfo->mappedSubresource.mipLevel,
srcTextureInfo->mappedSubresource.arrayLayer, 1 };
m_context->copyImage(
dstTextureInfo->image, dstLayers, VkOffset3D { 0, 0, 0 },
srcTextureInfo->image, srcLayers, VkOffset3D { 0, 0, 0 },
extent);
} }
} }