gpu: Fix the cicp conversion shader for ngl

The compiler was unhappy with using signed labels with an unsigned
variable in a switch. Talk about being picky.
This commit is contained in:
Matthias Clasen
2024-07-26 07:23:18 -04:00
parent d53b3f9941
commit 33131ad24d

View File

@@ -95,12 +95,12 @@ cicp_to_xyz (uint cp)
{ {
switch (cp) switch (cp)
{ {
case 1: return srgb_to_xyz; case 1u: return srgb_to_xyz;
case 5: return pal_to_xyz; case 5u: return pal_to_xyz;
case 6: return ntsc_to_xyz; case 6u: return ntsc_to_xyz;
case 9: return rec2020_to_xyz; case 9u: return rec2020_to_xyz;
case 10: return identity; case 10u: return identity;
case 12: return p3_to_xyz; case 12u: return p3_to_xyz;
default: return identity; default: return identity;
} }
} }
@@ -110,12 +110,12 @@ cicp_from_xyz (uint cp)
{ {
switch (cp) switch (cp)
{ {
case 1: return xyz_to_srgb; case 1u: return xyz_to_srgb;
case 5: return xyz_to_pal; case 5u: return xyz_to_pal;
case 6: return xyz_to_ntsc; case 6u: return xyz_to_ntsc;
case 9: return xyz_to_rec2020; case 9u: return xyz_to_rec2020;
case 10: return identity; case 10u: return identity;
case 12: return xyz_to_p3; case 12u: return xyz_to_p3;
default: return identity; default: return identity;
} }
} }
@@ -208,28 +208,28 @@ apply_cicp_eotf (vec3 color,
{ {
switch (transfer_function) switch (transfer_function)
{ {
case 1: case 1u:
case 6: case 6u:
case 14: case 14u:
case 15: case 15u:
return vec3 (bt709_eotf (color.r), return vec3 (bt709_eotf (color.r),
bt709_eotf (color.g), bt709_eotf (color.g),
bt709_eotf (color.b)); bt709_eotf (color.b));
case 8: case 8u:
return color; return color;
case 13: case 13u:
return vec3 (srgb_eotf (color.r), return vec3 (srgb_eotf (color.r),
srgb_eotf (color.g), srgb_eotf (color.g),
srgb_eotf (color.b)); srgb_eotf (color.b));
case 16: case 16u:
return vec3 (pq_eotf (color.r), return vec3 (pq_eotf (color.r),
pq_eotf (color.g), pq_eotf (color.g),
pq_eotf (color.b)); pq_eotf (color.b));
case 18: case 18u:
return vec3 (hlg_eotf (color.r), return vec3 (hlg_eotf (color.r),
hlg_eotf (color.g), hlg_eotf (color.g),
hlg_eotf (color.b)); hlg_eotf (color.b));
@@ -245,28 +245,28 @@ apply_cicp_oetf (vec3 color,
{ {
switch (transfer_function) switch (transfer_function)
{ {
case 1: case 1u:
case 6: case 6u:
case 14: case 14u:
case 15: case 15u:
return vec3 (bt709_oetf (color.r), return vec3 (bt709_oetf (color.r),
bt709_oetf (color.g), bt709_oetf (color.g),
bt709_oetf (color.b)); bt709_oetf (color.b));
case 8: case 8u:
return color; return color;
case 13: case 13u:
return vec3 (srgb_oetf (color.r), return vec3 (srgb_oetf (color.r),
srgb_oetf (color.g), srgb_oetf (color.g),
srgb_oetf (color.b)); srgb_oetf (color.b));
case 16: case 16u:
return vec3 (pq_oetf (color.r), return vec3 (pq_oetf (color.r),
pq_oetf (color.g), pq_oetf (color.g),
pq_oetf (color.b)); pq_oetf (color.b));
case 18: case 18u:
return vec3 (hlg_oetf (color.r), return vec3 (hlg_oetf (color.r),
hlg_oetf (color.g), hlg_oetf (color.g),
hlg_oetf (color.b)); hlg_oetf (color.b));