From ec2ab7d7713492b74fbe12a5b77810214ec82765 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Thu, 17 Aug 2023 10:34:47 -0400 Subject: [PATCH] nir: Add load_sysval_agx intrinsic For merging shader stages, it will be useful to express a load from an explicit GL "descriptor set", so we can represent things like UBO loads with merged shaders where UBOs can come from either stage. To do so, we add an intrinsic representing a load from the driver's uniform tables, indexed like "descriptor sets" with "bindings". In principle, a layered GL-on-Vulkan implementation would use literal descriptor sets for each stage, so I feel comfortable with the analogy here. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/compiler/nir/nir_intrinsics.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/compiler/nir/nir_intrinsics.py b/src/compiler/nir/nir_intrinsics.py index 782e0878c7a..eb8cc34a597 100644 --- a/src/compiler/nir/nir_intrinsics.py +++ b/src/compiler/nir/nir_intrinsics.py @@ -1744,6 +1744,11 @@ intrinsic("load_ubo_base_agx", src_comp=[1], dest_comp=1, bit_sizes=[64], intrinsic("load_vbo_base_agx", src_comp=[1], dest_comp=1, bit_sizes=[64], flags=[CAN_ELIMINATE, CAN_REORDER]) +# Load a driver-internal system value from a given system value set at a given +# binding within the set. This is used for correctness when lowering things like +# UBOs with merged shaders. +load("sysval_agx", [], [DESC_SET, BINDING], [CAN_REORDER, CAN_ELIMINATE]) + # Write out a sample mask for a targeted subset of samples, specified in the two # masks. Maps to the corresponding AGX instruction, the actual workings are # documented elsewhere as they are too complicated for this comment.