diff options
| author | Scott Mansell <phiren@gmail.com> | 2015-09-01 02:41:16 +1200 |
|---|---|---|
| committer | Scott Mansell <phiren@gmail.com> | 2015-09-05 23:37:24 +1200 |
| commit | 52948bb3ef016abd7e35e775b17b7cf3f487d49c (patch) | |
| tree | 5592f0732af5628ff02dc2a70177acf8217b16f4 /Source/Core/VideoBackends | |
| parent | a47bbee02a3d8f6f585961c15ba9e6727a64df49 (diff) | |
Cleanup and unify handling of efb copy stride.
Diffstat (limited to 'Source/Core/VideoBackends')
| -rw-r--r-- | Source/Core/VideoBackends/D3D/PSTextureEncoder.cpp | 6 | ||||
| -rw-r--r-- | Source/Core/VideoBackends/D3D/PSTextureEncoder.h | 2 | ||||
| -rw-r--r-- | Source/Core/VideoBackends/D3D/TextureCache.cpp | 4 | ||||
| -rw-r--r-- | Source/Core/VideoBackends/D3D/TextureCache.h | 2 | ||||
| -rw-r--r-- | Source/Core/VideoBackends/D3D/TextureEncoder.h | 2 | ||||
| -rw-r--r-- | Source/Core/VideoBackends/OGL/TextureCache.cpp | 4 | ||||
| -rw-r--r-- | Source/Core/VideoBackends/OGL/TextureCache.h | 2 |
7 files changed, 11 insertions, 11 deletions
diff --git a/Source/Core/VideoBackends/D3D/PSTextureEncoder.cpp b/Source/Core/VideoBackends/D3D/PSTextureEncoder.cpp index cdb7f75102..3285ff8602 100644 --- a/Source/Core/VideoBackends/D3D/PSTextureEncoder.cpp +++ b/Source/Core/VideoBackends/D3D/PSTextureEncoder.cpp @@ -87,7 +87,7 @@ void PSTextureEncoder::Shutdown() SAFE_RELEASE(m_out); } -size_t PSTextureEncoder::Encode(u8* dst, unsigned int dstFormat, +size_t PSTextureEncoder::Encode(u8* dst, unsigned int dstFormat, size_t dstStride, PEControl::PixelFormat srcFormat, const EFBRectangle& srcRect, bool isIntensity, bool scaleByHalf) { @@ -189,13 +189,13 @@ size_t PSTextureEncoder::Encode(u8* dst, unsigned int dstFormat, for (unsigned int y = 0; y < numBlocksY; ++y) { memcpy(dst, src, cacheLinesPerRow*32); - dst += bpmem.copyMipMapStrideChannels*32; + dst += dstStride; src += map.RowPitch; } D3D::context->Unmap(m_outStage, 0); - encodeSize = bpmem.copyMipMapStrideChannels*32 * numBlocksY; + encodeSize = dstStride * numBlocksY; } // Restore API diff --git a/Source/Core/VideoBackends/D3D/PSTextureEncoder.h b/Source/Core/VideoBackends/D3D/PSTextureEncoder.h index 03a501d61a..7034a17bb9 100644 --- a/Source/Core/VideoBackends/D3D/PSTextureEncoder.h +++ b/Source/Core/VideoBackends/D3D/PSTextureEncoder.h @@ -29,7 +29,7 @@ public: void Init(); void Shutdown(); - size_t Encode(u8* dst, unsigned int dstFormat, + size_t Encode(u8* dst, unsigned int dstFormat, size_t dstStride, PEControl::PixelFormat srcFormat, const EFBRectangle& srcRect, bool isIntensity, bool scaleByHalf); diff --git a/Source/Core/VideoBackends/D3D/TextureCache.cpp b/Source/Core/VideoBackends/D3D/TextureCache.cpp index de204fa2af..5616a833e2 100644 --- a/Source/Core/VideoBackends/D3D/TextureCache.cpp +++ b/Source/Core/VideoBackends/D3D/TextureCache.cpp @@ -185,7 +185,7 @@ TextureCache::TCacheEntryBase* TextureCache::CreateTexture(const TCacheEntryConf } } -void TextureCache::TCacheEntry::FromRenderTarget(u32 dstAddr, unsigned int dstFormat, +void TextureCache::TCacheEntry::FromRenderTarget(u32 dstAddr, unsigned int dstFormat, u32 dstStride, PEControl::PixelFormat srcFormat, const EFBRectangle& srcRect, bool isIntensity, bool scaleByHalf, unsigned int cbufid, const float *colmat) @@ -238,7 +238,7 @@ void TextureCache::TCacheEntry::FromRenderTarget(u32 dstAddr, unsigned int dstFo if (!g_ActiveConfig.bSkipEFBCopyToRam) { u8* dst = Memory::GetPointer(dstAddr); - size_t encoded_size = g_encoder->Encode(dst, dstFormat, srcFormat, srcRect, isIntensity, scaleByHalf); + size_t encoded_size = g_encoder->Encode(dst, dstFormat, dstStride, srcFormat, srcRect, isIntensity, scaleByHalf); size_in_bytes = (u32)encoded_size; diff --git a/Source/Core/VideoBackends/D3D/TextureCache.h b/Source/Core/VideoBackends/D3D/TextureCache.h index 608fa47044..9cd52afcf6 100644 --- a/Source/Core/VideoBackends/D3D/TextureCache.h +++ b/Source/Core/VideoBackends/D3D/TextureCache.h @@ -34,7 +34,7 @@ private: void Load(unsigned int width, unsigned int height, unsigned int expanded_width, unsigned int levels) override; - void FromRenderTarget(u32 dstAddr, unsigned int dstFormat, + void FromRenderTarget(u32 dstAddr, unsigned int dstFormat, u32 dstStride, PEControl::PixelFormat srcFormat, const EFBRectangle& srcRect, bool isIntensity, bool scaleByHalf, unsigned int cbufid, const float *colmat) override; diff --git a/Source/Core/VideoBackends/D3D/TextureEncoder.h b/Source/Core/VideoBackends/D3D/TextureEncoder.h index 7c298f3f81..a2a2a34fdb 100644 --- a/Source/Core/VideoBackends/D3D/TextureEncoder.h +++ b/Source/Core/VideoBackends/D3D/TextureEncoder.h @@ -111,7 +111,7 @@ public: virtual void Init() = 0; virtual void Shutdown() = 0; // Returns size in bytes of encoded block of memory - virtual size_t Encode(u8* dst, unsigned int dstFormat, + virtual size_t Encode(u8* dst, unsigned int dstFormat, size_t dstStride, PEControl::PixelFormat srcFormat, const EFBRectangle& srcRect, bool isIntensity, bool scaleByHalf) = 0; diff --git a/Source/Core/VideoBackends/OGL/TextureCache.cpp b/Source/Core/VideoBackends/OGL/TextureCache.cpp index 3fe28b07a1..d388da2084 100644 --- a/Source/Core/VideoBackends/OGL/TextureCache.cpp +++ b/Source/Core/VideoBackends/OGL/TextureCache.cpp @@ -213,7 +213,7 @@ void TextureCache::TCacheEntry::Load(unsigned int width, unsigned int height, TextureCache::SetStage(); } -void TextureCache::TCacheEntry::FromRenderTarget(u32 dstAddr, unsigned int dstFormat, +void TextureCache::TCacheEntry::FromRenderTarget(u32 dstAddr, unsigned int dstFormat, u32 dstStride, PEControl::PixelFormat srcFormat, const EFBRectangle& srcRect, bool isIntensity, bool scaleByHalf, unsigned int cbufid, const float *colmat) @@ -272,7 +272,7 @@ void TextureCache::TCacheEntry::FromRenderTarget(u32 dstAddr, unsigned int dstFo dstFormat, scaleByHalf, srcRect, - copyMipMapStrideChannels * 32); + dstStride); u8* dst = Memory::GetPointer(dstAddr); u64 const new_hash = GetHash64(dst,encoded_size,g_ActiveConfig.iSafeTextureCache_ColorSamples); diff --git a/Source/Core/VideoBackends/OGL/TextureCache.h b/Source/Core/VideoBackends/OGL/TextureCache.h index 1ed85b0539..b8843c4edf 100644 --- a/Source/Core/VideoBackends/OGL/TextureCache.h +++ b/Source/Core/VideoBackends/OGL/TextureCache.h @@ -41,7 +41,7 @@ private: void Load(unsigned int width, unsigned int height, unsigned int expanded_width, unsigned int level) override; - void FromRenderTarget(u32 dstAddr, unsigned int dstFormat, + void FromRenderTarget(u32 dstAddr, unsigned int dstFormat, u32 dstStride, PEControl::PixelFormat srcFormat, const EFBRectangle& srcRect, bool isIntensity, bool scaleByHalf, unsigned int cbufid, const float *colmat) override; |
