summaryrefslogtreecommitdiff
path: root/src/compiler/nir/nir_lower_io_to_vector.c
AgeCommit message (Collapse)AuthorFilesLines
2019-12-03nir/lower_io_to_vector: don't create arrays when not neededRhys Perry1-1/+7
Some backends require that there are no array varyings. If there were no arrays in the input shader, the pass shouldn't have to create new ones. Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2103 Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2167 Fixes: bcd14756eec ('nir/lower_io_to_vector: add flat mode') Signed-off-by: Rhys Perry <pendingchaos02@gmail.com> Reviewed-by: Connor Abbott <cwabbott0@gmail.com> (cherry picked from commit 5404b7aaa36fad18df19e12abcc8af69014e74c2)
2019-10-18nir: add amul instructionRob Clark1-1/+1
Used for address/offset calculation (ie. array derefs), where we can potentially use less than 32b for the multiply of array idx by element size. For backends that support `imul24`, this gives a lowering pass an easy way to find multiplies that potentially can be converted to `imul24`. Signed-off-by: Rob Clark <robdclark@chromium.org> Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com> Reviewed-by: Eduardo Lima Mitev <elima@igalia.com>
2019-09-06nir/lower_io_to_vector: don't merge compact varyingsRhys Perry1-0/+3
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com> Fixes: 02bc4aabb48 ('nir/lower_io_to_vector: allow FS outputs to be vectorized') Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2019-09-06nir/lower_io_to_vector: add flat modeRhys Perry1-47/+204
This has lower_io_to_vector try to turn variables into arrays of 4-sized vectors when possible and fall back to the old approach when that isn't possible. This is so that lower_io_to_vector can guarantee that only one variable is used for each fragment shader output. v2: handle dual-source blending v3: don't try to merge structs and non-32-bit types in get_flat_type() v3: fix per-vertex inputs v3: fix and cleanup location advancement in get_flat_type() and it's calling code v4: prioritize the original mode over the flat mode v4: don't create flat variables to merge only one variable v5: don't skip an entire slot when encountering structs in the old mode Signed-off-by: Rhys Perry <pendingchaos02@gmail.com> Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
2019-09-06nir/lower_io_to_vector: allow FS outputs to be vectorizedRhys Perry1-27/+32
v2: handle dual-source blending v3: use a higher MAX_SLOTS Signed-off-by: Rhys Perry <pendingchaos02@gmail.com> Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
2019-04-26nir: use braces around subobject in initializerTapani Pälli1-4/+4
Used same syntax as elsewhere with Mesa sources, verified result against MSVC with godbolt.org. fixes following warning with clang: warning: suggest braces around initialization of subobject v2: empty braces -> braces around subobject (Caio, Kristian) Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com> Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
2019-03-12nir: Add a pass for lowering IO back to vector when possibleJason Ekstrand1-0/+387
This pass tries to turn scalar and array-of-scalar IO variables into vector IO variables whenever possible. Reviewed-by: Connor Abbott <cwabbott0@gmail.com> Cc: "19.0" <mesa-stable@lists.freedesktop.org>