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:
@@ -985,10 +985,12 @@ print_intrinsic_instr(nir_intrinsic_instr *instr, print_state *state)
|
||||
}
|
||||
fprintf(fp, ")");
|
||||
}
|
||||
if (state->shader->info.stage == MESA_SHADER_FRAGMENT &&
|
||||
nir_intrinsic_io_semantics(instr).medium_precision) {
|
||||
if (nir_intrinsic_io_semantics(instr).medium_precision) {
|
||||
fprintf(fp, " mediump");
|
||||
}
|
||||
if (nir_intrinsic_io_semantics(instr).high_16bits) {
|
||||
fprintf(fp, " high_16bits");
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
Reference in New Issue
Block a user