Commit 6e60a030 authored by Niklas Haas's avatar Niklas Haas
Browse files

shaders/colorspace: micro-optimize for no-op decode

Optimizes for RGB content, especially overlays.
parent 2440a902
......@@ -45,6 +45,7 @@ void pl_shader_decode_color(struct pl_shader *sh, struct pl_color_repr *repr,
enum pl_color_system orig_sys = repr->sys;
struct pl_transform3x3 tr = pl_color_repr_decode(repr, params);
if (memcmp(&tr, &pl_transform3x3_identity, sizeof(tr))) {
ident_t cmat = sh_var(sh, (struct pl_shader_var) {
.var = pl_var_mat3("cmat"),
.data = PL_TRANSPOSE_3X3(tr.mat.m),
......@@ -56,6 +57,7 @@ void pl_shader_decode_color(struct pl_shader *sh, struct pl_color_repr *repr,
});
GLSL("color.rgb = %s * color.rgb + %s;\n", cmat, cmat_c);
}
switch (orig_sys) {
case PL_COLOR_SYSTEM_BT_2020_C:
......
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