nir: Add a load_global_constant intrinsic

This has the same semantics as load_global except the memory it reads is
known to be constant so load_global_constant intrinsics can be CSEd
rather than relying on more complex copy-propagation.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6379>
This commit is contained in:
Jason Ekstrand
2020-08-29 00:59:22 -05:00
committed by Marge Bot
parent e4f07f8bdc
commit ff124e3fe3
7 changed files with 9 additions and 0 deletions
+1
View File
@@ -598,6 +598,7 @@ validate_intrinsic_instr(nir_intrinsic_instr *instr, validate_state *state)
case nir_intrinsic_load_ssbo:
case nir_intrinsic_load_shared:
case nir_intrinsic_load_global:
case nir_intrinsic_load_global_constant:
case nir_intrinsic_load_scratch:
case nir_intrinsic_load_constant:
/* These memory load operations must have alignments */