xref: /aosp_15_r20/external/mesa3d/src/intel/compiler/intel_nir.c (revision 6104692788411f58d303aa86923a9ff6ecaded22)
1 /*
2  * Copyright (c) 2014-2023 Intel Corporation
3  * SPDX-License-Identifier: MIT
4  */
5 
6 #include "intel_nir.h"
7 
8 bool
intel_nir_pulls_at_sample(nir_shader * shader)9 intel_nir_pulls_at_sample(nir_shader *shader)
10 {
11    nir_foreach_function_impl(impl, shader) {
12       nir_foreach_block(block, impl) {
13          nir_foreach_instr(instr, block) {
14             if (instr->type != nir_instr_type_intrinsic)
15                continue;
16 
17             nir_intrinsic_instr *intrin = nir_instr_as_intrinsic(instr);
18 
19             if (intrin->intrinsic == nir_intrinsic_load_barycentric_at_sample)
20                return true;
21          }
22       }
23    }
24 
25    return false;
26 }
27 
28 
29