]> git.sesse.net Git - movit/commitdiff
Remove support for GLSL 1.10.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 4 Oct 2015 00:05:33 +0000 (02:05 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 4 Oct 2015 00:05:33 +0000 (02:05 +0200)
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.

effect_chain.cpp
footer.frag [deleted file]
header.frag [deleted file]
init.cpp
init.h
resample_effect.cpp
util.cpp
version.h

index 8d030c287a483e72fc7fd7d4898dd1b0cfabd056..5c4b52246b255738b2c8b764c13c12547e215ef1 100644 (file)
@@ -208,7 +208,7 @@ Effect *EffectChain::add_effect(Effect *effect, const vector<Effect *> &inputs)
        return effect;
 }
 
        return effect;
 }
 
-// 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;
diff --git a/footer.frag b/footer.frag
deleted file mode 100644 (file)
index c140b46..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-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
-}
diff --git a/header.frag b/header.frag
deleted file mode 100644 (file)
index 44ce5b4..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#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);
-}
index f9e7f1580a91e44be43aaef306e0b10823a4f468..5b8da897271e8cf6b282cf153759bb8666e47a53 100644 (file)
--- a/init.cpp
+++ b/init.cpp
@@ -428,12 +428,14 @@ bool init_movit(const string& data_directory, MovitDebugLevel debug_level)
        }
 
        // 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;
        }
diff --git a/init.h b/init.h
index 3ecc29b6270242c4fb43390c75bc15de3fd646c5..5cede57ffb909541c0493ed8479ff36798d7c58a 100644 (file)
--- a/init.h
+++ b/init.h
@@ -73,7 +73,7 @@ extern bool movit_timer_queries_supported;
 // 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,
+       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
 };
index 85c6b06f01c519caf82e1f70b00bd7c49aedc4e9..958ed25b9c035a9ca1ad59109294b9cc96ed97ff 100644 (file)
@@ -453,7 +453,7 @@ SingleResamplePassEffect::SingleResamplePassEffect(ResampleEffect *parent)
        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);
index 59f1dcdd67529ef9b4fd54f959fdc49bdc41d633..c2ac59301778906894410cb27971ea4956289e56 100644 (file)
--- a/util.cpp
+++ b/util.cpp
@@ -126,9 +126,7 @@ string read_file(const string &filename)
 
 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);
index 5a08560056997864d8de0641e423c4a90ad86297..782bfeecc029f4317842eff6465c8026a08dd518 100644 (file)
--- a/version.h
+++ b/version.h
@@ -5,6 +5,6 @@
 // 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.
 
-#define MOVIT_VERSION 6
+#define MOVIT_VERSION 7
 
 #endif // !defined(_MOVIT_VERSION_H)
 
 #endif // !defined(_MOVIT_VERSION_H)