mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-25 07:21:14 +01:00
Added a safer OpenCL shutdown procedure.
Fixes issue 3015. Fixes issue 3089. Fixes issue 3099. Fixes issue 3360. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6307 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
2ec3db44ed
commit
56e79aa87d
@ -188,13 +188,16 @@ cl_kernel CompileKernel(cl_program program, const char *Function)
|
|||||||
void Destroy()
|
void Destroy()
|
||||||
{
|
{
|
||||||
#if defined(HAVE_OPENCL) && HAVE_OPENCL
|
#if defined(HAVE_OPENCL) && HAVE_OPENCL
|
||||||
if(!g_context)
|
if (g_cmdq)
|
||||||
return;
|
{
|
||||||
clReleaseCommandQueue(g_cmdq);
|
clReleaseCommandQueue(g_cmdq);
|
||||||
clReleaseContext(g_context);
|
g_cmdq = NULL;
|
||||||
g_context = NULL;
|
}
|
||||||
g_cmdq = NULL;
|
if (g_context)
|
||||||
|
{
|
||||||
|
clReleaseContext(g_context);
|
||||||
|
g_context = NULL;
|
||||||
|
}
|
||||||
g_bInitialized = false;
|
g_bInitialized = false;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -127,8 +127,8 @@ void TexDecoder_OpenCL_Initialize()
|
|||||||
void TexDecoder_OpenCL_Shutdown()
|
void TexDecoder_OpenCL_Shutdown()
|
||||||
{
|
{
|
||||||
#if defined(HAVE_OPENCL) && HAVE_OPENCL && !defined(DEBUG_OPENCL)
|
#if defined(HAVE_OPENCL) && HAVE_OPENCL && !defined(DEBUG_OPENCL)
|
||||||
|
if (g_program)
|
||||||
clReleaseProgram(g_program);
|
clReleaseProgram(g_program);
|
||||||
|
|
||||||
for (int i = 0; i < GX_TF_CMPR; ++i) {
|
for (int i = 0; i < GX_TF_CMPR; ++i) {
|
||||||
if (g_DecodeParametersNative[i].kernel)
|
if (g_DecodeParametersNative[i].kernel)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user