aboutsummaryrefslogtreecommitdiffstats
path: root/src/freedreno/ir3/ir3_nir.h
diff options
context:
space:
mode:
authorConnor Abbott <[email protected]>2020-03-19 14:15:26 +0100
committerMarge Bot <[email protected]>2020-04-09 15:56:55 +0000
commit274f3815a5efaf1b82f6c2d29122f7aac2fc9a19 (patch)
treea2cf91bf7b56e061ce4317210405d224b3557dd1 /src/freedreno/ir3/ir3_nir.h
parent7d0bc13fcab225c7a129de2e18936fe197003dcc (diff)
ir3: Plumb through bindless support
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4358>
Diffstat (limited to 'src/freedreno/ir3/ir3_nir.h')
-rw-r--r--src/freedreno/ir3/ir3_nir.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/freedreno/ir3/ir3_nir.h b/src/freedreno/ir3/ir3_nir.h
index cebc9e64dd3..ee7c01b0dfa 100644
--- a/src/freedreno/ir3/ir3_nir.h
+++ b/src/freedreno/ir3/ir3_nir.h
@@ -64,4 +64,20 @@ uint32_t ir3_link_geometry_stages(const struct ir3_shader_variant *producer,
const struct ir3_shader_variant *consumer,
uint32_t *locs);
+static inline nir_intrinsic_instr *
+ir3_bindless_resource(nir_src src)
+{
+ if (!src.is_ssa)
+ return NULL;
+
+ if (src.ssa->parent_instr->type != nir_instr_type_intrinsic)
+ return NULL;
+
+ nir_intrinsic_instr *intrin = nir_instr_as_intrinsic(src.ssa->parent_instr);
+ if (intrin->intrinsic != nir_intrinsic_bindless_resource_ir3)
+ return NULL;
+
+ return intrin;
+}
+
#endif /* IR3_NIR_H_ */