1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-02 09:03:37 +00:00

Fix recently introduced GLES 2.0 GLSL compilation errors

This commit is contained in:
fzurita 2020-12-31 14:20:10 -05:00 committed by Sergey Lipskiy
parent ad272060f7
commit 2aa18a8ac7
2 changed files with 17 additions and 5 deletions

View File

@ -244,6 +244,9 @@ public:
"#else \n"
"# define IN attribute \n"
"# define OUT varying \n"
"#ifndef GL_FRAGMENT_PRECISION_HIGH \n"
"# define highp mediump \n"
"#endif \n"
"#endif // __VERSION \n"
;
}
@ -350,7 +353,7 @@ public:
" else \n"
" vShadeColor.rgb = vec3(fp); \n"
" } \n"
" vBaryCoords = vec4(aBaryCoords, 1.0 - aBaryCoords.x - aBaryCoords.y, 0.5f); \n"
" vBaryCoords = vec4(aBaryCoords, 1.0 - aBaryCoords.x - aBaryCoords.y, 0.5); \n"
;
}
};
@ -410,7 +413,7 @@ public:
" else \n"
" vShadeColor.rgb = vec3(fp); \n"
" } \n"
" vBaryCoords = vec4(aBaryCoords, 1.0 - aBaryCoords.x - aBaryCoords.y, 0.5f); \n"
" vBaryCoords = vec4(aBaryCoords, 1.0 - aBaryCoords.x - aBaryCoords.y, 0.5); \n"
;
}
};
@ -472,7 +475,7 @@ public:
" gl_Position = aRectPosition; \n"
" vShadeColor = uRectColor; \n"
" vShadeColorNoperspective = uRectColor; \n"
" vBaryCoords = vec4(aBaryCoords, vec2(1.0f) - aBaryCoords);\n"
" vBaryCoords = vec4(aBaryCoords, vec2(1.0) - aBaryCoords);\n"
;
}
};
@ -519,6 +522,9 @@ public:
"#else \n"
"# define IN varying \n"
"# define OUT \n"
"#ifndef GL_FRAGMENT_PRECISION_HIGH \n"
"# define highp mediump \n"
"#endif \n"
"#endif // __VERSION __ \n"
;
} else if (_glinfo.isGLESX) {
@ -940,7 +946,7 @@ public:
"highp vec2 tcData1[5]; \n"
"uniform lowp int uCvgDest; \n"
"uniform lowp int uBlendAlphaMode; \n"
"lowp float cvg;"
"lowp float cvg; \n"
;
if (config.generalEmulation.enableLegacyBlending != 0) {
@ -2826,7 +2832,7 @@ graphics::CombinerProgram * CombinerProgramBuilder::buildCombinerProgram(Combine
if (g_cycleType <= G_CYC_2CYCLE && m_useCoverage)
m_shaderCoverage->write(ssShader);
else
ssShader << "cvg = 1.0f; \n" << std::endl;
ssShader << "cvg = 1.0; \n" << std::endl;
if (bUseTextures) {

View File

@ -148,6 +148,9 @@ namespace glsl {
"#else \n"
"# define IN varying \n"
"# define OUT \n"
"#ifndef GL_FRAGMENT_PRECISION_HIGH \n"
"# define highp mediump \n"
"#endif \n"
"#endif // __VERSION __ \n"
"lowp vec4 uTestColor = vec4(4.0/255.0, 2.0/255.0, 1.0/255.0, 0.0); \n"
"uniform lowp int uEnableAlphaTest; \n"
@ -218,6 +221,9 @@ namespace glsl {
"#else \n"
"# define IN varying \n"
"# define OUT \n"
"#ifndef GL_FRAGMENT_PRECISION_HIGH \n"
"# define highp mediump \n"
"#endif \n"
"#endif // __VERSION __ \n"
"lowp vec4 uTestColor = vec4(4.0/255.0, 2.0/255.0, 1.0/255.0, 0.0); \n"
"uniform lowp int uEnableAlphaTest; \n"