Merge pull request #3355 from mimimi085181/partial-texture-updates-check-dimensions

Partial texture updates: Check the dimensions of the efb copy
This commit is contained in:
Pierre Bourdon
2016-02-29 00:49:48 +01:00
4 changed files with 120 additions and 61 deletions

View File

@ -87,16 +87,14 @@ void TextureCache::TCacheEntry::CopyRectangleFromTexture(
if (srcrect.GetWidth() == dstrect.GetWidth()
&& srcrect.GetHeight() == dstrect.GetHeight())
{
const D3D11_BOX *psrcbox = nullptr;
D3D11_BOX srcbox;
if (srcrect.left != 0 || srcrect.top != 0)
{
srcbox.left = srcrect.left;
srcbox.top = srcrect.top;
srcbox.right = srcrect.right;
srcbox.bottom = srcrect.bottom;
psrcbox = &srcbox;
}
srcbox.left = srcrect.left;
srcbox.top = srcrect.top;
srcbox.right = srcrect.right;
srcbox.bottom = srcrect.bottom;
srcbox.front = 0;
srcbox.back = srcentry->config.layers;
D3D::context->CopySubresourceRegion(
texture->GetTex(),
0,
@ -105,7 +103,7 @@ void TextureCache::TCacheEntry::CopyRectangleFromTexture(
0,
srcentry->texture->GetTex(),
0,
psrcbox);
&srcbox);
return;
}
else if (!config.rendertarget)
@ -132,7 +130,7 @@ void TextureCache::TCacheEntry::CopyRectangleFromTexture(
srcentry->config.width, srcentry->config.height,
PixelShaderCache::GetColorCopyProgram(false),
VertexShaderCache::GetSimpleVertexShader(),
VertexShaderCache::GetSimpleInputLayout(), nullptr, 1.0, 0);
VertexShaderCache::GetSimpleInputLayout(), GeometryShaderCache::GetCopyGeometryShader(), 1.0, 0);
D3D::context->OMSetRenderTargets(1,
&FramebufferManager::GetEFBColorTexture()->GetRTV(),