diff --git a/src/compiler/nir/nir_gather_info.c b/src/compiler/nir/nir_gather_info.c index e4e355e185a..c89ea09df90 100644 --- a/src/compiler/nir/nir_gather_info.c +++ b/src/compiler/nir/nir_gather_info.c @@ -777,6 +777,10 @@ gather_intrinsic_info(nir_intrinsic_instr *instr, nir_shader *shader, BITFIELD64_BIT(FRAG_RESULT_STENCIL); break; + case nir_intrinsic_sample_mask_agx: + shader->info.outputs_written |= BITFIELD64_BIT(FRAG_RESULT_SAMPLE_MASK); + break; + case nir_intrinsic_launch_mesh_workgroups: case nir_intrinsic_launch_mesh_workgroups_with_payload_deref: { for (unsigned i = 0; i < 3; ++i) { diff --git a/src/compiler/nir/nir_intrinsics.py b/src/compiler/nir/nir_intrinsics.py index 9c431708562..e56a9827d8d 100644 --- a/src/compiler/nir/nir_intrinsics.py +++ b/src/compiler/nir/nir_intrinsics.py @@ -1696,6 +1696,17 @@ 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]) +# 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. +intrinsic("sample_mask_agx", src_comp=[1, 1]) + +# The fixed-function sample mask specified in the API (e.g. glSampleMask) +system_value("api_sample_mask_agx", 1, bit_sizes=[16]) + +# Loads the sample position array as fixed point packed into a 32-bit word +system_value("sample_positions_agx", 1, bit_sizes=[32]) + # Intel-specific query for loading from the brw_image_param struct passed # into the shader as a uniform. The variable is a deref to the image # variable. The const index specifies which of the six parameters to load.