Cached the compiled OpenCL kernels to disk (User/OpenCL/kernel.bin). This reduces the start up delay in OpenCL mode. Added a 10 byte header to the file which contains the current svn rev string. This will recompile the OpenCL kernels with every new revision.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6608 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
skidau
2010-12-19 11:03:09 +00:00
parent ef0762c6a5
commit 9114c96c78
2 changed files with 135 additions and 14 deletions

View File

@ -150,10 +150,10 @@ cl_program CompileProgram(const char *Kernel)
cl_program program;
program = clCreateProgramWithSource(OpenCL::g_context, 1,
(const char **) & Kernel, NULL, &err);
if (!program)
{
HandleCLError(err, "Error: Failed to create compute program!");
return NULL;
}
// Build the program executable
@ -181,7 +181,7 @@ cl_program CompileProgram(const char *Kernel)
return NULL;
}
NOTICE_LOG(COMMON, "OpenCL CompileProgram took %.3f seconds",
INFO_LOG(COMMON, "OpenCL CompileProgram took %.3f seconds",
(float)(Common::Timer::GetTimeMs() - compileStart) / 1000.0);
return program;
}
@ -200,7 +200,7 @@ cl_kernel CompileKernel(cl_program program, const char *Function)
HandleCLError(err, buffer);
return NULL;
}
NOTICE_LOG(COMMON, "OpenCL CompileKernel took %.3f seconds",
INFO_LOG(COMMON, "OpenCL CompileKernel took %.3f seconds",
(float)(Common::Timer::GetTimeMs() - compileStart) / 1000.0);
return kernel;
}