summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/D3D12/TextureCache.cpp
diff options
context:
space:
mode:
authorMarkus Wick <degasus@users.noreply.github.com>2016-12-27 01:43:57 +0100
committerGitHub <noreply@github.com>2016-12-27 01:43:57 +0100
commitfd54d4f767ad162d6258a41e98df31a85b7d740e (patch)
treefcd6e3dcaed1c305ac3ea021040880d796395335 /Source/Core/VideoBackends/D3D12/TextureCache.cpp
parent1af9f68240d8bcd87b684e9736da784f7740f438 (diff)
parentabf9bb170bf954220a50921a10f57eaa30e17779 (diff)
Merge pull request #4569 from degasus/texcache2
TextureCache: Extract BP enum check to VideoCommon.
Diffstat (limited to 'Source/Core/VideoBackends/D3D12/TextureCache.cpp')
-rw-r--r--Source/Core/VideoBackends/D3D12/TextureCache.cpp23
1 files changed, 11 insertions, 12 deletions
diff --git a/Source/Core/VideoBackends/D3D12/TextureCache.cpp b/Source/Core/VideoBackends/D3D12/TextureCache.cpp
index deb3bab6e7..f30c6abd7d 100644
--- a/Source/Core/VideoBackends/D3D12/TextureCache.cpp
+++ b/Source/Core/VideoBackends/D3D12/TextureCache.cpp
@@ -229,22 +229,21 @@ TextureCacheBase::TCacheEntryBase* TextureCache::CreateTexture(const TCacheEntry
}
}
-void TextureCache::TCacheEntry::FromRenderTarget(u8* dst, PEControl::PixelFormat src_format,
- const EFBRectangle& srcRect, bool scale_by_half,
- unsigned int cbuf_id, const float* colmat)
+void TextureCache::TCacheEntry::FromRenderTarget(bool is_depth_copy, const EFBRectangle& srcRect,
+ bool scale_by_half, unsigned int cbuf_id,
+ const float* colmat)
{
// When copying at half size, in multisampled mode, resolve the color/depth buffer first.
// This is because multisampled texture reads go through Load, not Sample, and the linear
// filter is ignored.
bool multisampled = (g_ActiveConfig.iMultisamples > 1);
- D3DTexture2D* efb_tex = (src_format == PEControl::Z24) ?
- FramebufferManager::GetEFBDepthTexture() :
- FramebufferManager::GetEFBColorTexture();
+ D3DTexture2D* efb_tex = is_depth_copy ? FramebufferManager::GetEFBDepthTexture() :
+ FramebufferManager::GetEFBColorTexture();
if (multisampled && scale_by_half)
{
multisampled = false;
- efb_tex = (src_format == PEControl::Z24) ? FramebufferManager::GetResolvedEFBDepthTexture() :
- FramebufferManager::GetResolvedEFBColorTexture();
+ efb_tex = is_depth_copy ? FramebufferManager::GetResolvedEFBDepthTexture() :
+ FramebufferManager::GetResolvedEFBColorTexture();
}
// set transformation
@@ -286,8 +285,8 @@ void TextureCache::TCacheEntry::FromRenderTarget(u8* dst, PEControl::PixelFormat
// Create texture copy
D3D::DrawShadedTexQuad(
efb_tex, &sourcerect, Renderer::GetTargetWidth(), Renderer::GetTargetHeight(),
- (src_format == PEControl::Z24) ? StaticShaderCache::GetDepthMatrixPixelShader(multisampled) :
- StaticShaderCache::GetColorMatrixPixelShader(multisampled),
+ is_depth_copy ? StaticShaderCache::GetDepthMatrixPixelShader(multisampled) :
+ StaticShaderCache::GetColorMatrixPixelShader(multisampled),
StaticShaderCache::GetSimpleVertexShader(),
StaticShaderCache::GetSimpleVertexShaderInputLayout(),
StaticShaderCache::GetCopyGeometryShader(), 1.0f, 0, DXGI_FORMAT_R8G8B8A8_UNORM, false,
@@ -305,11 +304,11 @@ void TextureCache::TCacheEntry::FromRenderTarget(u8* dst, PEControl::PixelFormat
}
void TextureCache::CopyEFB(u8* dst, u32 format, u32 native_width, u32 bytes_per_row,
- u32 num_blocks_y, u32 memory_stride, PEControl::PixelFormat srcFormat,
+ u32 num_blocks_y, u32 memory_stride, bool is_depth_copy,
const EFBRectangle& srcRect, bool isIntensity, bool scaleByHalf)
{
s_encoder->Encode(dst, format, native_width, bytes_per_row, num_blocks_y, memory_stride,
- srcFormat, srcRect, isIntensity, scaleByHalf);
+ is_depth_copy, srcRect, isIntensity, scaleByHalf);
}
static const constexpr char s_palette_shader_hlsl[] =