mirror of https://github.com/PCSX2/pcsx2.git
gsdx: add GStempdir wrapper to get a tempory directory
Allow to use Linux compatible code for OpenCL
This commit is contained in:
parent
2b30e7880e
commit
24eb1627e5
|
@ -292,22 +292,13 @@ void GSUtil::GetDeviceDescs(list<OCLDeviceDesc>& dl)
|
||||||
desc.name = GetDeviceUniqueName(device);
|
desc.name = GetDeviceUniqueName(device);
|
||||||
desc.version = major * 100 + minor * 10;
|
desc.version = major * 100 + minor * 10;
|
||||||
|
|
||||||
#ifdef _WIN32
|
desc.tmppath = GStempdir() + "/" + desc.name;
|
||||||
char* buff = new char[MAX_PATH + 1];
|
|
||||||
GetTempPath(MAX_PATH, buff);
|
|
||||||
desc.tmppath = string(buff) + "/" + desc.name;
|
|
||||||
|
|
||||||
GSmkdir(desc.tmppath.c_str());
|
GSmkdir(desc.tmppath.c_str());
|
||||||
|
|
||||||
sprintf(buff, "/%d", OCL_PROGRAM_VERSION);
|
desc.tmppath += "/" + std::to_string(OCL_PROGRAM_VERSION);
|
||||||
desc.tmppath += buff;
|
|
||||||
delete[] buff;
|
|
||||||
|
|
||||||
GSmkdir(desc.tmppath.c_str());
|
GSmkdir(desc.tmppath.c_str());
|
||||||
#else
|
|
||||||
// TODO: linux
|
|
||||||
ASSERT(0);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
dl.push_back(desc);
|
dl.push_back(desc);
|
||||||
}
|
}
|
||||||
|
@ -455,6 +446,17 @@ void GSmkdir(const char* dir)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string GStempdir()
|
||||||
|
{
|
||||||
|
#ifdef _WIN32
|
||||||
|
char path[MAX_PATH + 1];
|
||||||
|
GetTempPath(MAX_PATH, path);
|
||||||
|
return {path};
|
||||||
|
#else
|
||||||
|
return "/tmp";
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
const char* psm_str(int psm)
|
const char* psm_str(int psm)
|
||||||
{
|
{
|
||||||
switch(psm) {
|
switch(psm) {
|
||||||
|
|
|
@ -69,6 +69,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
void GSmkdir(const char* dir);
|
void GSmkdir(const char* dir);
|
||||||
|
std::string GStempdir();
|
||||||
|
|
||||||
const char* psm_str(int psm);
|
const char* psm_str(int psm);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue