mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
d3d: Release shaders and fbos on shutdown.
This commit is contained in:
parent
34b1d13c29
commit
858df90dff
4 changed files with 18 additions and 0 deletions
|
@ -41,5 +41,6 @@ void * fbo_get_rtt(FBO *fbo);
|
||||||
|
|
||||||
// To get default depth and rt surface
|
// To get default depth and rt surface
|
||||||
void fbo_init();
|
void fbo_init();
|
||||||
|
void fbo_shutdown();
|
||||||
|
|
||||||
};
|
};
|
|
@ -214,6 +214,20 @@ void CompileShaders() {
|
||||||
pD3Ddevice->CreateVertexDeclaration( SoftTransVertexElements, &pSoftVertexDecl );
|
pD3Ddevice->CreateVertexDeclaration( SoftTransVertexElements, &pSoftVertexDecl );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DestroyShaders() {
|
||||||
|
if (pFramebufferVertexShader) {
|
||||||
|
pFramebufferVertexShader->Release();
|
||||||
|
}
|
||||||
|
if (pFramebufferPixelShader) {
|
||||||
|
pFramebufferPixelShader->Release();
|
||||||
|
}
|
||||||
|
if (pFramebufferVertexDecl) {
|
||||||
|
pFramebufferVertexDecl->Release();
|
||||||
|
}
|
||||||
|
if (pSoftVertexDecl) {
|
||||||
|
pSoftVertexDecl->Release();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool useVsync = false;
|
bool useVsync = false;
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,7 @@ extern IDirect3DVertexDeclaration9* pSoftVertexDecl;
|
||||||
void CompileShaders();
|
void CompileShaders();
|
||||||
bool CompilePixelShader(const char *code, LPDIRECT3DPIXELSHADER9 *pShader, ID3DXConstantTable **pShaderTable, std::string &errorMessage);
|
bool CompilePixelShader(const char *code, LPDIRECT3DPIXELSHADER9 *pShader, ID3DXConstantTable **pShaderTable, std::string &errorMessage);
|
||||||
bool CompileVertexShader(const char *code, LPDIRECT3DVERTEXSHADER9 *pShader, ID3DXConstantTable **pShaderTable, std::string &errorMessage);
|
bool CompileVertexShader(const char *code, LPDIRECT3DVERTEXSHADER9 *pShader, ID3DXConstantTable **pShaderTable, std::string &errorMessage);
|
||||||
|
void DestroyShaders();
|
||||||
void DirectxInit(HWND window);
|
void DirectxInit(HWND window);
|
||||||
|
|
||||||
#define D3DBLEND_UNK D3DSTENCILOP_FORCE_DWORD
|
#define D3DBLEND_UNK D3DSTENCILOP_FORCE_DWORD
|
||||||
|
|
|
@ -116,6 +116,8 @@ void D3D9_Resize(HWND window) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void D3D9_Shutdown() {
|
void D3D9_Shutdown() {
|
||||||
|
DX9::DestroyShaders();
|
||||||
|
DX9::fbo_shutdown();
|
||||||
device->EndScene();
|
device->EndScene();
|
||||||
device->Release();
|
device->Release();
|
||||||
d3d->Release();
|
d3d->Release();
|
||||||
|
|
Loading…
Add table
Reference in a new issue