glsl: don't lower precision of textureSize

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5746>
This commit is contained in:
Marek Olšák
2020-06-26 07:19:46 -04:00
parent 977b84652a
commit 69f7a3dac6
2 changed files with 19 additions and 0 deletions

View File

@@ -457,6 +457,10 @@ is_lowerable_builtin(ir_call *ir,
* uses lower precision. The function parameters don't matter.
*/
if (var && var->type->without_array()->is_sampler()) {
/* textureSize always returns highp. */
if (!strcmp(ir->callee_name(), "textureSize"))
return false;
return var->data.precision == GLSL_PRECISION_MEDIUM ||
var->data.precision == GLSL_PRECISION_LOW;
}