diff options
| author | NeoBrainX <NeoBrainX@googlemail.com> | 2010-06-15 13:34:39 +0000 |
|---|---|---|
| committer | NeoBrainX <NeoBrainX@googlemail.com> | 2010-06-15 13:34:39 +0000 |
| commit | af9c26ff415abeb3da0764f68ffd68469f11996e (patch) | |
| tree | 6da09396f7669ef0b17b1656b4c91ef57afdfd24 /Source/Plugins/Plugin_VideoDX11/Src/TextureCache.cpp | |
| parent | 40d87e0f8f351fb9bdb1ddd1ff9919f7ddbd7d1a (diff) | |
DX11: Fix some corruption caused by passing the wrong pitch to UpdateSubresource.
Fix calculation of miplevels in TextureCache::Load.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5708 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Plugins/Plugin_VideoDX11/Src/TextureCache.cpp')
| -rw-r--r-- | Source/Plugins/Plugin_VideoDX11/Src/TextureCache.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/Plugins/Plugin_VideoDX11/Src/TextureCache.cpp b/Source/Plugins/Plugin_VideoDX11/Src/TextureCache.cpp index 22ac753b5c..ffa51d3109 100644 --- a/Source/Plugins/Plugin_VideoDX11/Src/TextureCache.cpp +++ b/Source/Plugins/Plugin_VideoDX11/Src/TextureCache.cpp @@ -172,7 +172,7 @@ void TextureCache::Cleanup() } } -// TODO: Verify that this actually returns the value needed below +// returns the exponent of the smallest power of two which is greater than val unsigned int GetPow2(unsigned int val) { unsigned int ret = 0; @@ -250,7 +250,7 @@ TextureCache::TCacheEntry* TextureCache::Load(unsigned int stage, u32 address, u entry.isRenderTarget = false; bool isPow2 = !((width & (width - 1)) || (height & (height - 1))); entry.isNonPow2 = false; - unsigned int TexLevels = (isPow2 && UseNativeMips && maxlevel) ? (GetPow2(max(width, height)) + 1) : ((isPow2)? 0 : 1); + unsigned int TexLevels = (isPow2 && UseNativeMips && maxlevel) ? GetPow2(max(width, height)) : ((isPow2)? 0 : 1); if (TexLevels > (maxlevel + 1) && maxlevel) TexLevels = maxlevel + 1; entry.MipLevels = maxlevel; |
