mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-02-21 14:41:39 +00:00
Merge pull request #16761 from unknownbrackets/shader-errors
GLES: Avoid GLSL redefinition error
This commit is contained in:
commit
6c95a9d55b
@ -568,6 +568,13 @@ bool CheckGLExtensions() {
|
||||
}
|
||||
}
|
||||
|
||||
// Force off clip for a cmomon buggy Samsung version.
|
||||
if (!strcmp(versionStr, "OpenGL ES 3.2 ANGLE git hash: aa8f94c52952")) {
|
||||
// Maybe could use bugs, but for now let's just force it back off.
|
||||
// Seeing errors that gl_ClipDistance is undefined.
|
||||
gl_extensions.EXT_clip_cull_distance = false;
|
||||
}
|
||||
|
||||
ProcessGPUFeatures();
|
||||
|
||||
int error = glGetError();
|
||||
|
@ -1029,10 +1029,12 @@ bool GenerateVertexShader(const VShaderID &id, char *buffer, const ShaderLanguag
|
||||
// TODO: Actually loop in the shader. For now, we write it all out.
|
||||
// Will need to change how the data is stored to loop efficiently.
|
||||
// u_lightControl is computed in PackLightControlBits().
|
||||
p.F(" uint comp;");
|
||||
p.F(" uint type;");
|
||||
for (int i = 0; i < 4; i++) {
|
||||
p.F(" if ((u_lightControl & %du) != 0x0u) { \n", 1 << i);
|
||||
p.F(" uint comp = (u_lightControl >> 0x%02xu) & 0x3u;\n", 4 + 4 * i);
|
||||
p.F(" uint type = (u_lightControl >> 0x%02xu) & 0x3u;\n", 4 + 4 * i + 2);
|
||||
p.F(" comp = (u_lightControl >> 0x%02xu) & 0x3u;\n", 4 + 4 * i);
|
||||
p.F(" type = (u_lightControl >> 0x%02xu) & 0x3u;\n", 4 + 4 * i + 2);
|
||||
p.C(" if (type == 0x0u) {\n"); // GE_LIGHTTYPE_DIRECTIONAL
|
||||
p.F(" toLight = u_lightpos%d;\n", i);
|
||||
p.C(" } else {\n");
|
||||
|
Loading…
x
Reference in New Issue
Block a user