In practice, we haven't _actually_ supported this since we used integers
in ResampleEffect (and ResampleEffect is a pretty central effect),
so let's be honest with ourselves. (Also, we will soon start using arrays
in some cases, which are cumbersome pre-1.30.) I don't know of any drivers
that support all the other stuff we want but not GLSL 1.30 anyway;
it came with OpenGL 3.0, in 2008.
This actually isn't an ABI break, at least not on the C++ level.
-// GLSL pre-1.30 doesn't support token pasting. Replace PREFIX(x) with <effect_id>_x.
+// ESSL doesn't support token pasting. Replace PREFIX(x) with <effect_id>_x.
string replace_prefix(const string &text, const string &prefix)
{
string output;
string replace_prefix(const string &text, const string &prefix)
{
string output;
+++ /dev/null
-void main()
-{
- vec4 color = INPUT(tc);
-#if YCBCR_OUTPUT_PLANAR
- gl_FragData[0] = color.rrra;
- gl_FragData[1] = color.ggga;
- gl_FragData[2] = color.bbba;
-#elif YCBCR_OUTPUT_SPLIT_Y_AND_CBCR
- gl_FragData[0] = color.rrra;
- gl_FragData[1] = color.gbba;
-#else
- gl_FragColor = color;
-#endif
-}
+++ /dev/null
-#ifdef GL_ES
-precision highp float;
-#endif
-
-#ifdef GL_EXT_gpu_shader4
-// We sometimes want round().
-#extension GL_EXT_gpu_shader4 : enable
-#endif
-
-varying vec2 tc;
-
-vec4 tex2D(sampler2D s, vec2 coord)
-{
- return texture2D(s, coord);
-}
}
// Find out what shader model we should compile for.
}
// Find out what shader model we should compile for.
+ // We need at least 1.30, due to use of (among others) integers.
if (epoxy_is_desktop_gl()) {
if (epoxy_is_desktop_gl()) {
- if (get_glsl_version() >= 1.30) {
- movit_shader_model = MOVIT_GLSL_130;
- } else {
- movit_shader_model = MOVIT_GLSL_110;
+ if (get_glsl_version() < 1.30f) {
+ fprintf(stderr, "Movit system requirements: Needs at least GLSL version 1.30 (has version %.1f)\n",
+ get_glsl_version());
+ return false;
+ movit_shader_model = MOVIT_GLSL_130;
} else {
movit_shader_model = MOVIT_ESSL_300;
}
} else {
movit_shader_model = MOVIT_ESSL_300;
}
// What shader model we are compiling for. This only affects the choice
// of a few files (like header.frag); most of the shaders are the same.
enum MovitShaderModel {
// What shader model we are compiling for. This only affects the choice
// of a few files (like header.frag); most of the shaders are the same.
enum MovitShaderModel {
+ MOVIT_GLSL_110, // No longer in use, but kept until next ABI break in order not to change the enums.
MOVIT_GLSL_130,
MOVIT_ESSL_300
};
MOVIT_GLSL_130,
MOVIT_ESSL_300
};
register_float("offset", &offset);
register_float("zoom", &zoom);
register_uniform_sampler2d("sample_tex", &uniform_sample_tex);
register_float("offset", &offset);
register_float("zoom", &zoom);
register_uniform_sampler2d("sample_tex", &uniform_sample_tex);
- register_uniform_int("num_samples", &uniform_num_samples); // FIXME: What about GLSL pre-1.30?
+ register_uniform_int("num_samples", &uniform_num_samples);
register_uniform_float("num_loops", &uniform_num_loops);
register_uniform_float("slice_height", &uniform_slice_height);
register_uniform_float("sample_x_scale", &uniform_sample_x_scale);
register_uniform_float("num_loops", &uniform_num_loops);
register_uniform_float("slice_height", &uniform_slice_height);
register_uniform_float("sample_x_scale", &uniform_sample_x_scale);
string read_version_dependent_file(const string &base, const string &extension)
{
string read_version_dependent_file(const string &base, const string &extension)
{
- if (movit_shader_model == MOVIT_GLSL_110) {
- return read_file(base + "." + extension);
- } else if (movit_shader_model == MOVIT_GLSL_130) {
+ if (movit_shader_model == MOVIT_GLSL_130) {
return read_file(base + ".130." + extension);
} else if (movit_shader_model == MOVIT_ESSL_300) {
return read_file(base + ".300es." + extension);
return read_file(base + ".130." + extension);
} else if (movit_shader_model == MOVIT_ESSL_300) {
return read_file(base + ".300es." + extension);
// changes, even within git versions. There is no specific version
// documentation outside the regular changelogs, though.
// changes, even within git versions. There is no specific version
// documentation outside the regular changelogs, though.
#endif // !defined(_MOVIT_VERSION_H)
#endif // !defined(_MOVIT_VERSION_H)