summaryrefslogtreecommitdiffstats
path: root/video/out/opengl/lcms.c
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.xyz>2017-08-27 13:40:59 +0200
committerNiklas Haas <git@haasn.xyz>2017-09-04 13:53:14 +0200
commit62f0677614ead1b094ac97b3ea1756541dcda03c (patch)
treed0a50dd78a7524c776f4d1a734e6f0e0251b2cdd /video/out/opengl/lcms.c
parent8cf5799ab1e1cb2de22636eadf3119a319161aec (diff)
downloadmpv-62f0677614ead1b094ac97b3ea1756541dcda03c.tar.bz2
mpv-62f0677614ead1b094ac97b3ea1756541dcda03c.tar.xz
vo_opengl: use rgba16 for 3DLUTs instead of rgb16
Vulkan compat. rgb16 doesn't exist on hardware anyway, might as well just generate the 3DLUT against rgba16 as well. We've decided this is the simplest way to do vulkan compatibility: just make sure we never actually need 3-component textures.
Diffstat (limited to 'video/out/opengl/lcms.c')
-rw-r--r--video/out/opengl/lcms.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/video/out/opengl/lcms.c b/video/out/opengl/lcms.c
index ca4167d544..8747ae6aa6 100644
--- a/video/out/opengl/lcms.c
+++ b/video/out/opengl/lcms.c
@@ -370,7 +370,7 @@ bool gl_lcms_get_lut3d(struct gl_lcms *p, struct lut3d **result_lut3d,
return false;
void *tmp = talloc_new(NULL);
- uint16_t *output = talloc_array(tmp, uint16_t, s_r * s_g * s_b * 3);
+ uint16_t *output = talloc_array(tmp, uint16_t, s_r * s_g * s_b * 4);
struct lut3d *lut = NULL;
cmsContext cms = NULL;
@@ -380,7 +380,7 @@ bool gl_lcms_get_lut3d(struct gl_lcms *p, struct lut3d **result_lut3d,
// because we may change the parameter in the future or make it
// customizable, same for the primaries.
char *cache_info = talloc_asprintf(tmp,
- "ver=1.3, intent=%d, size=%dx%dx%d, prim=%d, trc=%d, "
+ "ver=1.4, intent=%d, size=%dx%dx%d, prim=%d, trc=%d, "
"contrast=%d\n",
p->opts->intent, s_r, s_g, s_b, prim, trc, p->opts->contrast);
@@ -435,7 +435,7 @@ bool gl_lcms_get_lut3d(struct gl_lcms *p, struct lut3d **result_lut3d,
}
cmsHTRANSFORM trafo = cmsCreateTransformTHR(cms, vid_hprofile, TYPE_RGB_16,
- profile, TYPE_RGB_16,
+ profile, TYPE_RGBA_16,
p->opts->intent,
cmsFLAGS_HIGHRESPRECALC |
cmsFLAGS_BLACKPOINTCOMPENSATION);
@@ -454,7 +454,7 @@ bool gl_lcms_get_lut3d(struct gl_lcms *p, struct lut3d **result_lut3d,
input[r * 3 + 1] = g * 65535 / (s_g - 1);
input[r * 3 + 2] = b * 65535 / (s_b - 1);
}
- size_t base = (b * s_r * s_g + g * s_r) * 3;
+ size_t base = (b * s_r * s_g + g * s_r) * 4;
cmsDoTransform(trafo, input, output + base, s_r);
}
}