nir: add new VARYING_SLOTs and shader info for packed 16-bit varyings

This allows mediump inputs and outputs to be trivially lowered into packed
16-bit varyings where 1 slot is occupied by 2 16-bit vec4s, without any
packing instructions in NIR and without any conflicts with 32-bit varyings.

The only thing that is changed is IO semantics in intrinsics to get packed
16-bit varyings.

This simplifies supporting 16-bit types for drivers that have 32-bit slots
everywhere except the fragment shader where they can do 16-bit interpolation
on either the low or high half of each slot.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9050>
This commit is contained in:
Marek Olšák
2021-02-09 10:58:51 -05:00
committed by Marge Bot
parent 5f7c7c9a7f
commit 73f532e5bf
5 changed files with 109 additions and 10 deletions

View File

@@ -152,6 +152,15 @@ typedef struct shader_info {
/* Which system values are actually read */
BITSET_DECLARE(system_values_read, SYSTEM_VALUE_MAX);
/* Which 16-bit inputs and outputs are used corresponding to
* VARYING_SLOT_VARn_16BIT.
*/
uint16_t inputs_read_16bit;
uint16_t outputs_written_16bit;
uint16_t outputs_read_16bit;
uint16_t inputs_read_indirectly_16bit;
uint16_t outputs_accessed_indirectly_16bit;
/* Which patch inputs are actually read */
uint32_t patch_inputs_read;
/* Which patch outputs are actually written */