Minor fixes to the partial updates code
- remove an outdated comment about the efb to ram and scaled efb restriction - when upscaling efb copies, mark the new texture as efb copy - dx12 fixes for the src box, especially the number of layers for 3D
This commit is contained in:
parent
80250f47e9
commit
e4f984d5dd
|
@ -106,18 +106,13 @@ void TextureCache::TCacheEntry::CopyRectangleFromTexture(
|
||||||
if (src_rect.GetWidth() == dst_rect.GetWidth()
|
if (src_rect.GetWidth() == dst_rect.GetWidth()
|
||||||
&& src_rect.GetHeight() == dst_rect.GetHeight())
|
&& src_rect.GetHeight() == dst_rect.GetHeight())
|
||||||
{
|
{
|
||||||
const D3D12_BOX* src_box_pointer = nullptr;
|
D3D12_BOX srcbox;
|
||||||
D3D12_BOX src_box;
|
srcbox.left = src_rect.left;
|
||||||
if (src_rect.left != 0 || src_rect.top != 0)
|
srcbox.top = src_rect.top;
|
||||||
{
|
srcbox.right = src_rect.right;
|
||||||
src_box.front = 0;
|
srcbox.bottom = src_rect.bottom;
|
||||||
src_box.back = 1;
|
srcbox.front = 0;
|
||||||
src_box.left = src_rect.left;
|
srcbox.back = srcentry->config.layers;
|
||||||
src_box.top = src_rect.top;
|
|
||||||
src_box.right = src_rect.right;
|
|
||||||
src_box.bottom = src_rect.bottom;
|
|
||||||
src_box_pointer = &src_box;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (static_cast<u32>(src_rect.GetHeight()) > config.height ||
|
if (static_cast<u32>(src_rect.GetHeight()) > config.height ||
|
||||||
static_cast<u32>(src_rect.GetWidth()) > config.width)
|
static_cast<u32>(src_rect.GetWidth()) > config.width)
|
||||||
|
@ -137,7 +132,7 @@ void TextureCache::TCacheEntry::CopyRectangleFromTexture(
|
||||||
m_texture->TransitionToResourceState(D3D::current_command_list, D3D12_RESOURCE_STATE_COPY_DEST);
|
m_texture->TransitionToResourceState(D3D::current_command_list, D3D12_RESOURCE_STATE_COPY_DEST);
|
||||||
srcentry->m_texture->TransitionToResourceState(D3D::current_command_list, D3D12_RESOURCE_STATE_COPY_SOURCE);
|
srcentry->m_texture->TransitionToResourceState(D3D::current_command_list, D3D12_RESOURCE_STATE_COPY_SOURCE);
|
||||||
|
|
||||||
D3D::current_command_list->CopyTextureRegion(&dst_location, dst_rect.left, dst_rect.top, 0, &src_location, src_box_pointer);
|
D3D::current_command_list->CopyTextureRegion(&dst_location, dst_rect.left, dst_rect.top, 0, &src_location, &srcbox);
|
||||||
|
|
||||||
m_texture->TransitionToResourceState(D3D::current_command_list, D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE);
|
m_texture->TransitionToResourceState(D3D::current_command_list, D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE);
|
||||||
srcentry->m_texture->TransitionToResourceState(D3D::current_command_list, D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE);
|
srcentry->m_texture->TransitionToResourceState(D3D::current_command_list, D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE);
|
||||||
|
|
|
@ -236,7 +236,7 @@ void TextureCacheBase::ScaleTextureCacheEntryTo(TextureCacheBase::TCacheEntryBas
|
||||||
newentry->SetDimensions((*entry)->native_width, (*entry)->native_height, 1);
|
newentry->SetDimensions((*entry)->native_width, (*entry)->native_height, 1);
|
||||||
newentry->SetHashes((*entry)->base_hash, (*entry)->hash);
|
newentry->SetHashes((*entry)->base_hash, (*entry)->hash);
|
||||||
newentry->frameCount = frameCount;
|
newentry->frameCount = frameCount;
|
||||||
newentry->is_efb_copy = false;
|
newentry->is_efb_copy = (*entry)->is_efb_copy;
|
||||||
MathUtil::Rectangle<int> srcrect, dstrect;
|
MathUtil::Rectangle<int> srcrect, dstrect;
|
||||||
srcrect.left = 0;
|
srcrect.left = 0;
|
||||||
srcrect.top = 0;
|
srcrect.top = 0;
|
||||||
|
@ -289,7 +289,6 @@ TextureCacheBase::TCacheEntryBase* TextureCacheBase::DoPartialTextureUpdates(Tex
|
||||||
|
|
||||||
// Efb copies and paletted textures are excluded from these updates, until there's an example where a game would
|
// Efb copies and paletted textures are excluded from these updates, until there's an example where a game would
|
||||||
// benefit from this. Both would require more work to be done.
|
// benefit from this. Both would require more work to be done.
|
||||||
// TODO: Implement upscaling support for normal textures, and then remove the efb to ram and the scaled efb restrictions
|
|
||||||
if (entry_to_update->IsEfbCopy()
|
if (entry_to_update->IsEfbCopy()
|
||||||
|| isPaletteTexture)
|
|| isPaletteTexture)
|
||||||
return entry_to_update;
|
return entry_to_update;
|
||||||
|
|
Loading…
Reference in New Issue