summaryrefslogtreecommitdiffstats
path: root/video/out/gpu/user_shaders.c
diff options
context:
space:
mode:
authorJan Ekström <jeebjp@gmail.com>2019-03-11 01:00:27 +0200
committerJan Ekström <jeebjp@gmail.com>2019-03-11 01:00:27 +0200
commit199aabddcc0105b504cc8e0cb240bc3c89288c1a (patch)
treefa7eb297a8e11b5e0d9339196f23918d6a4d0b85 /video/out/gpu/user_shaders.c
parent7c565547b80fdc2a1bfdf31f9725129bcb16aa9d (diff)
parent1d0349d3b5d9a263251fcb3b0d7e135d4731bfd0 (diff)
downloadmpv-199aabddcc0105b504cc8e0cb240bc3c89288c1a.tar.bz2
mpv-199aabddcc0105b504cc8e0cb240bc3c89288c1a.tar.xz
Merge branch 'master' into pr6360
Manual changes done: * Merged the interface-changes under the already master'd changes. * Moved the hwdec-related option changes to video/decode/vd_lavc.c.
Diffstat (limited to 'video/out/gpu/user_shaders.c')
-rw-r--r--video/out/gpu/user_shaders.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/video/out/gpu/user_shaders.c b/video/out/gpu/user_shaders.c
index 446941b03f..0613eb93f6 100644
--- a/video/out/gpu/user_shaders.c
+++ b/video/out/gpu/user_shaders.c
@@ -16,6 +16,7 @@
*/
#include <assert.h>
+#include <math.h>
#include "common/msg.h"
#include "misc/ctype.h"
@@ -52,9 +53,11 @@ static bool parse_rpn_szexpr(struct bstr line, struct szexp out[MAX_SZEXP_SIZE])
case '-': exp->tag = SZEXP_OP2; exp->val.op = SZEXP_OP_SUB; continue;
case '*': exp->tag = SZEXP_OP2; exp->val.op = SZEXP_OP_MUL; continue;
case '/': exp->tag = SZEXP_OP2; exp->val.op = SZEXP_OP_DIV; continue;
+ case '%': exp->tag = SZEXP_OP2; exp->val.op = SZEXP_OP_MOD; continue;
case '!': exp->tag = SZEXP_OP1; exp->val.op = SZEXP_OP_NOT; continue;
case '>': exp->tag = SZEXP_OP2; exp->val.op = SZEXP_OP_GT; continue;
case '<': exp->tag = SZEXP_OP2; exp->val.op = SZEXP_OP_LT; continue;
+ case '=': exp->tag = SZEXP_OP2; exp->val.op = SZEXP_OP_EQ; continue;
}
if (mp_isdigit(word.start[0])) {
@@ -118,8 +121,10 @@ bool eval_szexpr(struct mp_log *log, void *priv,
case SZEXP_OP_SUB: res = op1 - op2; break;
case SZEXP_OP_MUL: res = op1 * op2; break;
case SZEXP_OP_DIV: res = op1 / op2; break;
+ case SZEXP_OP_MOD: res = fmodf(op1, op2); break;
case SZEXP_OP_GT: res = op1 > op2; break;
case SZEXP_OP_LT: res = op1 < op2; break;
+ case SZEXP_OP_EQ: res = op1 == op2; break;
default: abort();
}