v3dv/pipeline: take into account precision for the output_type
authorAlejandro Piñeiro <apinheiro@igalia.com>
Tue, 10 Nov 2020 11:33:37 +0000 (12:33 +0100)
committerMarge Bot <eric+marge@anholt.net>
Sat, 14 Nov 2020 15:59:02 +0000 (15:59 +0000)
commit035e21e780205bef4d922f4ae346f284397247de
treeb5a56a6458be6791f5929c76476747cf3ee7f1bc
parent7da854e1864f61d821dc51ef0dba8b465d67ee4a
v3dv/pipeline: take into account precision for the output_type

By default we are using 32bit output type for texture operations,
16bit for shadow.

With this commit we also use the precision info from the sampler (that
is assigned if SPIR-V uses RelaxedPrecision decorator), in order to
use 16bit.

This is a first step as only take into account the precision of the
deref_vars used on the texture operation.

But the decoration can be also applied to other cases, like the result
of the operation. That means that there are ways to infer that the
texture operation can operate at relaxed precision. Those cases would
be handled on following patches.

v2:
    * Add directly the return_size on the descriptor_map, instead of
      shadow/relaxed_precision.
    * Check relaxed precision for images too (Iago)
    * Handle the return size for the default sampler

v3:
    * Handle different output size for the case of not having a sampler.
    * Comment fixes (Iago)

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7545>
src/broadcom/vulkan/v3dv_pipeline.c
src/broadcom/vulkan/v3dv_private.h
src/broadcom/vulkan/v3dv_uniforms.c