Skip to content

Commit

Permalink
Merge pull request #11308 from unknownbrackets/gles-depal
Browse files Browse the repository at this point in the history
Fix direct shader depal on GLES
  • Loading branch information
hrydgard committed Aug 18, 2018
2 parents ec5b0c2 + cd98c4a commit 1f274a2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Common/FileUtil.cpp
Expand Up @@ -121,7 +121,7 @@ std::string ResolvePath(const std::string &path) {
if (hFile == INVALID_HANDLE_VALUE) { if (hFile == INVALID_HANDLE_VALUE) {
wcscpy_s(buf, BUF_SIZE - 1, input.c_str()); wcscpy_s(buf, BUF_SIZE - 1, input.c_str());
} else { } else {
int result = GetFinalPathNameByHandle(hFile, buf, BUF_SIZE - 1, FILE_NAME_NORMALIZED | VOLUME_NAME_DOS); int result = getFinalPathNameByHandleW(hFile, buf, BUF_SIZE - 1, FILE_NAME_NORMALIZED | VOLUME_NAME_DOS);
if (result >= BUF_SIZE || result == 0) if (result >= BUF_SIZE || result == 0)
wcscpy_s(buf, BUF_SIZE - 1, input.c_str()); wcscpy_s(buf, BUF_SIZE - 1, input.c_str());
} }
Expand Down
14 changes: 3 additions & 11 deletions Core/Config.cpp
Expand Up @@ -1210,18 +1210,10 @@ void Config::AddRecent(const std::string &file) {
if (iMaxRecent <= 0) if (iMaxRecent <= 0)
return; return;


const std::string filename = File::ResolvePath(file); // We'll add it back below. This makes sure it's at the front, and only once.
for (auto iter = recentIsos.begin(); iter != recentIsos.end();) { RemoveRecent(file);
const std::string recent = File::ResolvePath(*iter);
if (filename == recent) {
// Note that the increment-erase idiom doesn't work with vectors.
iter = recentIsos.erase(iter);
// We'll add it back below.
} else {
iter++;
}
}


const std::string filename = File::ResolvePath(file);
recentIsos.insert(recentIsos.begin(), filename); recentIsos.insert(recentIsos.begin(), filename);
if ((int)recentIsos.size() > iMaxRecent) if ((int)recentIsos.size() > iMaxRecent)
recentIsos.resize(iMaxRecent); recentIsos.resize(iMaxRecent);
Expand Down
2 changes: 1 addition & 1 deletion GPU/GLES/FragmentShaderGeneratorGLES.cpp
Expand Up @@ -359,7 +359,7 @@ bool GenerateFragmentShader(const FShaderID &id, char *buffer, uint64_t *uniform
} else { } else {
WRITE(p, " vec2 uv = %s.xy;\n vec2 uv_round;\n", texcoord); WRITE(p, " vec2 uv = %s.xy;\n vec2 uv_round;\n", texcoord);
} }
WRITE(p, " vec2 tsize = textureSize(tex, 0);\n"); WRITE(p, " vec2 tsize = vec2(textureSize(tex, 0));\n");
WRITE(p, " vec2 fraction;\n"); WRITE(p, " vec2 fraction;\n");
WRITE(p, " bool bilinear = (u_depal >> 31) != 0;\n"); WRITE(p, " bool bilinear = (u_depal >> 31) != 0;\n");
WRITE(p, " if (bilinear) {\n"); WRITE(p, " if (bilinear) {\n");
Expand Down

0 comments on commit 1f274a2

Please sign in to comment.