broadcom/compiler: support nir_intrinsic_load_sample_id
authorArcady Goldmints-Orlov <agoldmints@igalia.com>
Sat, 25 Jul 2020 20:20:02 +0000 (15:20 -0500)
committerMarge Bot <eric+marge@anholt.net>
Thu, 20 Aug 2020 20:14:14 +0000 (20:14 +0000)
This adds support for the intrinsic as well as the vir_SAMPID
instruction that corresponds to it in vir.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6356>

src/broadcom/compiler/nir_to_vir.c
src/broadcom/compiler/v3d_compiler.h

index 31160314730c53b1a4d061fc749d542789dc6cda..e48db957bfb149a100ea5dd1feee22d842eb559b 100644 (file)
@@ -2392,6 +2392,10 @@ ntq_emit_intrinsic(struct v3d_compile *c, nir_intrinsic_instr *instr)
                                vir_uniform(c, QUNIFORM_FB_LAYERS, 0));
                 break;
 
+        case nir_intrinsic_load_sample_id:
+                ntq_store_dest(c, &instr->dest, 0, vir_SAMPID(c));
+                break;
+
         default:
                 fprintf(stderr, "Unknown intrinsic: ");
                 nir_print_instr(&instr->instr, stderr);
index 0026dd2fef34d847fabfacb15937bb06425e4312..9061a095bd02131e08a20509f59c086dd1c5d594 100644 (file)
@@ -1084,6 +1084,7 @@ VIR_A_ALU0(YCD)
 VIR_A_ALU0(MSF)
 VIR_A_ALU0(REVF)
 VIR_A_ALU0(BARRIERID)
+VIR_A_ALU0(SAMPID)
 VIR_A_NODST_1(VPMSETUP)
 VIR_A_NODST_0(VPMWT)
 VIR_A_ALU2(FCMP)