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

More minor shader cleanups

This commit is contained in:
sfan5
2025-11-12 17:48:36 +01:00
parent 4cbe7b2597
commit 00eea43131
7 changed files with 36 additions and 38 deletions

View File

@@ -696,6 +696,9 @@ void ShaderSource::generateShader(ShaderInfo &shaderinfo)
shaders_header << "#version 100\n"
<< "#define CENTROID_\n";
}
// Precision is only meaningful on GLES
shaders_header << "precision mediump float;\n"
"precision mediump sampler2D;\n";
} else {
assert(false);
}
@@ -708,8 +711,6 @@ void ShaderSource::generateShader(ShaderInfo &shaderinfo)
// cf. EVertexAttributes.h for the predefined ones
vertex_header = R"(
precision mediump float;
uniform highp mat4 mWorldView;
uniform highp mat4 mWorldViewProj;
uniform mediump mat4 mTexture;
@@ -732,9 +733,7 @@ void ShaderSource::generateShader(ShaderInfo &shaderinfo)
// normally expects, so we need to take that into account.
vertex_header += "#define inVertexColor (inVertexColor.bgra)\n";
fragment_header = R"(
precision mediump float;
)";
fragment_header = "";
if (use_glsl3) {
fragment_header += "#define VARYING_ in\n"
"#define gl_FragColor outFragColor\n"