diff options
author | Jason Ekstrand <[email protected]> | 2018-06-29 14:44:19 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2018-07-02 12:09:41 -0700 |
commit | e8e159e9df40ee76468e05be073d94ec78d4bf32 (patch) | |
tree | 3f2496be58db2298766ee8033595775d91ce5ed5 /src/compiler/nir/nir_deref.h | |
parent | 2bf8be99b0f3dedd8fb23eeba998f6e1c540edf7 (diff) |
nir/deref: Add helpers for getting offsets
These are very similar to the related function in nir_lower_io except
that they don't handle per-vertex or packed things (that could be added,
in theory) and they take a more detailed size/align function pointer.
One day, we should consider switching nir_lower_io over to using the
more detailed size/align functions and then we could make it use these
helpers instead of having its own.
Reviewed-by: Timothy Arceri <[email protected]>
Reviewed-by: Iago Toral Quiroga <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir_deref.h')
-rw-r--r-- | src/compiler/nir/nir_deref.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/compiler/nir/nir_deref.h b/src/compiler/nir/nir_deref.h index 0980bae7215..6f4141aaf82 100644 --- a/src/compiler/nir/nir_deref.h +++ b/src/compiler/nir/nir_deref.h @@ -48,6 +48,12 @@ void nir_deref_path_init(nir_deref_path *path, nir_deref_instr *deref, void *mem_ctx); void nir_deref_path_finish(nir_deref_path *path); +unsigned nir_deref_instr_get_const_offset(nir_deref_instr *deref, + glsl_type_size_align_func size_align); + +nir_ssa_def *nir_build_deref_offset(nir_builder *b, nir_deref_instr *deref, + glsl_type_size_align_func size_align); + #ifdef __cplusplus } /* extern "C" */ #endif |