summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2019-01-04 16:52:32 -0800
committerEric Anholt <[email protected]>2019-01-08 15:40:53 -0800
commit211b826790c499ba54e4cdf871b42e0b34b8f27d (patch)
treeef958f23bf024ce9ba47506afa76bd8c4d571b09 /src/compiler/nir
parent9f29d90327e343f5717a98ceb6df2cdbab5d0e0b (diff)
nir: Make nir_deref_instr_build/get_const_offset actually use size_align.
I think this was copy-and-paste mistake -- nir_opt_large_constants was passing in glsl_get_natural_size_align_bytes() given brw_nir.c's arguments to the opt pass. I wanted to reuse this function for handling constant offsets of arrays of images in V3D. Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/compiler/nir')
-rw-r--r--src/compiler/nir/nir_deref.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/compiler/nir/nir_deref.c b/src/compiler/nir/nir_deref.c
index a2d46208dd2..947888a5e20 100644
--- a/src/compiler/nir/nir_deref.c
+++ b/src/compiler/nir/nir_deref.c
@@ -143,7 +143,7 @@ type_get_array_stride(const struct glsl_type *elem_type,
glsl_type_size_align_func size_align)
{
unsigned elem_size, elem_align;
- glsl_get_natural_size_align_bytes(elem_type, &elem_size, &elem_align);
+ size_align(elem_type, &elem_size, &elem_align);
return ALIGN_POT(elem_size, elem_align);
}
@@ -156,8 +156,7 @@ struct_type_get_field_offset(const struct glsl_type *struct_type,
unsigned offset = 0;
for (unsigned i = 0; i <= field_idx; i++) {
unsigned elem_size, elem_align;
- glsl_get_natural_size_align_bytes(glsl_get_struct_field(struct_type, i),
- &elem_size, &elem_align);
+ size_align(glsl_get_struct_field(struct_type, i), &elem_size, &elem_align);
offset = ALIGN_POT(offset, elem_align);
if (i < field_idx)
offset += elem_size;