Commit Graph

148388 Commits

Author SHA1 Message Date
Daniel Schürmann 30a7199e37 aco/optimizer: propagate and fold inline constants on VOP3P instructions
This patch aims to propagate and fold constants on VOP3P instructions
by using omod selection and the fneg modifier.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13688>
2021-12-21 13:23:36 +01:00
Daniel Schürmann 62bcfcd0a8 aco: change fneg for VOP3P to use fmul with +1.0
This will be useful to be able to also apply
fneg_lo and fneg_hi.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13688>
2021-12-21 13:23:36 +01:00
Daniel Schürmann 193bd740ab aco/optimizer: fix fneg modifier propagation on VOP3P
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13688>
2021-12-21 13:23:36 +01:00
Caio Oliveira de916d827f anv: Refactor dirty masking in cmd_buffer_flush_state
Instead of masking the dirty variable itself, use an appropriate mask
in the users of dirty.  This will avoid extra tracking when dealing
with Task/Mesh later.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14275>
2021-12-21 11:07:31 +00:00
Caio Oliveira 37fca614b8 anv/blorp: Split blorp_exec into a render and compute
And set the relevant push_constants_dirty for each case.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14275>
2021-12-21 11:07:31 +00:00
Roman Stratiienko 2686c5419d v3dv: add Android support
Acknowledgements to android-rpi team and lineage-rpi maintainer (KonstaT)
for creating/testing initial vulkan support. Their experience was used as
a baseline for this work.

Most of the code is a copy of turnip and anv.
Improved by cleaning dEQP failures:

 - Improved gralloc support (use allocation time stride, size, modifier).
 - Fixed some dEQP crashes due to memory allocation issues.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14016>
2021-12-21 09:24:43 +00:00
Emma Anholt 658b2ca467 r300/vs: Fix flow control processing just after an endloop.
We tried to step over the instruction we just generated, except we didn't
always just generate one.  In the sequence_vertex tests, that meant we
skipped processing the next BGNLOOP and then underflowed our stack.

Cc: mesa-stable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14271>
2021-12-21 01:05:07 +00:00
Emma Anholt b48852436e r300/vs: Reuse rc_match_bgnloop().
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14271>
2021-12-21 01:05:07 +00:00
Emma Anholt e41a53cd19 r300/vs: Allocate temps we see a use as a source, too.
This is a quick hack for a bunch of the fail in #5766.

Cc: mesa-stable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14271>
2021-12-21 01:05:07 +00:00
Emma Anholt e3d0ceccc9 ci/r300: Add another xfail on the main branch.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14271>
2021-12-21 01:05:07 +00:00
Francisco Jerez e7470a40c5 intel/fs: Add physical fall-through CFG edge for unconditional BREAK instruction.
This adds a missing CFG edge that represents a possible physical
control flow path the EU might take under some conditions which isn't
part of the logical CFG of the program.  This possibility shouldn't
have led to problems on platforms prior to Gfx12, since the missing
control flow edge cannot possibly influence liveness intervals.
However on Gfx12+ it becomes the compiler's responsibility to resolve
data dependencies across instructions, and the missing physical
control flow paths may lead to a WaR data hazard currently not visible
to the software scoreboard pass, which could lead to data corruption.

Worse, the possibility for this path to be taken by the EU increases
on Gfx12+ due to a hardware bug affecting EU fusion -- However the
same physical path can be potentially taken on earlier platforms as
well, so this patch extends the CFG on all platforms for consistency,
even though the lack of this edge shouldn't lead to any functional
issues on platforms earlier than Gfx12.  There are no shader-db
changes on earlier platforms, so there seems to be no disadvantage
from using the same CFG representation as on later platforms.

This issue has ben reported on TGL with the following conformance
test, thanks to Ian for bringing the FULSIM dependency check warning
to my attention:

   dEQP-VK.graphicsfuzz.spv-stable-pillars-volatile-nontemporal-store

Fixes: 4d1959e693 ("intel/cfg: Represent divergent control flow paths caused by non-uniform loop execution.")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4940
Reported-by: Tapani Pälli <tapani.palli@intel.com>
Reported-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14248>
2021-12-21 00:43:29 +00:00
Emma Anholt f568d80986 glsl: Retire unused modes for lower_64bit_integer_instructions.
Unused since 424ac809bf ("i965: Do int64 lowering in NIR")

Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14249>
2021-12-20 14:56:35 -08:00
Emma Anholt 97242b39f9 glsl: Remove comment about non-existing DFREXP_TO_ARITH
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14249>
2021-12-20 14:56:35 -08:00
Emma Anholt b82b3a327e glsl: Remove dead prototype for old do_discard_simplification().
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14249>
2021-12-20 14:47:57 -08:00
Emma Anholt 6db1f93699 glsl: Delete the optimize_redundant_jumps pass.
Nothing here that NIR doesn't do.  No effect on shader-db of hsw or
softpipe.

Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14249>
2021-12-20 14:47:57 -08:00
Emma Anholt c2ead6c9b5 glsl: Delete the vectorization opt pass.
Nothing uses it, and i965 was the last thing to.  Even if I enable it for
softpipe or crocus, it quickly causes NIR validation failures in shader-db
from swizzles outside the bounds of vectors.  Retire it in favor of
nir_opt_vectorize().

Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14249>
2021-12-20 14:47:57 -08:00
Rob Clark 8a21b2fda0 freedreno/ir3: Dump const state with shader disasm
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14231>
2021-12-20 19:47:35 +00:00
Rob Clark 9766a5721d freedreno/computerator: Mark shader bo for dumping
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14231>
2021-12-20 19:47:35 +00:00
Rob Clark d1edc6d9a1 freedreno/computerator: Fix @buf header
Order is important in the grammar, the more specific match needs to go
first.

Fixes: ba1c989348 ("freedreno/computerator: pass iova of buffer to const register")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14231>
2021-12-20 19:47:35 +00:00
Rob Clark 78c53f4888 freedreno/ir3: Handle instr->address when cloning
Without this, a cloned instruction that takes full regs will trigger an
ir3_validate assert.  This can happen, for ex, if an instruction that
writes p0.x and has a relative src gets cloned in ir3_sched.

Fixes an assert in Genshin Impact with a debug build.

Fixes: 9af795d9b9 ("ir3: Make ir3_instruction::address a normal register")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14231>
2021-12-20 19:47:35 +00:00
Alyssa Rosenzweig 1d21de788d pan/bi: Specialize shaders for IDVS
We need to compile multiple variants and report them together in a
common shader info. To do so, we split off per-variant shader infos and
combine at the end.

glmark2 is very happy: https://people.collabora.com/~alyssa/idvs-g52.txt
Highlights include -bshading up 41% fps and -bbump:bump-render=high-poly
up 62% faster

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14154>
2021-12-20 18:21:41 +00:00
Alyssa Rosenzweig c59977c3bf pan/bi: Add helper to decide if IDVS should be used
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14154>
2021-12-20 18:21:41 +00:00
Alyssa Rosenzweig a211d2b4e4 pan/bi: Use position shader ST_CVT path
We need to use a preload instead of the LEA_ATTR. Not sure why.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14154>
2021-12-20 18:21:41 +00:00
Alyssa Rosenzweig fe8ec31114 pan/bi: Split out varying store paths
This means we don't need to special case IDVS quite so hard.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14154>
2021-12-20 18:21:41 +00:00
Alyssa Rosenzweig e0771d5832 pan/bi: Remove the "wrong" stores in IDVS variants
Position shaders should only write gl_Position (and gl_PointSize on
Valhall), varying shaders should only write varyings.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14154>
2021-12-20 18:21:41 +00:00
Alyssa Rosenzweig fba5936fdb pan/bi: Add IDVS mode to bi_context
Various parts of the compiler switch behaviour based on IDVS variant.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14154>
2021-12-20 18:21:41 +00:00
Alyssa Rosenzweig c7fae2c896 pan/bi: Allow UBO pushing to run multiple times
For IDVS.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14154>
2021-12-20 18:21:41 +00:00
Alyssa Rosenzweig e2f7871bcf pan/bi: Extract bi_finalize_nir
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14154>
2021-12-20 18:21:41 +00:00
Alyssa Rosenzweig 62d46c7ee6 panfrost: Add panfrost_compile_inputs->no_idvs option
panvk will want IDVS support eventually, but not right now. Allow the
driver to opt out of IDVS in the mean time.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14154>
2021-12-20 18:21:41 +00:00
Alyssa Rosenzweig 2ff3c4a636 panfrost: Align instance size for IDVS
Hardware requirement. Failing to do this raises a DATA_INVALID_FAULT.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14154>
2021-12-20 18:21:41 +00:00
Alyssa Rosenzweig 79356b2e5f panfrost: Skip rasterizer discard draws without side effects
Minor optimization, but more importantly fixes an interaction of IDVS
with rasterizer discard.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14154>
2021-12-20 18:21:41 +00:00
Alyssa Rosenzweig f5412409db panfrost: Extract panfrost_batch_skip_rasterization
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14154>
2021-12-20 18:21:41 +00:00
Alyssa Rosenzweig 3a49f4798c panfrost: Emit IDVS jobs
When trying to draw with an IDVS capable shader.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14154>
2021-12-20 18:21:41 +00:00
Alyssa Rosenzweig e5b0c514d8 panfrost: Extract panfrost_draw_emit_vertex_section
To be shared with IDVS.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14154>
2021-12-20 18:21:41 +00:00
Alyssa Rosenzweig 4d8d987f1a panfrost: Set secondary_* fields for IDVS
Easy now that we've split everything out nicely.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14154>
2021-12-20 18:21:41 +00:00
Alyssa Rosenzweig 29f63c6283 panfrost: Remove regalloc from v6.xml
These fields were not introduced until v7, fix that.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14154>
2021-12-20 18:21:41 +00:00
Alyssa Rosenzweig 83356c58f8 panfrost: Split out regalloc/preload helpers
The logic gets duplicated if IDVS is in use.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14154>
2021-12-20 18:21:41 +00:00
Alyssa Rosenzweig 9e65ebb67a panfrost: Add IDVS fields to shader_info
This lets the compiler decide if IDVS should be used.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14154>
2021-12-20 18:21:41 +00:00
Alyssa Rosenzweig dc4fe86a01 panfrost: Treat IDVS jobs as tiler for scoreboarding
These need to be chained and need to provoke a fragment job when we're
done.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14154>
2021-12-20 18:21:41 +00:00
Alyssa Rosenzweig 8dc1936faa panfrost: Fix Secondary Shader field
Off-by-one on the start.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reported-by: Icecream95 <ixn@disroot.org>
Fixes: 73e80994d5 ("panfrost: Add secondary shader XML fields")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14154>
2021-12-20 18:21:40 +00:00
Alyssa Rosenzweig b27bbbe0c9 panfrost: Remove unused shader info bits
These were only used to infer preloading and can be deleted.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14154>
2021-12-20 18:21:40 +00:00
Alyssa Rosenzweig 7358edad42 panfrost: Set preload descriptor more accurately
Preload exactly what the shader needs, based on the compiler's mask of
uninitialized registers, rather than trying to sync pan_shader.h with
the behaviour of code gen. Would've saved me some debugging over the
years...

As a bonus this avoids preloading unnecessary registers, particularly in
compute shaders. In theory this should reduce power consumption.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14154>
2021-12-20 18:21:40 +00:00
Alyssa Rosenzweig 52fe998aa6 panfrost: Track preloaded registers
We already collect this information. We may as well make use of it.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14154>
2021-12-20 18:21:40 +00:00
Alyssa Rosenzweig e8566f7529 pan/indirect_draw: Support IDVS jobs
Handle as tiler jobs with an extra vertex DCD at the end.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14154>
2021-12-20 18:21:40 +00:00
Alyssa Rosenzweig 37ab248c77 pan/indirect_draw: Split out update_dcd
This is common between vertex/tiler jobs and needs to be duplicated for
IDVS jobs.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14154>
2021-12-20 18:21:40 +00:00
Alyssa Rosenzweig d696183d4d pan/indirect_draw: Don't upload garbage UBO
There should never be a CPU pointer in GPU memory, let's say that...

Fixes: 2e6d94c198 ("panfrost: Add helpers to support indirect draws")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14154>
2021-12-20 18:21:40 +00:00
Rafael Antognolli e9b509755b intel: Emit 3DSTATE_BINDING_TABLE_POOL_ALLOC for XeHP
On XeHP+, Binding Table Pointers are an offset relative to the Surface
State Base Address anymore. Instead, they are relative to the State
Binding Table Pool Address, which is set by the command above.

We emit that command (pointing to the same address as the Surface
State Base Addresss), and everything should stay working as before.

Reworks:
 * Jordan: Add iris
 * Jordan: Drop i965
 * Ken: Set MOCS to avoid a major perf impact. (Found by Felix DeGrood.)
 * Jordan: Shrink size from 2MiB to actual iris, anv usage
 * Lionel: Add BINDING_TABLE_POOL_BLOCK_SIZE

Ref: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4995
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
[jordan.l.justen@intel.com: Add Iris, adjust sizes]

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13992>
2021-12-20 17:58:13 +00:00
Jordan Justen e6fc231184 anv: Add BINDING_TABLE_POOL_BLOCK_SIZE
Suggested-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13992>
2021-12-20 17:58:13 +00:00
Jordan Justen 1ed7a65e6d intel/genxml/12.5: Remove bt-pool enable from 3DSTATE_BINDING_TABLE_POOL_ALLOC
This was dropped in gfx12.5.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13992>
2021-12-20 17:58:13 +00:00
Alyssa Rosenzweig 9da1787488 docs/macos: Update for recent Mesa changes
- Default c_std is now c11, no need to workaround
  89b4f337d5 ("c_std=c11 in meson default_options")

- gallium-xlib has been renamed to xlib:
  76791db088 ("mesa/x11: Remove the swrast-classic-based fake libGL")

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14216>
2021-12-20 17:53:27 +00:00