nir: add nir_export_amd intrinsic
authorQiang Yu <yuq825@gmail.com>
Mon, 19 Dec 2022 03:03:54 +0000 (11:03 +0800)
committerMarge Bot <emma+marge@anholt.net>
Fri, 3 Feb 2023 12:27:43 +0000 (12:27 +0000)
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20691>

src/compiler/nir/nir_intrinsics.py

index 34b3d2b..9e47389 100644 (file)
@@ -275,6 +275,9 @@ index("unsigned", "value_id")
 # Whether to sign-extend offsets in address arithmatic (else zero extend)
 index("bool", "sign_extend")
 
+# Instruction specific flags
+index("unsigned", "flags")
+
 intrinsic("nop", flags=[CAN_ELIMINATE])
 
 intrinsic("convert_alu_types", dest_comp=0, src_comp=[0],
@@ -1546,6 +1549,12 @@ system_value("lds_ngg_scratch_base_amd", 1)
 # LDS offset for NGG GS shader vertex emit
 system_value("lds_ngg_gs_out_vertex_base_amd", 1)
 
+# AMD GPU shader output export instruction
+# src[] = { export_value }
+# BASE = export target
+# FLAGS = AC_EXP_FLAG_*
+intrinsic("export_amd", [0], indices=[BASE, WRITE_MASK, FLAGS])
+
 # V3D-specific instrinc for tile buffer color reads.
 #
 # The hardware requires that we read the samples and components of a pixel