D3D: Fix bugs in the shader cache, fixes crashes on x64. added some debugging stuff (only active in debug builds). assorted code cleanup.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4145 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard
2009-09-01 19:48:45 +00:00
parent b15320bc02
commit 2599659022
12 changed files with 151 additions and 127 deletions

View File

@ -31,11 +31,14 @@ tevhash GetCurrentTEV();
class PixelShaderCache
{
private:
struct PSCacheEntry
{
LPDIRECT3DPIXELSHADER9 shader;
int frameCount;
#ifdef _DEBUG
std::string code;
#endif
PSCacheEntry() : shader(NULL), frameCount(0) {}
void Destroy()
{
@ -47,12 +50,16 @@ class PixelShaderCache
typedef std::map<PIXELSHADERUID, PSCacheEntry> PSCache;
static PSCache PixelShaders;
static const PSCacheEntry *last_entry;
public:
static void Init();
static void Cleanup();
static void Shutdown();
static void SetShader();
#ifdef _DEBUG
static std::string GetCurrentShaderCode();
#endif
static LPDIRECT3DPIXELSHADER9 CompileCgShader(const char *pstrprogram);
};