Commit 2c49cdc0 authored by Niklas Haas's avatar Niklas Haas
Browse files

shaders/custom: fix COMPUTE parsing

In the switch to `pl_str_parse_int`, we forgot to actually strip the
line before and after parsing.

Additionally, `out->is_compute` was accidentally never set to true.
parent c290d27d
......@@ -409,9 +409,11 @@ static bool parse_hook(struct pl_context *ctx, pl_str *body,
}
if (pl_str_eatstart0(&line, "COMPUTE")) {
line = pl_str_strip(line);
bool ok = pl_str_parse_int(pl_str_split_char(line, ' ', &line), &out->block_w) &&
pl_str_parse_int(pl_str_split_char(line, ' ', &line), &out->block_h);
line = pl_str_strip(line);
if (ok && line.len) {
ok = pl_str_parse_int(pl_str_split_char(line, ' ', &line), &out->threads_w) &&
pl_str_parse_int(pl_str_split_char(line, ' ', &line), &out->threads_h) &&
......@@ -425,6 +427,8 @@ static bool parse_hook(struct pl_context *ctx, pl_str *body,
pl_err(log, "Error while parsing COMPUTE!");
return false;
}
out->is_compute = true;
continue;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment