diff --git a/Externals/Cg/cgD3D9.dll b/Externals/Cg/cgD3D9.dll deleted file mode 100644 index 37f4212dd7..0000000000 Binary files a/Externals/Cg/cgD3D9.dll and /dev/null differ diff --git a/Externals/Cg/cgD3D9.h b/Externals/Cg/cgD3D9.h deleted file mode 100644 index af6db1871e..0000000000 --- a/Externals/Cg/cgD3D9.h +++ /dev/null @@ -1,317 +0,0 @@ -/* - * - * Copyright (c) 2002-2010, NVIDIA Corporation. - * - * - * - * NVIDIA Corporation("NVIDIA") supplies this software to you in consideration - * of your agreement to the following terms, and your use, installation, - * modification or redistribution of this NVIDIA software constitutes - * acceptance of these terms. If you do not agree with these terms, please do - * not use, install, modify or redistribute this NVIDIA software. - * - * - * - * In consideration of your agreement to abide by the following terms, and - * subject to these terms, NVIDIA grants you a personal, non-exclusive license, - * under NVIDIA's copyrights in this original NVIDIA software (the "NVIDIA - * Software"), to use, reproduce, modify and redistribute the NVIDIA - * Software, with or without modifications, in source and/or binary forms; - * provided that if you redistribute the NVIDIA Software, you must retain the - * copyright notice of NVIDIA, this notice and the following text and - * disclaimers in all such redistributions of the NVIDIA Software. Neither the - * name, trademarks, service marks nor logos of NVIDIA Corporation may be used - * to endorse or promote products derived from the NVIDIA Software without - * specific prior written permission from NVIDIA. Except as expressly stated - * in this notice, no other rights or licenses express or implied, are granted - * by NVIDIA herein, including but not limited to any patent rights that may be - * infringed by your derivative works or by other works in which the NVIDIA - * Software may be incorporated. No hardware is licensed hereunder. - * - * - * - * THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING - * WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR ITS USE AND OPERATION - * EITHER ALONE OR IN COMBINATION WITH OTHER PRODUCTS. - * - * - * - * IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL, - * EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, LOST - * PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY OUT OF THE USE, - * REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE NVIDIA SOFTWARE, - * HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING - * NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF NVIDIA HAS BEEN ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#ifndef CGD3D9_INCLUDED -#define CGD3D9_INCLUDED - -#ifdef _WIN32 - -#pragma once - -#include "cg.h" -#include -#include - -// Set up for either Win32 import/export/lib. -#include -#ifdef CGD3D9DLL_EXPORTS -#define CGD3D9DLL_API __declspec(dllexport) -#elif defined (CG_LIB) -#define CGD3D9DLL_API -#else -#define CGD3D9DLL_API __declspec(dllimport) -#endif - -#ifndef CGD3D9ENTRY -# ifdef _WIN32 -# define CGD3D9ENTRY __cdecl -# else -# define CGD3D9ENTRY -# endif -#endif - -/*--------------------------------------------------------------------------- -// CGerrors that will be fed to cgSetError -// Use cgD3D9TranslateCGerror() to translate these errors into strings. ----------------------------------------------------------------------------*/ -enum cgD3D9Errors -{ - cgD3D9Failed = 1000, - cgD3D9DebugTrace = 1001, -}; - -/*--------------------------------------------------------------------------- -// HRESULTs specific to cgD3D9. When the CGerror is set to cgD3D9Failed -// cgD3D9GetLastError will return an HRESULT that could be one these. -// Use cgD3D9TranslateHRESULT() to translate these errors into strings. ----------------------------------------------------------------------------*/ -static const HRESULT CGD3D9ERR_NOTLOADED = MAKE_HRESULT(1, 0x877, 1); -static const HRESULT CGD3D9ERR_NODEVICE = MAKE_HRESULT(1, 0x877, 2); -static const HRESULT CGD3D9ERR_NOTSAMPLER = MAKE_HRESULT(1, 0x877, 3); -static const HRESULT CGD3D9ERR_INVALIDPROFILE = MAKE_HRESULT(1, 0x877, 4); -static const HRESULT CGD3D9ERR_NULLVALUE = MAKE_HRESULT(1, 0x877, 5); -static const HRESULT CGD3D9ERR_OUTOFRANGE = MAKE_HRESULT(1, 0x877, 6); -static const HRESULT CGD3D9ERR_NOTUNIFORM = MAKE_HRESULT(1, 0x877, 7); -static const HRESULT CGD3D9ERR_NOTMATRIX = MAKE_HRESULT(1, 0x877, 8); -static const HRESULT CGD3D9ERR_INVALIDPARAM = MAKE_HRESULT(1, 0x877, 9); - -/*--------------------------------------------------------------------------- -// Other error return values ----------------------------------------------------------------------------*/ -static const DWORD CGD3D9_INVALID_USAGE = 0xFF; - -#ifdef __cplusplus -extern "C" -{ -#endif - -#ifndef CGD3D9_EXPLICIT - -/*--------------------------------------------------------------------------- -// Minimal Interface ----------------------------------------------------------------------------*/ - -CGD3D9DLL_API DWORD CGD3D9ENTRY -cgD3D9TypeToSize( - CGtype type -); - -CGD3D9DLL_API BYTE CGD3D9ENTRY -cgD3D9ResourceToDeclUsage( - CGresource resource -); - -CGD3D9DLL_API CGbool CGD3D9ENTRY -cgD3D9GetVertexDeclaration( - CGprogram prog, - D3DVERTEXELEMENT9 decl[MAXD3DDECLLENGTH] -); - -CGD3D9DLL_API CGbool CGD3D9ENTRY -cgD3D9ValidateVertexDeclaration( - CGprogram prog, - const D3DVERTEXELEMENT9* decl -); - -/*--------------------------------------------------------------------------- -// Expanded Interface ----------------------------------------------------------------------------*/ - -/* ----- D3D Device Control ----------- */ -CGD3D9DLL_API IDirect3DDevice9 * CGD3D9ENTRY -cgD3D9GetDevice(); - -CGD3D9DLL_API HRESULT CGD3D9ENTRY -cgD3D9SetDevice( - IDirect3DDevice9* pDevice -); - -/* ----- Shader Management ----------- */ - -CGD3D9DLL_API HRESULT CGD3D9ENTRY -cgD3D9LoadProgram( - CGprogram prog, - CGbool paramShadowing, - DWORD assemFlags -); - -CGD3D9DLL_API HRESULT CGD3D9ENTRY -cgD3D9UnloadProgram( - CGprogram prog -); - -CGD3D9DLL_API CGbool CGD3D9ENTRY -cgD3D9IsProgramLoaded( - CGprogram prog -); - -CGD3D9DLL_API HRESULT CGD3D9ENTRY -cgD3D9BindProgram( - CGprogram prog -); - -/* ----- Parameter Management ----------- */ -CGD3D9DLL_API HRESULT CGD3D9ENTRY -cgD3D9SetUniform( - CGparameter param, - const void* floats -); - -CGD3D9DLL_API HRESULT CGD3D9ENTRY -cgD3D9SetUniformArray( - CGparameter param, - DWORD offset, - DWORD numItems, - const void* values -); - -CGD3D9DLL_API HRESULT CGD3D9ENTRY -cgD3D9SetUniformMatrix( - CGparameter param, - const D3DMATRIX* matrix -); - -CGD3D9DLL_API HRESULT CGD3D9ENTRY -cgD3D9SetUniformMatrixArray( - CGparameter param, - DWORD offset, - DWORD numItems, - const D3DMATRIX* matrices -); - -CGD3D9DLL_API HRESULT CGD3D9ENTRY -cgD3D9SetTexture( - CGparameter param, - IDirect3DBaseTexture9* tex -); - -CGD3D9DLL_API HRESULT CGD3D9ENTRY -cgD3D9SetSamplerState( - CGparameter param, - D3DSAMPLERSTATETYPE type, - DWORD value -); - -CGD3D9DLL_API HRESULT CGD3D9ENTRY -cgD3D9SetTextureWrapMode( - CGparameter param, - DWORD value -); - -/* ----- Parameter Management (Shadowing) ----------- */ -CGD3D9DLL_API HRESULT CGD3D9ENTRY -cgD3D9EnableParameterShadowing( - CGprogram prog, - CGbool enable -); - -CGD3D9DLL_API CGbool CGD3D9ENTRY -cgD3D9IsParameterShadowingEnabled( - CGprogram prog -); - -/* --------- Profile Options ----------------- */ -CGD3D9DLL_API CGprofile CGD3D9ENTRY -cgD3D9GetLatestVertexProfile(); - -CGD3D9DLL_API CGprofile CGD3D9ENTRY -cgD3D9GetLatestPixelProfile(); - -CGD3D9DLL_API const char * * CGD3D9ENTRY -cgD3D9GetOptimalOptions( - CGprofile profile -); - -CGD3D9DLL_API CGbool CGD3D9ENTRY -cgD3D9IsProfileSupported( - CGprofile profile -); - -/* --------- Error reporting ----------------- */ -CGD3D9DLL_API HRESULT CGD3D9ENTRY -cgD3D9GetLastError(); - -CGD3D9DLL_API const char * CGD3D9ENTRY -cgD3D9TranslateCGerror( - CGerror error -); - -CGD3D9DLL_API const char * CGD3D9ENTRY -cgD3D9TranslateHRESULT( - HRESULT hr -); - -CGD3D9DLL_API void CGD3D9ENTRY -cgD3D9EnableDebugTracing( - CGbool enable -); - -/* --------- CgFX support -------------------- */ - -CGD3D9DLL_API void CGD3D9ENTRY -cgD3D9RegisterStates( - CGcontext ctx -); - -CGD3D9DLL_API void CGD3D9ENTRY -cgD3D9SetManageTextureParameters( - CGcontext ctx, - CGbool flag -); - -CGD3D9DLL_API CGbool CGD3D9ENTRY -cgD3D9GetManageTextureParameters( - CGcontext ctx -); - -CGD3D9DLL_API IDirect3DBaseTexture9 * CGD3D9ENTRY -cgD3D9GetTextureParameter( - CGparameter param -); - -CGD3D9DLL_API void CGD3D9ENTRY -cgD3D9SetTextureParameter( - CGparameter param, - IDirect3DBaseTexture9 *tex -); - -CGD3D9DLL_API void CGD3D9ENTRY -cgD3D9UnloadAllPrograms( void ); - - -#endif - -#ifdef __cplusplus -}; -#endif - -#endif // _WIN32 - -#endif diff --git a/Externals/Cg/cgD3D9.lib b/Externals/Cg/cgD3D9.lib deleted file mode 100644 index 7a0519f994..0000000000 Binary files a/Externals/Cg/cgD3D9.lib and /dev/null differ diff --git a/Source/Core/Core/Src/HW/DVDInterface.cpp b/Source/Core/Core/Src/HW/DVDInterface.cpp index cdb2815c57..86409fa852 100644 --- a/Source/Core/Core/Src/HW/DVDInterface.cpp +++ b/Source/Core/Core/Src/HW/DVDInterface.cpp @@ -575,29 +575,29 @@ void ExecuteCommand(UDICR& _DICR) { case 0x80000000: ERROR_LOG(DVDINTERFACE, "GC-AM: READ MEDIA BOARD STATUS (80000000)"); - for (int i = 0; i < m_DILENGTH.Length / 4; i++) + for (unsigned int i = 0; i < m_DILENGTH.Length / 4; i++) Memory::Write_U32(0, m_DIMAR.Address + i * 4); break; case 0x80000040: ERROR_LOG(DVDINTERFACE, "GC-AM: READ MEDIA BOARD STATUS (2) (80000040)"); - for (int i = 0; i < m_DILENGTH.Length / 4; i++) + for (unsigned int i = 0; i < m_DILENGTH.Length / 4; i++) Memory::Write_U32(~0, m_DIMAR.Address + i * 4); Memory::Write_U32(0x00000020, m_DIMAR.Address); // DIMM SIZE, LE Memory::Write_U32(0x4743414D, m_DIMAR.Address + 4); // GCAM signature break; case 0x80000120: ERROR_LOG(DVDINTERFACE, "GC-AM: READ FIRMWARE STATUS (80000120)"); - for (int i = 0; i < m_DILENGTH.Length / 4; i++) + for (unsigned int i = 0; i < m_DILENGTH.Length / 4; i++) Memory::Write_U32(0x01010101, m_DIMAR.Address + i * 4); break; case 0x80000140: ERROR_LOG(DVDINTERFACE, "GC-AM: READ FIRMWARE STATUS (80000140)"); - for (int i = 0; i < m_DILENGTH.Length / 4; i++) + for (unsigned int i = 0; i < m_DILENGTH.Length / 4; i++) Memory::Write_U32(0x01010101, m_DIMAR.Address + i * 4); break; case 0x84000020: ERROR_LOG(DVDINTERFACE, "GC-AM: READ MEDIA BOARD STATUS (1) (84000020)"); - for (int i = 0; i < m_DILENGTH.Length / 4; i++) + for (unsigned int i = 0; i < m_DILENGTH.Length / 4; i++) Memory::Write_U32(0x00000000, m_DIMAR.Address + i * 4); break; default: diff --git a/Source/Core/InputCommon/Src/UDPWiimote.cpp b/Source/Core/InputCommon/Src/UDPWiimote.cpp index 0b20c4e84a..fc3b8603e7 100644 --- a/Source/Core/InputCommon/Src/UDPWiimote.cpp +++ b/Source/Core/InputCommon/Src/UDPWiimote.cpp @@ -277,9 +277,9 @@ void UDPWiimote::broadcastPresence() void UDPWiimote::getAccel(float &_x, float &_y, float &_z) { d->mutex.Enter(); - _x=x; - _y=y; - _z=z; + _x=(float)x; + _y=(float)y; + _z=(float)z; d->mutex.Leave(); //NOTICE_LOG(WIIMOTE,"%lf %lf %lf",_x, _y, _z); } diff --git a/Source/Core/VideoCommon/Src/Fifo.cpp b/Source/Core/VideoCommon/Src/Fifo.cpp index 166d7a027f..e833a5cf52 100644 --- a/Source/Core/VideoCommon/Src/Fifo.cpp +++ b/Source/Core/VideoCommon/Src/Fifo.cpp @@ -15,8 +15,6 @@ // Official SVN repository and contact information can be found at // http://code.google.com/p/dolphin-emu/ -#include - #include "VideoConfig.h" #include "Setup.h" #include "MemoryUtil.h" diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_AX.cpp b/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_AX.cpp index 6960465f6e..c4d5dd2fac 100644 --- a/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_AX.cpp +++ b/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_AX.cpp @@ -99,9 +99,7 @@ static void VoiceHacks(AXPB &pb) would end up outside of bounds while the block was still playing resulting in noise a strange noise. This should take care of that. */ - if ( - (sampleEnd > (0x017fffff * 2) || loopPos > (0x017fffff * 2)) // ARAM bounds in nibbles - ) + if ((sampleEnd > (0x017fffff * 2) || loopPos > (0x017fffff * 2))) // ARAM bounds in nibbles { pb.running = 0; @@ -422,7 +420,7 @@ bool CUCode_AX::AXTask(u32& _uMail) default: { static bool bFirst = true; - if (bFirst == true) + if (bFirst) { char szTemp[2048]; sprintf(szTemp, "Unknown AX-Command 0x%x (address: 0x%08x). Last valid: %02x\n", diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_AXWii.cpp b/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_AXWii.cpp index d11a56bbab..e08ad88d43 100644 --- a/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_AXWii.cpp +++ b/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_AXWii.cpp @@ -60,30 +60,32 @@ void CUCode_AXWii::HandleMail(u32 _uMail) m_rMailHandler.PushMail(DSP_RESUME); } } - else { - if ((_uMail & 0xFFFF0000) == MAIL_AX_ALIST) - { - // We are expected to get a new CmdBlock - DEBUG_LOG(DSPHLE, "GetNextCmdBlock (%ibytes)", (u16)_uMail); - } - else if (_uMail == 0xCDD10000) // Action 0 - AX_ResumeTask(); - { + else if ((_uMail & 0xFFFF0000) == MAIL_AX_ALIST) + { + // We are expected to get a new CmdBlock + DEBUG_LOG(DSPHLE, "GetNextCmdBlock (%ibytes)", (u16)_uMail); + } + else switch(_uMail) + { + case 0xCDD10000: // Action 0 - AX_ResumeTask() m_rMailHandler.PushMail(DSP_RESUME); - } - else if (_uMail == 0xCDD10001) // Action 1 - new ucode upload - { + break; + + case 0xCDD10001: // Action 1 - new ucode upload NOTICE_LOG(DSPHLE,"DSP IROM - New Ucode!"); newucodemails = 0; - } - else if (_uMail == 0xCDD10002) // Action 2 - IROM_Reset(); ( WII: De Blob, Cursed Mountain,...) - { + break; + + case 0xCDD10002: // Action 2 - IROM_Reset(); ( WII: De Blob, Cursed Mountain,...) NOTICE_LOG(DSPHLE,"DSP IROM - Reset!"); CDSPHandler::GetInstance().SetUCode(UCODE_ROM); - } - else if (_uMail == 0xCDD10003) // Action 3 - AX_GetNextCmdBlock(); - { - } - else + break; + + case 0xCDD10003: // Action 3 - AX_GetNextCmdBlock() + //TODO: Implement?? + break; + + default: { DEBUG_LOG(DSPHLE, " >>>> u32 MAIL : AXTask Mail (%08x)", _uMail); AXTask(_uMail); @@ -133,9 +135,9 @@ void CUCode_AXWii::MixAdd(short* _pBuffer, int _iSize) int left = templbuffer[i] + _pBuffer[0]; int right = temprbuffer[i] + _pBuffer[1]; if (left < -32767) left = -32767; - if (left > 32767) left = 32767; + else if (left > 32767) left = 32767; if (right < -32767) right = -32767; - if (right > 32767) right = 32767; + else if (right > 32767) right = 32767; *_pBuffer++ = left; *_pBuffer++ = right; } @@ -216,24 +218,15 @@ bool CUCode_AXWii::AXTask(u32& _uMail) break; case 0x000a: - if (wiisportsHack) // AXLIST_COMPRESSORTABLE - uAddress += 4; - else - uAddress += 8; + uAddress += wiisportsHack ? 4 : 8; // AXLIST_COMPRESSORTABLE break; case 0x000b: - if (wiisportsHack) - uAddress += 2; - else - uAddress += 10; + uAddress += wiisportsHack ? 2 : 10; break; case 0x000c: - if (wiisportsHack) - uAddress += 8; - else - uAddress += 10; + uAddress += wiisportsHack ? 8 : 10; break; case 0x000d: diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/main.cpp b/Source/Plugins/Plugin_DSP_HLE/Src/main.cpp index ef1eec7145..72703d5cf0 100644 --- a/Source/Plugins/Plugin_DSP_HLE/Src/main.cpp +++ b/Source/Plugins/Plugin_DSP_HLE/Src/main.cpp @@ -108,13 +108,13 @@ wxWindow* GetParentedWxWindow(HWND Parent) { #ifdef _WIN32 wxSetInstance((HINSTANCE)g_hInstance); -#endif wxWindow *win = new wxWindow(); -#ifdef _WIN32 win->SetHWND((WXHWND)Parent); win->AdoptAttributesFromHWND(); -#endif return win; +#else + return new wxWindow(); +#endif } #endif diff --git a/Source/Plugins/Plugin_VideoDX11/Src/D3DTexture.cpp b/Source/Plugins/Plugin_VideoDX11/Src/D3DTexture.cpp index 5003a9116b..b666c1a599 100644 --- a/Source/Plugins/Plugin_VideoDX11/Src/D3DTexture.cpp +++ b/Source/Plugins/Plugin_VideoDX11/Src/D3DTexture.cpp @@ -72,7 +72,7 @@ D3DTexture2D* D3DTexture2D::Create(unsigned int width, unsigned int height, D3D1 void D3DTexture2D::AddRef() { - ref++; + ++ref; } UINT D3DTexture2D::Release() diff --git a/Source/Plugins/Plugin_VideoDX11/Src/D3DTexture.h b/Source/Plugins/Plugin_VideoDX11/Src/D3DTexture.h index 977d399d11..ddde3719e9 100644 --- a/Source/Plugins/Plugin_VideoDX11/Src/D3DTexture.h +++ b/Source/Plugins/Plugin_VideoDX11/Src/D3DTexture.h @@ -18,7 +18,6 @@ #pragma once #include "D3DBase.h" -#include "TextureDecoder.h" namespace D3D { diff --git a/Source/Plugins/Plugin_VideoDX11/Src/D3DUtil.cpp b/Source/Plugins/Plugin_VideoDX11/Src/D3DUtil.cpp index d274d874e3..507f6a3dbb 100644 --- a/Source/Plugins/Plugin_VideoDX11/Src/D3DUtil.cpp +++ b/Source/Plugins/Plugin_VideoDX11/Src/D3DUtil.cpp @@ -481,10 +481,13 @@ void InitUtils() clearvb = CreateQuadVertexBuffer(4*sizeof(ClearVertex), cqcoords); CHECK(clearvb!=NULL, "Create vertex buffer of drawClearQuad"); SetDebugObjectName((ID3D11DeviceChild*)clearvb, "vertex buffer of drawClearQuad"); + + font.Init(); } void ShutdownUtils() { + font.Shutdown(); SAFE_RELEASE(point_copy_sampler); SAFE_RELEASE(linear_copy_sampler); SAFE_RELEASE(stqvb); diff --git a/Source/Plugins/Plugin_VideoDX11/Src/GfxState.h b/Source/Plugins/Plugin_VideoDX11/Src/GfxState.h index bbb941792a..507eb76c34 100644 --- a/Source/Plugins/Plugin_VideoDX11/Src/GfxState.h +++ b/Source/Plugins/Plugin_VideoDX11/Src/GfxState.h @@ -21,7 +21,6 @@ #include "VertexShaderGen.h" #include "PixelShaderGen.h" #include - using std::stack; namespace D3D diff --git a/Source/Plugins/Plugin_VideoDX11/Src/Render.cpp b/Source/Plugins/Plugin_VideoDX11/Src/Render.cpp index f999f6e1af..d828c8c5ec 100644 --- a/Source/Plugins/Plugin_VideoDX11/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoDX11/Src/Render.cpp @@ -229,15 +229,9 @@ static const D3D11_TEXTURE_ADDRESS_MODE d3dClamps[4] = void SetupDeviceObjects() { - HRESULT hr; - - D3D::font.Init(); - VertexLoaderManager::Init(); FBManager.Create(); - VertexShaderManager::Dirty(); - PixelShaderManager::Dirty(); - + HRESULT hr; float colmat[20]= {0.0f}; colmat[0] = colmat[5] = colmat[10] = 1.0f; D3D11_BUFFER_DESC cbdesc = CD3D11_BUFFER_DESC(20*sizeof(float), D3D11_BIND_CONSTANT_BUFFER, D3D11_USAGE_DEFAULT); @@ -284,7 +278,6 @@ void SetupDeviceObjects() CHECK(hr==S_OK, "Create blend state for Renderer::ResetAPIState"); D3D::SetDebugObjectName((ID3D11DeviceChild*)resetblendstate, "blend state for Renderer::ResetAPIState"); - // TODO: For some reason this overwrites existing resource private data... ddesc.DepthEnable = FALSE; ddesc.DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ZERO; ddesc.DepthFunc = D3D11_COMPARISON_LESS; @@ -304,15 +297,7 @@ void SetupDeviceObjects() void TeardownDeviceObjects() { - D3D::context->OMSetRenderTargets(1, &D3D::GetBackBuffer()->GetRTV(), NULL); FBManager.Destroy(); - D3D::font.Shutdown(); - TextureCache::Invalidate(false); - VertexManager::DestroyDeviceObjects(); - VertexLoaderManager::Shutdown(); - VertexShaderCache::Clear(); - PixelShaderCache::Clear(); - SAFE_RELEASE(access_efb_cbuf); SAFE_RELEASE(cleardepthstates[0]); SAFE_RELEASE(cleardepthstates[1]); diff --git a/Source/Plugins/Plugin_VideoDX11/Src/VertexShaderCache.cpp b/Source/Plugins/Plugin_VideoDX11/Src/VertexShaderCache.cpp index dbaf1f0cce..56dfcaf9e6 100644 --- a/Source/Plugins/Plugin_VideoDX11/Src/VertexShaderCache.cpp +++ b/Source/Plugins/Plugin_VideoDX11/Src/VertexShaderCache.cpp @@ -173,7 +173,6 @@ void VertexShaderCache::Init() for (k = 0;k < 32;k++) vs_constant_offset_table[C_NORMALMATRICES+k] = 568+4*k; for (k = 0;k < 64;k++) vs_constant_offset_table[C_POSTTRANSFORMMATRICES+k] = 696+4*k; for (k = 0;k < 4;k++) vs_constant_offset_table[C_DEPTHPARAMS+k] = 952+4*k; - if (!File::Exists(File::GetUserPath(D_SHADERCACHE_IDX))) File::CreateDir(File::GetUserPath(D_SHADERCACHE_IDX)); @@ -186,8 +185,7 @@ void VertexShaderCache::Init() void VertexShaderCache::Clear() { - VSCache::iterator iter = vshaders.begin(); - for (; iter != vshaders.end(); ++iter) + for (VSCache::iterator iter = vshaders.begin(); iter != vshaders.end(); ++iter) iter->second.Destroy(); vshaders.clear(); } diff --git a/Source/Plugins/Plugin_VideoDX11/Src/VertexShaderCache.h b/Source/Plugins/Plugin_VideoDX11/Src/VertexShaderCache.h index c33372b760..cb24bc4926 100644 --- a/Source/Plugins/Plugin_VideoDX11/Src/VertexShaderCache.h +++ b/Source/Plugins/Plugin_VideoDX11/Src/VertexShaderCache.h @@ -18,15 +18,9 @@ #ifndef _VERTEXSHADERCACHE_H #define _VERTEXSHADERCACHE_H -#include "D3DBase.h" - -#include -#include - #include "D3DBase.h" #include "VertexShaderGen.h" - -#include "d3dcompiler.h" +#include class VertexShaderCache { diff --git a/Source/Plugins/Plugin_VideoDX11/Src/main.cpp b/Source/Plugins/Plugin_VideoDX11/Src/main.cpp index 3622832028..93f94273f6 100644 --- a/Source/Plugins/Plugin_VideoDX11/Src/main.cpp +++ b/Source/Plugins/Plugin_VideoDX11/Src/main.cpp @@ -27,30 +27,32 @@ #include "Thread.h" #include "LogManager.h" -#include "resource.h" -#include "main.h" #include "VideoConfig.h" #include "Fifo.h" #include "OpcodeDecoding.h" -#include "TextureCache.h" #include "BPStructs.h" -#include "VertexManager.h" #include "VertexLoaderManager.h" #include "VertexShaderManager.h" #include "PixelShaderManager.h" -#include "VertexShaderCache.h" -#include "PixelShaderCache.h" #include "CommandProcessor.h" #include "PixelEngine.h" #include "OnScreenDisplay.h" +#include "VideoState.h" +#include "XFBConvert.h" +#include "Render.h" + +#include "main.h" +#include "resource.h" #include "DlgSettings.h" +#include "TextureCache.h" +#include "VertexManager.h" +#include "VertexShaderCache.h" +#include "PixelShaderCache.h" #include "D3DTexture.h" #include "D3DUtil.h" #include "W32Util/Misc.h" #include "EmuWindow.h" -#include "VideoState.h" -#include "XFBConvert.h" -#include "render.h" +#include "FBManager.h" #if defined(DEBUGFAST) @@ -222,20 +224,24 @@ void Video_Prepare() s_efbAccessRequested = FALSE; s_FifoShuttingDown = FALSE; s_swapRequested = FALSE; + + // internal interfaces Renderer::Init(); TextureCache::Init(); - BPInit(); VertexManager::Init(); + VertexShaderCache::Init(); + PixelShaderCache::Init(); + D3D::InitUtils(); + + // VideoCommon + BPInit(); Fifo_Init(); VertexLoaderManager::Init(); OpcodeDecoder_Init(); - VertexShaderCache::Init(); VertexShaderManager::Init(); - PixelShaderCache::Init(); PixelShaderManager::Init(); CommandProcessor::Init(); PixelEngine::Init(); - D3D::InitUtils(); // tell the host that the window is ready g_VideoInitialize.pCoreMessage(WM_USER_CREATE); @@ -246,19 +252,24 @@ void Shutdown() s_efbAccessRequested = FALSE; s_FifoShuttingDown = FALSE; s_swapRequested = FALSE; + + // VideoCommon CommandProcessor::Shutdown(); PixelShaderManager::Shutdown(); - PixelShaderCache::Shutdown(); VertexShaderManager::Shutdown(); - VertexShaderCache::Shutdown(); OpcodeDecoder_Shutdown(); VertexLoaderManager::Shutdown(); Fifo_Shutdown(); + + // internal interfaces + D3D::ShutdownUtils(); + PixelShaderCache::Shutdown(); + VertexShaderCache::Shutdown(); VertexManager::Shutdown(); TextureCache::Shutdown(); - D3D::ShutdownUtils(); Renderer::Shutdown(); EmuWindow::Close(); + s_PluginInitialized = false; } @@ -308,11 +319,6 @@ void VideoFifo_CheckSwapRequest() } } -inline bool addrRangesOverlap(u32 aLower, u32 aUpper, u32 bLower, u32 bUpper) -{ - return !((aLower >= bUpper) || (bLower >= aUpper)); -} - // Run from the graphics thread (from Fifo.cpp) void VideoFifo_CheckSwapRequestAt(u32 xfbAddr, u32 fbWidth, u32 fbHeight) {