1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-11-15 14:25:21 +01:00

Force highp precision for float and sampler2d on GLES, if supported (#16671)

This sets the default precision for float and samper2d on GLES devices that support it.
This commit is contained in:
lhofhansl
2025-11-14 09:52:55 -08:00
committed by GitHub
parent 577fc44ea9
commit 785042dc9e

View File

@@ -697,8 +697,15 @@ void ShaderSource::generateShader(ShaderInfo &shaderinfo)
<< "#define CENTROID_\n";
}
// Precision is only meaningful on GLES
shaders_header << "precision mediump float;\n"
"precision mediump sampler2D;\n";
shaders_header << R"(
#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
precision highp sampler2D;
#else
precision mediump float;
precision mediump sampler2D;
#endif
)";
} else {
assert(false);
}