From 2e85c9a4226f718ec4768d5a84462a9f34d50326 Mon Sep 17 00:00:00 2001 From: Emma Anholt Date: Thu, 2 Mar 2023 11:46:24 -0800 Subject: [PATCH] glsl/lower_precision: Add a cut-down testcase for #8124 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This pattern is the core of the webgl conformance failure, I think. And, I think actually lower_precision was doing the right thing, just the conformance test going through ANGLE was screwing up. Reviewed-by: Marek Olšák Part-of: --- .../glsl/tests/lower_precision_test.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/compiler/glsl/tests/lower_precision_test.py b/src/compiler/glsl/tests/lower_precision_test.py index 2efee590787..3f8e5823554 100644 --- a/src/compiler/glsl/tests/lower_precision_test.py +++ b/src/compiler/glsl/tests/lower_precision_test.py @@ -2299,6 +2299,24 @@ TESTS = [ """, r'expression float \* \(expression float f162f \(var_ref a\) \) \(expression float f162f \(var_ref b\) \) '), # should be uint16_t + Test("conversion constructor precision", + """ + #version 300 es + uniform mediump uint a; + out highp float result; + + void main() + { + /* Constructors don't have a precision qualifier themselves, but + * constructors are an operation, and so they do the usual "get + * precision from my operands, or default to the precision of the + * lvalue" rule. So, the u2f is done at mediump due to a's precision. + */ + result = float(a); + } + """, + r'expression float16_t u2f \(expression uint16_t u2ump \(var_ref a\) \)'), # should be uint16_t + ]