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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user