From ca2628f89631eed9b8edfeb059ffe0963247c50e Mon Sep 17 00:00:00 2001 From: gnick79 Date: Thu, 6 Jan 2011 16:05:11 +0000 Subject: [PATCH] Changes: * Fixed a bug on Texture Converter when Copy EFB to RAM's cache is disabled, so... * ...accordingly, I revert my latest commit because now it becomes useless. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6760 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/VideoCommon/Src/RenderBase.cpp | 7 ++----- Source/Plugins/Plugin_VideoDX9/Src/Render.cpp | 6 +++--- Source/Plugins/Plugin_VideoDX9/Src/TextureConverter.cpp | 4 +--- Source/Plugins/Plugin_VideoOGL/Src/TextureConverter.cpp | 6 ++---- 4 files changed, 8 insertions(+), 15 deletions(-) diff --git a/Source/Core/VideoCommon/Src/RenderBase.cpp b/Source/Core/VideoCommon/Src/RenderBase.cpp index 72d23cdc2f..4e67c5c72f 100644 --- a/Source/Core/VideoCommon/Src/RenderBase.cpp +++ b/Source/Core/VideoCommon/Src/RenderBase.cpp @@ -152,13 +152,10 @@ bool Renderer::CalculateTargetSize(int multiplier) newEFBWidth *= multiplier; newEFBHeight *= multiplier; - s_Fulltarget_width = newEFBWidth; - s_Fulltarget_height = newEFBHeight; - if (newEFBWidth != s_target_width || newEFBHeight != s_target_height) { - s_target_width = newEFBWidth; - s_target_height = newEFBHeight; + s_Fulltarget_width = s_target_width = newEFBWidth; + s_Fulltarget_height = s_target_height = newEFBHeight; return true; } return false; diff --git a/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp b/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp index 495df4b977..9a751837ba 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp @@ -325,7 +325,7 @@ Renderer::Renderer() vp.Width = s_target_width; vp.Height = s_target_height; D3D::dev->SetViewport(&vp); - D3D::dev->Clear(0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, D3DCOLOR_ARGB(255,0,0,0), 1.0f, 0); + D3D::dev->Clear(0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, D3DCOLOR_XRGB(0,0,0), 1.0f, 0); D3D::BeginFrame(); D3D::SetRenderState(D3DRS_SCISSORTESTENABLE, true); D3D::dev->CreateOffscreenPlainSurface(s_backbuffer_width,s_backbuffer_height, D3DFMT_X8R8G8B8, D3DPOOL_SYSTEMMEM, &ScreenShootMEMSurface, NULL ); @@ -800,7 +800,7 @@ void Renderer::UpdateViewport() D3D::dev->SetRenderTarget(0, FramebufferManager::GetEFBColorRTSurface()); D3D::dev->SetDepthStencilSurface(FramebufferManager::GetEFBDepthRTSurface()); - D3D::dev->Clear(0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, D3DCOLOR_ARGB(255,0,0,0), 1.0f, 0); + D3D::dev->Clear(0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, D3DCOLOR_XRGB(0,0,0), 1.0f, 0); } } @@ -1217,7 +1217,7 @@ void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight,cons } D3D::dev->SetRenderTarget(0, FramebufferManager::GetEFBColorRTSurface()); D3D::dev->SetDepthStencilSurface(FramebufferManager::GetEFBDepthRTSurface()); - D3D::dev->Clear(0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, D3DCOLOR_ARGB(255,0,0,0), 1.0f, 0); + D3D::dev->Clear(0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, D3DCOLOR_XRGB(0,0,0), 1.0f, 0); } // Place messages on the picture, then copy it to the screen diff --git a/Source/Plugins/Plugin_VideoDX9/Src/TextureConverter.cpp b/Source/Plugins/Plugin_VideoDX9/Src/TextureConverter.cpp index 0ca4003ec6..b5d97d2a7b 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/TextureConverter.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/TextureConverter.cpp @@ -443,11 +443,9 @@ u64 EncodeToRamFromTexture(u32 address,LPDIRECT3DTEXTURE9 source_texture, u32 So int readStride = (expandedWidth * cacheBytes) / TexDecoder_GetBlockWidthInTexels(format); EncodeToRamUsingShader(texconv_shader, source_texture, scaledSource, dest_ptr, expandedWidth / samples, expandedHeight, readStride, true, bScaleByHalf > 0,1.0f); - u64 hash = 0; + u64 hash = GetHash64(dest_ptr,size_in_bytes,g_ActiveConfig.iSafeTextureCache_ColorSamples); if (g_ActiveConfig.bEFBCopyCacheEnable) { - hash = GetHash64(dest_ptr,size_in_bytes,g_ActiveConfig.iSafeTextureCache_ColorSamples); - // If the texture in RAM is already in the texture cache, do not copy it again as it has not changed. if (TextureCache::Find(address, hash)) return hash; diff --git a/Source/Plugins/Plugin_VideoOGL/Src/TextureConverter.cpp b/Source/Plugins/Plugin_VideoOGL/Src/TextureConverter.cpp index cc72f29b86..13fb372767 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/TextureConverter.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/TextureConverter.cpp @@ -371,12 +371,10 @@ u64 EncodeToRamFromTexture(u32 address,GLuint source_texture, bool bFromZBuffer, dest_ptr, expandedWidth / samples, expandedHeight, readStride, true, bScaleByHalf > 0 && !bFromZBuffer); - u64 hash = 0; + u64 hash = GetHash64(dest_ptr, size_in_bytes, + g_ActiveConfig.iSafeTextureCache_ColorSamples); if (g_ActiveConfig.bEFBCopyCacheEnable) { - hash = GetHash64(dest_ptr, size_in_bytes, - g_ActiveConfig.iSafeTextureCache_ColorSamples); - // If the texture in RAM is already in the texture cache, // do not copy it again as it has not changed. if (TextureCache::Find(address, hash))