glsl/lower_precision: split out const lowering
authorRob Clark <robdclark@chromium.org>
Wed, 5 Aug 2020 16:56:52 +0000 (09:56 -0700)
committerMarge Bot <eric+marge@anholt.net>
Wed, 5 Aug 2020 21:00:44 +0000 (21:00 +0000)
commit0a763c0c86bb9845c2eac9726690d83b82d46978
tree417220f9dc3bad3d190a84908dce81d1aea54c23
parent4f060549be47863d49ef6c8c6f5ca9016c13fb7b
glsl/lower_precision: split out const lowering

Some hw can narrow 32b const/uniform to 16b on load.. and in particular
lowering constants to 16b would break const->uniform lowering.  Allow
them to lower temps to 16b, while skipping consts.

Initially it is set to the same value as LowerPrecisionTemporaries, to
preserve the current behavior.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6189>
src/compiler/glsl/lower_precision.cpp
src/compiler/glsl/standalone.cpp
src/mesa/main/mtypes.h
src/mesa/state_tracker/st_extensions.c