diff options
| author | Markus Wick <degasus@users.noreply.github.com> | 2016-12-27 01:43:57 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-12-27 01:43:57 +0100 |
| commit | fd54d4f767ad162d6258a41e98df31a85b7d740e (patch) | |
| tree | fcd6e3dcaed1c305ac3ea021040880d796395335 /Source/Core/VideoBackends/D3D/TextureCache.cpp | |
| parent | 1af9f68240d8bcd87b684e9736da784f7740f438 (diff) | |
| parent | abf9bb170bf954220a50921a10f57eaa30e17779 (diff) | |
Merge pull request #4569 from degasus/texcache2
TextureCache: Extract BP enum check to VideoCommon.
Diffstat (limited to 'Source/Core/VideoBackends/D3D/TextureCache.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/D3D/TextureCache.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/Source/Core/VideoBackends/D3D/TextureCache.cpp b/Source/Core/VideoBackends/D3D/TextureCache.cpp index 55694dd1b8..f9057fc13f 100644 --- a/Source/Core/VideoBackends/D3D/TextureCache.cpp +++ b/Source/Core/VideoBackends/D3D/TextureCache.cpp @@ -179,23 +179,22 @@ TextureCacheBase::TCacheEntryBase* TextureCache::CreateTexture(const TCacheEntry } } -void TextureCache::TCacheEntry::FromRenderTarget(u8* dst, PEControl::PixelFormat srcFormat, - const EFBRectangle& srcRect, bool scaleByHalf, - unsigned int cbufid, const float* colmat) +void TextureCache::TCacheEntry::FromRenderTarget(bool is_depth_copy, const EFBRectangle& srcRect, + bool scaleByHalf, unsigned int cbufid, + 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); - 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[] = |
