diff options
| author | Lioncash <mathew1800@gmail.com> | 2015-10-19 12:00:29 -0400 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2015-10-22 08:14:43 -0400 |
| commit | c28e3affc5cde1f0ad7c092b78b740b7a5809b9d (patch) | |
| tree | 516a60a843f31c43dcd045813c198fdb1a7a6d21 /Source/Core/VideoBackends/D3D/PSTextureEncoder.cpp | |
| parent | dddc834c14fd8a46fc344772e8c0263fc03df68d (diff) | |
TextureCacheBase: Change CacheLinesPerRow to BytesPerRow
Diffstat (limited to 'Source/Core/VideoBackends/D3D/PSTextureEncoder.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/D3D/PSTextureEncoder.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Source/Core/VideoBackends/D3D/PSTextureEncoder.cpp b/Source/Core/VideoBackends/D3D/PSTextureEncoder.cpp index 736bf2f042..c337927ac9 100644 --- a/Source/Core/VideoBackends/D3D/PSTextureEncoder.cpp +++ b/Source/Core/VideoBackends/D3D/PSTextureEncoder.cpp @@ -101,7 +101,9 @@ void PSTextureEncoder::Encode(u8* dst, const TextureCache::TCacheEntryBase *text // Set up all the state for EFB encoding { - D3D11_VIEWPORT vp = CD3D11_VIEWPORT(0.f, 0.f, FLOAT(texture_entry->CacheLinesPerRow() * 8), FLOAT(texture_entry->NumBlocksY())); + const u32 words_per_row = texture_entry->BytesPerRow() / sizeof(u32); + + D3D11_VIEWPORT vp = CD3D11_VIEWPORT(0.f, 0.f, FLOAT(words_per_row), FLOAT(texture_entry->NumBlocksY())); D3D::context->RSSetViewports(1, &vp); EFBRectangle fullSrcRect; @@ -143,7 +145,7 @@ void PSTextureEncoder::Encode(u8* dst, const TextureCache::TCacheEntryBase *text VertexShaderCache::GetSimpleInputLayout()); // Copy to staging buffer - D3D11_BOX srcBox = CD3D11_BOX(0, 0, 0, texture_entry->CacheLinesPerRow() * 8, texture_entry->NumBlocksY(), 1); + D3D11_BOX srcBox = CD3D11_BOX(0, 0, 0, words_per_row, texture_entry->NumBlocksY(), 1); D3D::context->CopySubresourceRegion(m_outStage, 0, 0, 0, 0, m_out, 0, &srcBox); // Transfer staging buffer to GameCube/Wii RAM @@ -152,7 +154,7 @@ void PSTextureEncoder::Encode(u8* dst, const TextureCache::TCacheEntryBase *text CHECK(SUCCEEDED(hr), "map staging buffer (0x%x)", hr); u8* src = (u8*)map.pData; - u32 readStride = std::min(texture_entry->CacheLinesPerRow() * 32, map.RowPitch); + u32 readStride = std::min(texture_entry->BytesPerRow(), map.RowPitch); for (unsigned int y = 0; y < texture_entry->NumBlocksY(); ++y) { memcpy(dst, src, readStride); |
