Skip to content

Commit 57586d3

Browse files
authored
Merge pull request #509 from a1batross/master
src/gl: force highp on texcoord varying to avoid precision loss on Adreno
2 parents f55177c + 1543ec5 commit 57586d3

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/gl/fpe_shader.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ const char* const* fpe_VertexShader(shaderconv_need_t* need, fpe_state_t *state)
352352
if(need)
353353
t = (need->need_texs&(1<<i))?1:0;
354354
if(t) {
355-
sprintf(buff, "varying %s _gl4es_TexCoord_%d;\n", texvecsize[t-1], i);
355+
sprintf(buff, "varying highp %s _gl4es_TexCoord_%d;\n", texvecsize[t-1], i);
356356
ShadAppend(buff);
357357
headers++;
358358
if(state->texture[i].texmat) {
@@ -913,7 +913,7 @@ const char* const* fpe_FragmentShader(shaderconv_need_t* need, fpe_state_t *stat
913913
if(t && !need->need_texs&(1<<i))
914914
t = 0;
915915
if(t) {
916-
sprintf(buff, "varying %s _gl4es_TexCoord_%d;\n", texvecsize[t-1], i);
916+
sprintf(buff, "varying highp %s _gl4es_TexCoord_%d;\n", texvecsize[t-1], i);
917917
ShadAppend(buff);
918918
sprintf(buff, "uniform %s _gl4es_TexSampler_%d;\n", texsampler[t-1], i);
919919
ShadAppend(buff);

src/gl/shaderconv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,10 @@ static const char* gl4es_backSecondaryColorSource =
249249
"varying lowp vec4 _gl4es_BackSecondaryColor;\n";
250250

251251
static const char* gl4es_texcoordSource =
252-
"varying mediump vec4 _gl4es_TexCoord[%d];\n";
252+
"varying highp vec4 _gl4es_TexCoord[%d];\n";
253253

254254
static const char* gl4es_texcoordSourceAlt =
255-
"varying mediump vec4 _gl4es_TexCoord_%d;\n";
255+
"varying highp vec4 _gl4es_TexCoord_%d;\n";
256256

257257
static const char* gl4es_fogcoordSource =
258258
"varying mediump float _gl4es_FogFragCoord;\n";

0 commit comments

Comments
 (0)