diff options
author | Eric Anholt <eric@anholt.net> | 2016-08-05 17:10:18 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2016-08-19 13:11:36 -0700 |
commit | c35f9792202c4450d19c5616e2a38b9e81e418fe (patch) | |
tree | 58ac7d76a5932a8dff9e3afe1828a30dae4eddd1 /src/compiler/nir/nir_intrinsics.h | |
parent | 24728637e2c006012e4c0a3d87629b53beaddd3b (diff) | |
download | external_mesa3d-c35f9792202c4450d19c5616e2a38b9e81e418fe.zip external_mesa3d-c35f9792202c4450d19c5616e2a38b9e81e418fe.tar.gz external_mesa3d-c35f9792202c4450d19c5616e2a38b9e81e418fe.tar.bz2 |
nir: Add nir_builder support for individual system value loads.
The previous nir_load_system_value(b, nir_intrinsic_load_whatever), 0) was
rather verbose, when system values should be easy to generate.
The index is left out because only one system value had an index included
in it.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src/compiler/nir/nir_intrinsics.h')
-rw-r--r-- | src/compiler/nir/nir_intrinsics.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/compiler/nir/nir_intrinsics.h b/src/compiler/nir/nir_intrinsics.h index d0f7f5d..4cb0437 100644 --- a/src/compiler/nir/nir_intrinsics.h +++ b/src/compiler/nir/nir_intrinsics.h @@ -41,7 +41,6 @@ #define ARR(...) { __VA_ARGS__ } - INTRINSIC(load_var, 0, ARR(0), true, 0, 1, 0, xx, xx, xx, NIR_INTRINSIC_CAN_ELIMINATE) INTRINSIC(store_var, 1, ARR(0), false, 0, 1, 1, WRMASK, xx, xx, 0) INTRINSIC(copy_var, 0, ARR(0), false, 0, 2, 0, xx, xx, xx, 0) @@ -277,7 +276,13 @@ INTRINSIC(shared_atomic_xor, 2, ARR(1, 1), true, 1, 0, 1, BASE, xx, xx, 0) INTRINSIC(shared_atomic_exchange, 2, ARR(1, 1), true, 1, 0, 1, BASE, xx, xx, 0) INTRINSIC(shared_atomic_comp_swap, 3, ARR(1, 1, 1), true, 1, 0, 1, BASE, xx, xx, 0) +/* Used by nir_builder.h to generate loader helpers for the system values. */ +#ifndef DEFINE_SYSTEM_VALUE +#define DEFINE_SYSTEM_VALUE(name) +#endif + #define SYSTEM_VALUE(name, components, num_indices, idx0, idx1, idx2) \ + DEFINE_SYSTEM_VALUE(name) \ INTRINSIC(load_##name, 0, ARR(0), true, components, 0, num_indices, \ idx0, idx1, idx2, \ NIR_INTRINSIC_CAN_ELIMINATE | NIR_INTRINSIC_CAN_REORDER) @@ -406,5 +411,6 @@ STORE(shared, 2, 2, BASE, WRMASK, xx, 0) LAST_INTRINSIC(store_shared) +#undef DEFINE_SYSTEM_VALUE #undef INTRINSIC #undef LAST_INTRINSIC |