From 1fff56292971e5e030b7dc80e8610784ffaba231 Mon Sep 17 00:00:00 2001 From: Emma Anholt Date: Thu, 2 Mar 2023 13:14:01 -0800 Subject: [PATCH] glsl/lower_precision: Add actual spec quotes for "check_parameters" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Marek Olšák Part-of: --- src/compiler/glsl/lower_precision.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/compiler/glsl/lower_precision.cpp b/src/compiler/glsl/lower_precision.cpp index c07c5a8244e..132ac9c0720 100644 --- a/src/compiler/glsl/lower_precision.cpp +++ b/src/compiler/glsl/lower_precision.cpp @@ -491,13 +491,25 @@ handle_call(ir_call *ir, const struct set *lowerable_rvalues) /* Number of parameters to check if they are lowerable. */ unsigned check_parameters = ir->actual_parameters.length(); - /* Interpolation functions only consider the precision of the interpolant. */ - /* Bitfield functions ignore the precision of "offset" and "bits". */ + /* "For the interpolateAt* functions, the call will return a precision + * qualification matching the precision of the interpolant argument to the + * function call." + * + * and + * + * "The precision qualification of the value returned from bitfieldExtract() + * matches the precision qualification of the call's input argument + * “value”." + */ if (!strcmp(ir->callee_name(), "interpolateAtOffset") || !strcmp(ir->callee_name(), "interpolateAtSample") || !strcmp(ir->callee_name(), "bitfieldExtract")) { check_parameters = 1; } else if (!strcmp(ir->callee_name(), "bitfieldInsert")) { + /* "The precision qualification of the value returned from bitfieldInsert + * matches the highest precision qualification of the call's input + * arguments “base” and “insert”." + */ check_parameters = 2; }