Commit Graph

143850 Commits

Author SHA1 Message Date
Marek Olšák 556c10c02c ac/surface: allow arbitrary swizzle modes for displayable DCC
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12430>
2021-08-20 14:28:36 +00:00
Marek Olšák 94d261029e radv: allow arbitrary swizzle modes for displayable DCC
by adding retile pipeline variants

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12430>
2021-08-20 14:28:36 +00:00
Marek Olšák 6fc38d3b07 radeonsi: allow arbitrary swizzle modes for displayable DCC
by adding retile shader variants

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12430>
2021-08-20 14:28:36 +00:00
Danylo Piliaiev ee9f0e78c1 ir3: prohibit folding of half->full conversion into mul.s24/u24
mul.s24/u24 always return 32b result regardless of its sources size,
hence we cannot guarantee the high 16b of dst being zero or sign extended.

Fixes cts tests on a650:
 dEQP-VK.spirv_assembly.type.scalar.i16.mul_test_high_part_zero_*

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12471>
2021-08-20 11:46:14 +00:00
Connor Abbott 10bf0c51d4 freedreno/ci: Add spillall tests
Only test shader tests, because the others are unlikely to have
interesting shaders.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12033>
2021-08-20 10:37:36 +00:00
Connor Abbott 0b39f4ab42 ir3, turnip, freedreno: Report stp/ldp in shader stats
This is important after spilling, so that we get an indication when a
change causes spilling.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12033>
2021-08-20 10:37:36 +00:00
Connor Abbott 58b54157ee ir3: Fix getting stp/ldp components in ir3_info
Noticed by inspection when adding stp_count/ldp_count.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12033>
2021-08-20 10:37:36 +00:00
Connor Abbott 613eaac7b5 ir3: Initial support for spilling non-shared registers
Support for spilling shared registers to normal registers is still TODO.
There are also several improvements to be made, like rematerialization.

Note, there is one behavior change to register pressure accounting: we
now include half registers in the current full pressure directly in
mergedregs mode, rather than adding the max half pressure to the max
full pressure afterwards, which might result in lower calculated max
pressure in some cases with half registers. This is needed for spilling,
since we need to make sure the total pressure including half registers
is below the maximum at each instruction. Because the entire pass is
rewritten, including the register pressure calculating parts, it didn't
seem worth it to separate out this change.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12033>
2021-08-20 10:37:36 +00:00
Connor Abbott 6a5312bf86 ir3: Fix compress_regs_left accounting for half-regs
This was just wrong - we need to check against the entire register file,
and we need to include removed full regs even if the register we're
trying to insert is a half-reg, or else we could run out of space when
reinserting full regs after it. There does need to be an additional
check so that we don't try to insert a half-reg beyond the half-reg
limit, but that has to happen in addition to the normal check.

This fixes KHR-GLES31.core.arrays_of_arrays.InteractionArgumentAliasing6
once spilling is added.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12033>
2021-08-20 10:37:36 +00:00
Connor Abbott cca2e0fc14 ir3: Properly validate pcopy reg sizes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12033>
2021-08-20 10:37:36 +00:00
Connor Abbott dd4e2f507a ir3: Fix RA debug printing
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12033>
2021-08-20 10:37:36 +00:00
Connor Abbott e8d2253bf6 ir3: Add ra_foreach_src_n/ra_foreach_dst_n
I found ra_foreach_src_n useful in one place in the spiller. But this
also aligns RA with the rest of the compiler and stops us from
reinventing the iterators.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12033>
2021-08-20 10:37:36 +00:00
Connor Abbott be3ab7ded4 ir3: Add loop depth to ir3_block
And while we're at it, fix adding loop_id for the continue block.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12033>
2021-08-20 10:37:36 +00:00
Connor Abbott 7d3e5dc487 ir3/ra: Make ir3_reg_interval_remove_all() useful for spilling
RA uses this to pop and then reinsert intervals when shuffling around
registers. For spilling, we want to remove the interval and also mark
all its descendants as removed. Since "remove_all" sounds more like the
latter, rename the old "remove_all" to "remove_temp". "remove_all" was
already exposed in ir3_ra.h, so there's no need to add it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12033>
2021-08-20 10:37:36 +00:00
Connor Abbott efb34d6ee6 ir3/ra: Handle huge merge sets
It can happen that we create an enormous merge set, even larger than the
entire register file, in which case find_best_gap() would loop
infinitely. This seems to be triggered more often with
IR3_SHADER_DEBUG=spillall, since it actually happened with a CTS test.
Just bail out in that case.

Fixes: 0ffcb19b9d ("ir3: Rewrite register allocation")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12033>
2021-08-20 10:37:36 +00:00
Connor Abbott 70c22d3894 ir3/ra: Fix available bitset for live-through collect srcs
When we mark live-through sources that are merged with the destination
as killed, we kept the bitsets in sync, but we forgot to keep them in
sync when unmarking them after allocating the destination. The result
was that "available" wasn't correct for any instruction afterwards. This
resulted in a bad register allocation with IR3_SHADER_DEBUG=spillall for
a dEQP-VK test.

While we're changing this, use ra_foreach_src().

Fixes: 0ffcb19b9d ("ir3: Rewrite register allocation")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12033>
2021-08-20 10:37:36 +00:00
Connor Abbott eae36b4850 ir3/ra: Reinitialize interval when inserting
Otherwise when an interval is removed and then re-inserted it could
have an invalid/corrupted parent link and child tree. I think RA
happened to never do this, but spilling will.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12033>
2021-08-20 10:37:36 +00:00
Connor Abbott 4b0eba9cb1 ir3/merge_regs: Set wrmask for pcopy destinations
This was wrong, and with spilling we can now create vector phi's in rare
circumstances.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12033>
2021-08-20 10:37:36 +00:00
Connor Abbott f59816b815 ir3/print: Use mesa_stream_log_printf for (kill)
This was missed during the conversion.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12033>
2021-08-20 10:37:36 +00:00
Connor Abbott efa3600306 ir3: Print physical successors/predecessors
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12033>
2021-08-20 10:37:36 +00:00
Connor Abbott d25cf483cb ir3: Copy-propagate single-source phis
These can be created when removing unreachable control flow, and it
seems easier to remove them than to add special code to handle them when
spilling.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12033>
2021-08-20 10:37:36 +00:00
Connor Abbott f40baf33e6 ir3/ra: Remove logical_unreachable
This reverts 394c597b1b, although I had to
manually do it due to the reformatting.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12033>
2021-08-20 10:37:36 +00:00
Connor Abbott 2768a35e41 ir3: Add pass to remove unreachable blocks
Rather than continue to add special cases for these, just clean them up.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12033>
2021-08-20 10:37:36 +00:00
Erik Faye-Lund b74c7aae79 draw: improve numerical stability in clipper
Floats have much better precision close to zero than close to one, so
let's make sure we compute an interpolation factor that goes in the
direction that discards the fewest bits.

This makes a big difference when interpolating from very small to very
large values for screen-space positions.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12355>
2021-08-20 09:26:41 +00:00
Guilherme Gallo a51678ffce gitlab-ci: Fix trace expectations for iris devices
By checking the output images against the reference ones on the failed
trace jobs, I looked for artifacts via naked eye and image diffs. No
significant change was found. So the trace produced by the failed jobs
can be considered valid.

Updated devices' traces:
	* Intel Comet Lake: iris-cml-traces
	* Intel Gemini Lake: iris-glk-traces
	* Intel Kaby Lake: iris-kbl-traces
	* Intel Whiskey Lake: iris-whl-traces

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12394>
2021-08-20 09:11:01 +00:00
Guilherme Gallo edee0da880 gitlab-ci: enable testing on Intel Comet Lake (experimental)
* Integrate sarien Chromebook devices from Collabora lab
* Based on https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11162

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12394>
2021-08-20 09:11:01 +00:00
Guilherme Gallo e2d7309973 gitlab-ci: enable testing on Intel Whiskey Lake (experimental)
* Integrate sarien Chromebook devices from Collabora lab
* Based on https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11162

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12394>
2021-08-20 09:11:01 +00:00
Ilia Mirkin 7fbb773c0d mesa: rgb10_a2 is never color-renderable in gles2
Fixes
dEQP-GLES2.functional.fbo.completeness.renderable.texture.color0.rgb10_a2 on
GLES2 drivers which support RGB10_A2 textures.
GL_OES_required_internalformat does not make it a color-renderable
format.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4972
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12464>
2021-08-19 21:20:07 -04:00
Emma Anholt e6776148c1 freedreno/a6xx: Sync TFB BO access against prior TFB writes.
CTS draw_indirect usage of TFB output was flaking due to the TFB writes
possibly not having completed.  Since GL TFB doesn't require any other
barrier between TFB and use of the BO (as seen by the CTS not emitting any
memory barrier), we have to do it ourselves.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12457>
2021-08-19 23:27:15 +00:00
Emma Anholt 83e9a7fbcf freedreno/ir3: Align driver param upload size/offset for indirect uploads.
For indirect draws, we have to upload some of the params as indirect
references, which have a more strict size requirement.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12455>
2021-08-19 14:43:06 -07:00
Emma Anholt 5d192c2036 freedreno/ir3: Apply the a6xx samgq workaround to TES/TCS/GS as well.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12454>
2021-08-19 21:21:45 +00:00
Jason Ekstrand a6a449837b anv: Set CONTEXT_PARAM_RECOVERABLE to false
We want the kernel to ban our context immediately instead of foolhardily
attempting to recover.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: mesa-stable@lists.freedesktop.org
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12476>
2021-08-19 19:37:03 +00:00
Rhys Perry 4a7714ab7b aco/tests: add tests for post-RA DPP combining
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11924>
2021-08-19 18:17:33 +00:00
Rhys Perry 12be7c8feb aco/tests: add tests for pre-RA DPP combining
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11924>
2021-08-19 18:17:33 +00:00
Rhys Perry 4ac47ad1cd aco: combine DPP into VALU after RA
Mostly helps a bunch of Cyberpunk 2077 shaders.

fossil-db (Siena Cichlid):
Totals from 26 (0.02% of 150170) affected shaders:
CodeSize: 83208 -> 81528 (-2.02%)
Instrs: 14728 -> 14308 (-2.85%)
Latency: 48041 -> 47793 (-0.52%)
InvThroughput: 10836 -> 10578 (-2.38%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11924>
2021-08-19 18:17:33 +00:00
Rhys Perry 2e6834d4f6 aco: combine DPP into VALU before RA
Mostly helps a bunch of Cyberpunk 2077 shaders. Catches some of the cases
that the post-RA can't optimize because of register assignment.

fossil-db (Siena Cichlid):
Totals from 25 (0.02% of 150170) affected shaders:
CodeSize: 78808 -> 75764 (-3.86%)
Instrs: 14311 -> 13547 (-5.34%)
Latency: 278697 -> 277885 (-0.29%)
InvThroughput: 63428 -> 62754 (-1.06%)
Copies: 1348 -> 1349 (+0.07%); split: -0.07%, +0.15%
PreVGPRs: 1035 -> 1011 (-2.32%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11924>
2021-08-19 18:17:33 +00:00
Rhys Perry b97cfd72af aco: handle DPP in the optimizer
There are a bunch of optimizations that are broken when DPP is involved.

fossil-db (Sienna Cichlid):
Totals from 100 (0.07% of 150170) affected shaders:
CodeSize: 325204 -> 325192 (-0.00%); split: -0.06%, +0.05%
Instrs: 62773 -> 62664 (-0.17%); split: -0.18%, +0.00%
Latency: 295348 -> 295266 (-0.03%); split: -0.03%, +0.00%
InvThroughput: 73990 -> 73946 (-0.06%); split: -0.06%, +0.01%
Copies: 1650 -> 1609 (-2.48%); split: -2.55%, +0.06%
PreSGPRs: 3554 -> 3520 (-0.96%)

Fossil-db changes are probably because v_sub_f32_dpp(v_mul_f32) is no
longer being combined into MAD and then split back into separate
instructions.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11924>
2021-08-19 18:17:33 +00:00
Rhys Perry 2e56e23420 aco: make optimize_postRA() work across blocks
fossil-db (Sienna Cichlid):
Totals from 46 (0.03% of 150170) affected shaders:
CodeSize: 103672 -> 103488 (-0.18%)
Instrs: 21968 -> 21922 (-0.21%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11924>
2021-08-19 18:17:33 +00:00
Rhys Perry 1d894a8c85 aco: move a bunch of helpers into aco_ir.h/aco_ir.cpp
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11924>
2021-08-19 18:17:33 +00:00
Rhys Perry 3db3196379 aco: add can_use_DPP() and convert_to_DPP()
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11924>
2021-08-19 18:17:33 +00:00
Rhys Perry a9562fd0d6 aco: fix validation of DPP v_cndmask_b32/v_addc_co_u32
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11924>
2021-08-19 18:17:33 +00:00
Emma Anholt 6494b08407 i915g: clang-format fixup.
I really need to get clang-format into CI so I can stop doing fixups.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12436>
2021-08-19 17:28:14 +00:00
Emma Anholt c38cb5d4d8 i915g: Add comments explaining various xfails.
I haven't gone through every test (particularly ones I think are loop
unrolling or instruction-count-related ones I think), but this gives a
better picture of what's going on in this driver.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12436>
2021-08-19 17:28:14 +00:00
Emma Anholt ab2645b54c i915g: Clear some xfails that are now skips.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12436>
2021-08-19 17:28:14 +00:00
Emma Anholt e00a749759 i915g: Reduce ARB_fp max tex indirections to match i915c.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12436>
2021-08-19 17:28:14 +00:00
Emma Anholt 8ebd0f8317 i915g: Correct PIPE_SHADER_CAP_MAX_TEMPS.
This is the value that i915c reported, too, and is required for ARB_fp.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12436>
2021-08-19 17:28:14 +00:00
Emma Anholt da3f20a3ab i915g: Fix polygon offset by telling draw the Z format.
This is what initializes the MRD for draw's polygon offset calculations.

Closes: #4976
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12436>
2021-08-19 17:28:14 +00:00
Boyuan Zhang 8e5e70bb3d frontends/va: add num_temporal_layers check
Fixes: 51935d59

temporal_id check is valid only if the num_temporal_layers is set (>0).
When num_temporal_layers is 0, we shouldn't check temporal_id and return
error.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Thong Thai <thong.thai@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12463>
2021-08-19 14:25:09 +00:00
Boyuan Zhang 4081516b3e radeon/vcn: set min value for num_temporal_layers
Fixes: 51935d59

In the case where num_temporal_layers is not set (0), set it using the
minimum value 1, otherwise the rate control settings will be missing.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Thong Thai <thong.thai@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12463>
2021-08-19 14:25:09 +00:00
Daniel Schürmann 59f2c85845 nir: return false for loops in contains_other_jump()
Allows to unwrap more loops.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12473>
2021-08-19 13:51:17 +00:00