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
|
||||
void fbo_init();
|
||||
void fbo_shutdown();
|
||||
|
||||
};
|
|
@ -214,6 +214,20 @@ void CompileShaders() {
|
|||
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;
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@ extern IDirect3DVertexDeclaration9* pSoftVertexDecl;
|
|||
void CompileShaders();
|
||||
bool CompilePixelShader(const char *code, LPDIRECT3DPIXELSHADER9 *pShader, ID3DXConstantTable **pShaderTable, std::string &errorMessage);
|
||||
bool CompileVertexShader(const char *code, LPDIRECT3DVERTEXSHADER9 *pShader, ID3DXConstantTable **pShaderTable, std::string &errorMessage);
|
||||
void DestroyShaders();
|
||||
void DirectxInit(HWND window);
|
||||
|
||||
#define D3DBLEND_UNK D3DSTENCILOP_FORCE_DWORD
|
||||
|
|
|
@ -116,6 +116,8 @@ void D3D9_Resize(HWND window) {
|
|||
}
|
||||
|
||||
void D3D9_Shutdown() {
|
||||
DX9::DestroyShaders();
|
||||
DX9::fbo_shutdown();
|
||||
device->EndScene();
|
||||
device->Release();
|
||||
d3d->Release();
|
||||
|
|
Loading…
Add table
Reference in a new issue