summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/D3D/TextureCache.cpp
diff options
context:
space:
mode:
authordegasus <wickmarkus@web.de>2016-12-26 20:54:37 +0100
committerdegasus <wickmarkus@web.de>2016-12-26 22:10:21 +0100
commit04f319066dd13917dc652855eec3614bc79c56f7 (patch)
treebc0fba15e955a55a7292fce4463aeee069c2e2a2 /Source/Core/VideoBackends/D3D/TextureCache.cpp
parentd07d9ba499b837568a63175c8492070d15a42963 (diff)
TextureCache: Extract BP enum check to VideoCommon.
We have TOO many video backends.
Diffstat (limited to 'Source/Core/VideoBackends/D3D/TextureCache.cpp')
-rw-r--r--Source/Core/VideoBackends/D3D/TextureCache.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/Source/Core/VideoBackends/D3D/TextureCache.cpp b/Source/Core/VideoBackends/D3D/TextureCache.cpp
index 55694dd1b8..5dbf58ffbc 100644
--- a/Source/Core/VideoBackends/D3D/TextureCache.cpp
+++ b/Source/Core/VideoBackends/D3D/TextureCache.cpp
@@ -179,7 +179,7 @@ TextureCacheBase::TCacheEntryBase* TextureCache::CreateTexture(const TCacheEntry
}
}
-void TextureCache::TCacheEntry::FromRenderTarget(u8* dst, PEControl::PixelFormat srcFormat,
+void TextureCache::TCacheEntry::FromRenderTarget(u8* dst, bool is_depth_copy,
const EFBRectangle& srcRect, bool scaleByHalf,
unsigned int cbufid, const float* colmat)
{
@@ -187,15 +187,14 @@ void TextureCache::TCacheEntry::FromRenderTarget(u8* dst, PEControl::PixelFormat
// This is because multisampled texture reads go through Load, not Sample, and the linear
// filter is ignored.
bool multisampled = (g_ActiveConfig.iMultisamples > 1);
- ID3D11ShaderResourceView* efbTexSRV = (srcFormat == PEControl::Z24) ?
+ ID3D11ShaderResourceView* efbTexSRV = is_depth_copy ?
FramebufferManager::GetEFBDepthTexture()->GetSRV() :
FramebufferManager::GetEFBColorTexture()->GetSRV();
if (multisampled && scaleByHalf)
{
multisampled = false;
- efbTexSRV = (srcFormat == PEControl::Z24) ?
- FramebufferManager::GetResolvedEFBDepthTexture()->GetSRV() :
- FramebufferManager::GetResolvedEFBColorTexture()->GetSRV();
+ efbTexSRV = is_depth_copy ? FramebufferManager::GetResolvedEFBDepthTexture()->GetSRV() :
+ FramebufferManager::GetResolvedEFBColorTexture()->GetSRV();
}
g_renderer->ResetAPIState();
@@ -239,8 +238,8 @@ void TextureCache::TCacheEntry::FromRenderTarget(u8* dst, PEControl::PixelFormat
// Create texture copy
D3D::drawShadedTexQuad(
efbTexSRV, &sourcerect, Renderer::GetTargetWidth(), Renderer::GetTargetHeight(),
- srcFormat == PEControl::Z24 ? PixelShaderCache::GetDepthMatrixProgram(multisampled) :
- PixelShaderCache::GetColorMatrixProgram(multisampled),
+ is_depth_copy ? PixelShaderCache::GetDepthMatrixProgram(multisampled) :
+ PixelShaderCache::GetColorMatrixProgram(multisampled),
VertexShaderCache::GetSimpleVertexShader(), VertexShaderCache::GetSimpleInputLayout(),
GeometryShaderCache::GetCopyGeometryShader());
@@ -251,11 +250,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)
{
g_encoder->Encode(dst, format, native_width, bytes_per_row, num_blocks_y, memory_stride,
- srcFormat, srcRect, isIntensity, scaleByHalf);
+ is_depth_copy, srcRect, isIntensity, scaleByHalf);
}
const char palette_shader[] =