broadcom/compiler: implement nir_intrinsic_load_view_index

This is used for multiview's gl_ViewIndex built-in.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12034>
This commit is contained in:
Iago Toral Quiroga 2021-07-23 09:38:02 +02:00 committed by Marge Bot
parent 5872c7ca7b
commit d5acae3206
2 changed files with 10 additions and 0 deletions

View File

@ -3291,6 +3291,11 @@ ntq_emit_intrinsic(struct v3d_compile *c, nir_intrinsic_instr *instr)
unreachable("Should have been lowered");
break;
case nir_intrinsic_load_view_index:
ntq_store_dest(c, &instr->dest, 0,
vir_uniform(c, QUNIFORM_VIEW_INDEX, 0));
break;
default:
fprintf(stderr, "Unknown intrinsic: ");
nir_print_instr(&instr->instr, stderr);

View File

@ -325,6 +325,11 @@ enum quniform_contents {
* out-of-bounds accesses into the tile state during binning.
*/
QUNIFORM_FB_LAYERS,
/**
* Current value of gl_ViewIndex for Multiview rendering.
*/
QUNIFORM_VIEW_INDEX,
};
static inline uint32_t v3d_unit_data_create(uint32_t unit, uint32_t value)