glsl/lower_precision: Add a unit test that I thought we might fail at.

If you lowered precision too late, it would be easy to break this.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21666>
This commit is contained in:
Emma Anholt 2023-03-02 10:25:31 -08:00 committed by Marge Bot
parent 9a2d66f5a5
commit 41be2caa6d

View file

@ -2287,6 +2287,18 @@ TESTS = [
""",
r'\(expression vec4 \* \(swiz xxxx \(var_ref a\) \)\(expression float f162f \(var_ref b\) \) \)'),
Test("respect copies",
"""
uniform mediump float a, b;
void main()
{
highp float x = a;
gl_FragColor.x = x * b;
}
""",
r'expression float \* \(expression float f162f \(var_ref a\) \) \(expression float f162f \(var_ref b\) \) '), # should be uint16_t
]