diff options
author | Alejandro Piñeiro <[email protected]> | 2018-11-06 18:10:01 +0100 |
---|---|---|
committer | Alejandro Piñeiro <[email protected]> | 2019-03-08 15:00:50 +0100 |
commit | b62a8149abc9dd4ecef0b888d3a6bf04203231f4 (patch) | |
tree | c78e47d6990f7245ea433e9c0fe408d7397b955b /src/compiler/nir | |
parent | e72daf3e7023246fc960cb5e375ae81313f7803b (diff) |
nir/xfb: add component_offset at nir_xfb_info
Where component_offset here is the offset when accessing components of
a packed variable. Or in other words, location_frac on
nir.h. Different places of mesa use different names for it.
Technically nir_xfb_info consumer can get the same from the
component_mask, it seems somewhat forced to make it to compute it,
instead of providing it.
v2: rename local location_frac for comp_offset, more similar to the
intended use (Timothy Arceri)
Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/compiler/nir')
-rw-r--r-- | src/compiler/nir/nir_gather_xfb_info.c | 3 | ||||
-rw-r--r-- | src/compiler/nir/nir_xfb_info.h | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/src/compiler/nir/nir_gather_xfb_info.c b/src/compiler/nir/nir_gather_xfb_info.c index c06a7667ab8..2c50a256a64 100644 --- a/src/compiler/nir/nir_gather_xfb_info.c +++ b/src/compiler/nir/nir_gather_xfb_info.c @@ -86,6 +86,7 @@ add_var_xfb_outputs(nir_xfb_info *xfb, assert(var->data.location_frac + comp_slots <= 8); uint8_t comp_mask = ((1 << comp_slots) - 1) << var->data.location_frac; + unsigned comp_offset = var->data.location_frac; while (comp_mask) { nir_xfb_output_info *output = &xfb->outputs[xfb->output_count++]; @@ -94,10 +95,12 @@ add_var_xfb_outputs(nir_xfb_info *xfb, output->offset = *offset; output->location = *location; output->component_mask = comp_mask & 0xf; + output->component_offset = comp_offset; *offset += util_bitcount(output->component_mask) * 4; (*location)++; comp_mask >>= 4; + comp_offset = 0; } } } diff --git a/src/compiler/nir/nir_xfb_info.h b/src/compiler/nir/nir_xfb_info.h index 6b16ce2a60a..c6a171fde34 100644 --- a/src/compiler/nir/nir_xfb_info.h +++ b/src/compiler/nir/nir_xfb_info.h @@ -34,6 +34,7 @@ typedef struct { uint16_t offset; uint8_t location; uint8_t component_mask; + uint8_t component_offset; } nir_xfb_output_info; typedef struct nir_xfb_info { |