Committing some cleanups by avindra:

- fix numerous warnings
- make some variables unsigned
- remove redundant code and header inclusions
- make code more compact in lots of cases

Committing some additional changes by myself:
- additional header cleanups
- cleanup DX11 initialization/shutdown process (hinted at by avindra)
- Remove the cgD3D9 stuff from Externals since it's no longer needed

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5903 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
NeoBrainX 2010-07-18 10:11:34 +00:00
parent b0041f00a3
commit da4c3a5f29
17 changed files with 73 additions and 417 deletions

Binary file not shown.

317
Externals/Cg/cgD3D9.h vendored
View file

@ -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 <d3d9.h>
#include <d3dx9.h>
// Set up for either Win32 import/export/lib.
#include <windows.h>
#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

Binary file not shown.

View file

@ -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:

View file

@ -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);
}

View file

@ -15,8 +15,6 @@
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#include <string.h>
#include "VideoConfig.h"
#include "Setup.h"
#include "MemoryUtil.h"

View file

@ -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",

View file

@ -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:

View file

@ -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

View file

@ -72,7 +72,7 @@ D3DTexture2D* D3DTexture2D::Create(unsigned int width, unsigned int height, D3D1
void D3DTexture2D::AddRef()
{
ref++;
++ref;
}
UINT D3DTexture2D::Release()

View file

@ -18,7 +18,6 @@
#pragma once
#include "D3DBase.h"
#include "TextureDecoder.h"
namespace D3D
{

View file

@ -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);

View file

@ -21,7 +21,6 @@
#include "VertexShaderGen.h"
#include "PixelShaderGen.h"
#include <stack>
using std::stack;
namespace D3D

View file

@ -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]);

View file

@ -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();
}

View file

@ -18,15 +18,9 @@
#ifndef _VERTEXSHADERCACHE_H
#define _VERTEXSHADERCACHE_H
#include "D3DBase.h"
#include <map>
#include <string>
#include "D3DBase.h"
#include "VertexShaderGen.h"
#include "d3dcompiler.h"
#include <map>
class VertexShaderCache
{

View file

@ -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)
{