]> git.sesse.net Git - movit/blobdiff - footer.comp
We've run with many more GPUs than just those three now.
[movit] / footer.comp
index 16197a63200019396c20661bc0edbb8128fad206..17175d9c717777665c0ec537d91cc95e6524c835 100644 (file)
@@ -5,6 +5,10 @@
 #define SQUARE_ROOT_TRANSFORMATION 0
 #endif
 
+#ifndef FLIP_ORIGIN
+#define FLIP_ORIGIN 0
+#endif
+
 void main()
 {
        INPUT();
@@ -22,9 +26,18 @@ void cs_output(uvec2 coord, vec4 val)
 
 void cs_output(ivec2 coord, vec4 val)
 {
+       // Run the value through any preprocessing steps we might have.
+       CS_OUTPUT_VAL = val;
+       val = CS_POSTPROC(vec2(0.0, 0.0));
+
 #if SQUARE_ROOT_TRANSFORMATION
        // Make sure we don't give negative values to sqrt.
        val.rgb = sqrt(max(val.rgb, 0.0));
 #endif
-       imageStore(outbuf, coord, val);
+
+#if FLIP_ORIGIN
+       coord.y = imageSize(tex_outbuf).y - coord.y - 1;
+#endif
+
+       imageStore(tex_outbuf, coord, val);
 }