mirror of
https://github.com/luanti-org/luanti.git
synced 2025-11-21 08:55: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";
|
<< "#define CENTROID_\n";
|
||||||
}
|
}
|
||||||
// Precision is only meaningful on GLES
|
// Precision is only meaningful on GLES
|
||||||
shaders_header << "precision mediump float;\n"
|
shaders_header << R"(
|
||||||
"precision mediump sampler2D;\n";
|
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
||||||
|
precision highp float;
|
||||||
|
precision highp sampler2D;
|
||||||
|
#else
|
||||||
|
precision mediump float;
|
||||||
|
precision mediump sampler2D;
|
||||||
|
#endif
|
||||||
|
)";
|
||||||
} else {
|
} else {
|
||||||
assert(false);
|
assert(false);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user