Yiwei Zhang [Wed, 15 Feb 2023 17:22:29 +0000 (09:22 -0800)]
venus: refactor sync fd fence and sempahore features
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21379>
Yiwei Zhang [Wed, 15 Feb 2023 16:56:00 +0000 (08:56 -0800)]
venus: clean up globalFencing
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21379>
Yiwei Zhang [Tue, 14 Feb 2023 07:23:28 +0000 (23:23 -0800)]
venus: clean up memoryResourceAllocationSize
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21379>
Yiwei Zhang [Tue, 14 Feb 2023 07:18:39 +0000 (23:18 -0800)]
venus: start requiring all experimental features
This is to prepare for promoting exp features to core.
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21379>
Yiwei Zhang [Mon, 13 Feb 2023 04:30:53 +0000 (20:30 -0800)]
venus: replace binary search with hardcode for max buffer size
Avoid the couple test buffer creations without maintenance4.
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21379>
Yiwei Zhang [Mon, 13 Feb 2023 03:45:28 +0000 (19:45 -0800)]
venus: further disallow sparse resource
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21379>
Georg Lehmann [Sun, 26 Feb 2023 14:54:18 +0000 (15:54 +0100)]
aco/optimizer_postRA: assume all registers are untrackable in loop headers
Register writes from the pre-header might not be correct for any but
the first loop iteration because they can be clobbered inside the loop.
Foz-DB Navi21:
Totals from 18 (0.01% of 134913) affected shaders:
CodeSize: 251384 -> 251508 (+0.05%)
Instrs: 47644 -> 47664 (+0.04%)
Latency: 801801 -> 801852 (+0.01%)
InvThroughput: 177579 -> 177593 (+0.01%)
Copies: 4752 -> 4771 (+0.40%)
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8376
Fixes:
d3b0f781103 ("aco/optimizer_postRA: Initialize loop header with preheader information")
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21540>
Mike Blumenkrantz [Mon, 20 Feb 2023 16:40:00 +0000 (11:40 -0500)]
zink: skip buffer barriers for ACCESS_NONE -> ACCESS_READ / ACCESS_WRITE
these do nothing and may cause unnecessary driver flushing
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21427>
Emma Anholt [Wed, 22 Feb 2023 23:13:53 +0000 (15:13 -0800)]
ci: Update traces expectations for gutting glsl opt_algebraic.
All look like harmless changes.
Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
Emma Anholt [Wed, 22 Feb 2023 21:12:24 +0000 (13:12 -0800)]
glsl: Remove unused as_rvalue_to_saturate().
This is not where saturate recognition happens. Dead code since
5598458e6923 ("i965/vec4: Remove try_emit_saturate") in 2014!
Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
Emma Anholt [Wed, 22 Feb 2023 21:16:40 +0000 (13:16 -0800)]
glsl/opt_algebraic: Drop the flrp recognizer.
No change to r300.
freedreno looks mixed but slightly positive in instructions:
total instructions in shared programs:
11012472 ->
11012453 (<.01%)
instructions in affected programs: 8250 -> 8231 (-0.23%)
helped: 16
HURT: 50
Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
Emma Anholt [Wed, 22 Feb 2023 21:01:13 +0000 (13:01 -0800)]
glsl/opt_algebraic: Drop the ftrunc pattern recognizer.
Now that it's in NIR, there's no change to r300 or freedreno shader-db
when we do.
Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
Emma Anholt [Wed, 22 Feb 2023 20:59:16 +0000 (12:59 -0800)]
nir: Port a floor->truncate algebraic opt pattern from GLSL.
Prevents regression when dropping code from the GLSL optimizer.
Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
Emma Anholt [Wed, 22 Feb 2023 20:44:40 +0000 (12:44 -0800)]
glsl/opt_algebraic: Drop some fmul simplifications.
Looks like mostly noise, trending slightly positively.
freedreno:
total instructions in shared programs:
11012781 ->
11012472 (<.01%)
instructions in affected programs: 114072 -> 113763 (-0.27%)
helped: 123
HURT: 153
r300:
total instructions in shared programs: 1338236 -> 1337897 (-0.03%)
instructions in affected programs: 3460 -> 3121 (-9.80%)
helped: 61
HURT: 11
Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
Emma Anholt [Wed, 22 Feb 2023 20:39:41 +0000 (12:39 -0800)]
glsl/opt_algebraic: Drop the flrp/ffma simplifiers.
NIR seems to do a better job. Freedreno:
total instructions in shared programs:
11013096 ->
11012781 (<.01%)
instructions in affected programs: 258358 -> 258043 (-0.12%)
helped: 470
HURT: 269
r300:
total instructions in shared programs: 1338237 -> 1338236 (<.01%)
instructions in affected programs: 161 -> 160 (-0.62%)
helped: 1
HURT: 0
total presub in shared programs: 45127 -> 44881 (-0.55%)
presub in affected programs: 1719 -> 1473 (-14.31%)
helped: 246
HURT: 0
Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
Emma Anholt [Wed, 22 Feb 2023 20:29:37 +0000 (12:29 -0800)]
glsl/opt_algebraic: Drop no-op pack/unpack optimization.
No change on freedreno shader-db.
Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
Emma Anholt [Wed, 22 Feb 2023 20:27:07 +0000 (12:27 -0800)]
glsl/opt_algebraic: Drop the eq/neq add-removal optimization.
No change on freedreno or r300 shader-db.
Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
Emma Anholt [Wed, 22 Feb 2023 20:24:49 +0000 (12:24 -0800)]
glsl/opt_algebraic: Drop scalar all_eq/any_neq -> eq/neq opt.
No change in r300 or freedreno shader-db.
Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
Emma Anholt [Wed, 22 Feb 2023 20:10:32 +0000 (12:10 -0800)]
glsl/opt_algebraic: Drop fdot 0-channel optimizations.
No change on i915g shader-db.
Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
Emma Anholt [Wed, 22 Feb 2023 20:22:03 +0000 (12:22 -0800)]
nir: Add optimization for fdot(x, 0) -> 0.
We had all these nice fdot opts to drop individual channels that were 0,
but nothing handling it being entirely 0! Avoids r300g regression when
dropping them from GLSL.
Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
Emma Anholt [Wed, 22 Feb 2023 20:08:55 +0000 (12:08 -0800)]
glsl/opt_algebraic: Drop csel(true/false, x, y) optimization.
No change on freedreno shader-db.
Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
Emma Anholt [Wed, 22 Feb 2023 20:04:34 +0000 (12:04 -0800)]
glsl/opt_algebraic: Drop x + -x -> 0 optimization.
No change on freedreno shader-db.
Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
Emma Anholt [Wed, 22 Feb 2023 20:03:34 +0000 (12:03 -0800)]
glsl/opt_algebraic: Drop add/sub with 0 optimizations.
Looks like minor instruction selection noise in freedreno shader-db:
total instructions in shared programs:
11013100 ->
11013096 (<.01%)
instructions in affected programs: 2714 -> 2710 (-0.15%)
helped: 8
HURT: 6
Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
Emma Anholt [Wed, 22 Feb 2023 20:00:24 +0000 (12:00 -0800)]
glsl/opt_algebraic: Drop fdiv(1,x) -> frcp(x) and fdiv(x,1) -> x optimizations.
No change on freedreno shader-db.
Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
Emma Anholt [Wed, 22 Feb 2023 19:59:18 +0000 (11:59 -0800)]
glsl/opt_algebraic: Drop and/or/xor optimizations.
NIR has them, and if anything freedreno shader-db prefers that NIR sees them:
total instructions in shared programs:
11013112 ->
11013100 (<.01%)
instructions in affected programs: 26266 -> 26254 (-0.05%)
helped: 4
HURT: 0
Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
Emma Anholt [Wed, 22 Feb 2023 19:56:08 +0000 (11:56 -0800)]
glsl/opt_algebraic: Drop rcp optimizations.
No change on freedreno shader-db.
Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
Emma Anholt [Wed, 22 Feb 2023 19:54:15 +0000 (11:54 -0800)]
glsl/opt_algebraic: Drop pow optimizations.
These should all be covered by NIR. Minor shader-db changes on freedreno,
which appear to be scheduling noise.
total instructions in shared programs:
11013132 ->
11013112 (<.01%)
instructions in affected programs: 3408 -> 3388 (-0.59%)
Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
Emma Anholt [Wed, 22 Feb 2023 19:48:05 +0000 (11:48 -0800)]
glsl/opt_algebraic: Drop shifts of 0 optimizations.
No change on freedreno shader-db.
Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
Emma Anholt [Wed, 22 Feb 2023 19:45:20 +0000 (11:45 -0800)]
glsl/opt_algebraic: drop fsat(fadd(b2f(x), b2f(y))) -> b2f(ior(x, y)) opt.
No change on freedreno shader-db.
Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
Emma Anholt [Wed, 22 Feb 2023 19:43:23 +0000 (11:43 -0800)]
glsl/opt_algebraic: Drop f2i(trunc(x)) -> f2i(x) optimization.
No change on freedreno shader-db.
Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
Emma Anholt [Wed, 22 Feb 2023 19:39:18 +0000 (11:39 -0800)]
glsl/opt_algebraic: Drop -(-x) -> x optimization.
No change on freedreno shader-db.
Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
Emma Anholt [Wed, 22 Feb 2023 19:38:14 +0000 (11:38 -0800)]
glsl/opt_algebraic: Drop abs(-x) -> abs(x) and abs(abs(x)) -> abs(x).
NIR does this. No change on freedreno shader-db.
Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
Emma Anholt [Wed, 22 Feb 2023 19:36:24 +0000 (11:36 -0800)]
glsl/opt_algebraic: Drop pow-recognizer.
NIR handles pow recognizing, too. No change on freedreno shader-db.
Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
Emma Anholt [Wed, 22 Feb 2023 19:34:57 +0000 (11:34 -0800)]
glsl/opt_algebraic: Drop log(exp(x)) -> x and exp(log(x)) -> x optimisations.
No change on freedreno shader-db.
Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
Emma Anholt [Wed, 22 Feb 2023 19:33:06 +0000 (11:33 -0800)]
glsl/opt_algebraic: Drop ~~x == x transformation.
No change on freedreno shader-db.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
Mike Blumenkrantz [Wed, 22 Feb 2023 20:20:15 +0000 (15:20 -0500)]
zink: use tc renderpass optimizing to more optimally start queries
if tc has determined that no queries are ended inside a renderpass,
it becomes possible to start queries outside of a renderpass, which
is more performant on some hw
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
Mike Blumenkrantz [Wed, 22 Feb 2023 20:19:33 +0000 (15:19 -0500)]
zink: always start/stop/resume queries inside renderpasses
this avoids potentially splitting renderpasses by ensuring that
all (non-cs) query operations always occur inside renderpasses
zink_query_update_gs_states() now has to be called inside renderpass
to catch the active queries
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
Mike Blumenkrantz [Wed, 22 Feb 2023 22:44:15 +0000 (17:44 -0500)]
zink: pull 'was_line_loop' into ctx for query updating
make this a bit more flexible
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
Mike Blumenkrantz [Wed, 22 Feb 2023 21:05:15 +0000 (16:05 -0500)]
zink: use more consistent check for deleting zink_query::stats_list links
the linkage of this may vary depending on the query's active state,
so avoid issues by just checking the linkage directly
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
Mike Blumenkrantz [Wed, 22 Feb 2023 20:18:01 +0000 (15:18 -0500)]
zink: break out query suspend functionality for reuse
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
Mike Blumenkrantz [Wed, 22 Feb 2023 20:17:16 +0000 (15:17 -0500)]
zink: track whether queries were started in a renderpass
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
Mike Blumenkrantz [Wed, 22 Feb 2023 18:03:47 +0000 (13:03 -0500)]
zink: rework query pool overflow
now when a query pool is full, a new query pool can be created and the
previous one can be dropped from reuse to be freed at a later time
this has the added benefit of avoiding yet another place where a renderpass
might get split
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
Mike Blumenkrantz [Wed, 22 Feb 2023 17:59:46 +0000 (12:59 -0500)]
zink: create/use query pools dynamically
this fits the concept of "pools are shared between queries" a bit
better and leaves the pool ownership/destruction to their users
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
Mike Blumenkrantz [Wed, 22 Feb 2023 17:47:29 +0000 (12:47 -0500)]
zink: rework find_or_allocate_qp()
this and its caller are now a bit more streamlined with regards to
functionality of the surrounding code
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
Mike Blumenkrantz [Wed, 22 Feb 2023 17:46:52 +0000 (12:46 -0500)]
zink: reorder some query code
no functional changes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
Mike Blumenkrantz [Wed, 22 Feb 2023 17:28:42 +0000 (12:28 -0500)]
zink: try updating qbos on query resume if !in_rp
this is another logical place to do the update since it won't split
a renderpass
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
Mike Blumenkrantz [Thu, 23 Feb 2023 01:24:21 +0000 (20:24 -0500)]
zink: only update qbo for TIME_ELAPSED on start if !in_rp
this otherwise splits the current renderpass for no reason
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
Mike Blumenkrantz [Thu, 23 Feb 2023 01:05:35 +0000 (20:05 -0500)]
zink: handle null query results for conditional render
this just needs to have a zero blasted into the buffer
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
Mike Blumenkrantz [Wed, 22 Feb 2023 21:27:40 +0000 (16:27 -0500)]
zink: handle null query results
it's possible that a query may have no results at all, so shortcut
everything and return zero as fast as possible for those cases
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
Mike Blumenkrantz [Wed, 22 Feb 2023 17:28:09 +0000 (12:28 -0500)]
zink: only try doing qbo updates on query suspend if !in_rp
this otherwise creates infinite recursion trying to end a currently
ending renderpass
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
Mike Blumenkrantz [Wed, 22 Feb 2023 15:49:37 +0000 (10:49 -0500)]
zink: refuse to start cs invocation queries in renderpass
these can't produce data in renderpasses, so ensure they aren't accidentally
started inside a renderpass where they'll have to later be restarted outside
of one
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
Mike Blumenkrantz [Wed, 22 Feb 2023 17:13:05 +0000 (12:13 -0500)]
zink: don't double suspend queries
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
Mike Blumenkrantz [Wed, 22 Feb 2023 17:01:22 +0000 (12:01 -0500)]
zink: un-suspend queries if they end while suspended
ensure they don't accidentally resume themselves after suspend
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
Mike Blumenkrantz [Wed, 22 Feb 2023 15:44:16 +0000 (10:44 -0500)]
zink: add zink_query::suspended to indicate suspended state of queries
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
Mike Blumenkrantz [Wed, 22 Feb 2023 15:42:36 +0000 (10:42 -0500)]
zink: don't auto-sync qbos on query end
these can now be synced later all at once
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
Mike Blumenkrantz [Wed, 22 Feb 2023 14:52:07 +0000 (09:52 -0500)]
zink: handle multiple query starts in qbo update
this still isn't used due to how queries are started/stopped, but it should
be a bit more robust
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
Mike Blumenkrantz [Tue, 21 Feb 2023 21:59:26 +0000 (16:59 -0500)]
zink: delete zink_query::last_start_idx
this was always zero
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
Mike Blumenkrantz [Tue, 21 Feb 2023 21:24:41 +0000 (16:24 -0500)]
zink: make zink_vk_query unref consistent
the no-check free seems suspicious
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
Mike Blumenkrantz [Fri, 24 Feb 2023 12:49:29 +0000 (07:49 -0500)]
zink: fix possible query destroy leak
if the starts array has been reset, then the counter will be inaccurate,
and some of the members will leak, so this needs to iterate over the capacity
of the array instead of the contents
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
Mike Blumenkrantz [Wed, 22 Feb 2023 18:13:27 +0000 (13:13 -0500)]
zink: fix zink_query_start initialization
not sure if this was a bug, but it would have fully zeroed the struct
and prevented previous zink_vk_query members from being unrefed
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
Mike Blumenkrantz [Wed, 22 Feb 2023 18:12:34 +0000 (13:12 -0500)]
zink: rewrite zink_query_start struct
making the non-pool members easier to zero
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
Mike Blumenkrantz [Tue, 21 Feb 2023 21:11:45 +0000 (16:11 -0500)]
zink: reset queries on the promoted cmdbuf when possible
this avoids splitting renderpasses just to reset queries
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
Mike Blumenkrantz [Thu, 23 Feb 2023 13:20:08 +0000 (08:20 -0500)]
zink: remove suspended queries from list before resuming
this avoids double-starting primgen queries from recursion when
needs_rast_discard_workaround is true
cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
Mike Blumenkrantz [Tue, 21 Feb 2023 20:14:41 +0000 (15:14 -0500)]
zink: move zink_batch_no_rp call for query reset
this could otherwise pointlessly terminate a renderpass
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
Patrick Lerda [Sat, 25 Feb 2023 13:08:53 +0000 (14:08 +0100)]
mesa/shaderapi: fix path memory leak
For instance, with "piglit/arb_shading_language_include-api -auto -fbo" or
"piglit/shader_runner tests/spec/arb_shading_language_include/execution/replacement.shader_test -auto -fbo":
Direct leak of 66 byte(s) in 6 object(s) allocated from:
#0 0x7fa4b59050 in __interceptor_strdup (/usr/lib64/libasan.so.6+0x59050)
#1 0x7f9a098fe0 in validate_and_tokenise_sh_incl ../src/mesa/main/shaderapi.c:3383
#2 0x7f9a0a43e8 in _mesa_NamedStringARB ../src/mesa/main/shaderapi.c:3547
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21553>
Giancarlo Devich [Mon, 27 Feb 2023 19:03:42 +0000 (11:03 -0800)]
d3d12: Don't loop in update_draw_indirect_with_sysvals
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21567>
Giancarlo Devich [Fri, 24 Feb 2023 21:31:59 +0000 (13:31 -0800)]
d3d12: Create varying structures as necessary, reference them
This changes instances of d3d12_varying_info to d3d12_varying_info*,
significantly reducing the size of the d3d12_shader_key,
d3d12_gs_variant_key, and d3d12_tcs_variant_key.
Associated changes to key fill, compare, hashing, and gs and tcs variant
maps significantly reduce the amount of time spent clearing and
comparing memory.
The biggest win here is not having to re-zero _or_ re-fill varyings in
d3d12_fill_shader_key, validate_geometry_shader_variant, and
validate_tess_ctrl_shader_variant.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21527>
Giancarlo Devich [Fri, 24 Feb 2023 21:26:46 +0000 (13:26 -0800)]
d3d12: Don't memcmp gs/tcs keys
This is unnecessary and incomplete. Not only is it covered by the hash
map lookup, but also does not consider the other key members.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21527>
Giancarlo Devich [Fri, 24 Feb 2023 20:00:16 +0000 (12:00 -0800)]
d3d12: Don't unnecessarily zero out gs/tcs keys
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21527>
Giancarlo Devich [Fri, 24 Feb 2023 19:50:57 +0000 (11:50 -0800)]
d3d12: Track max varying slot, set and compare less bytes
Often, the full range of available slots don't need to participate in
the comparison or be zeroed out.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21527>
Giancarlo Devich [Fri, 24 Feb 2023 19:30:07 +0000 (11:30 -0800)]
d3d12: Don't recompute has_flat_varyings or missing_dual_src_outputs
Per shader selection, these two flags can be expensive to compute.
Instead, recompute their values as neccessary, and save them in the
context.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21527>
Emma Anholt [Tue, 21 Feb 2023 19:32:41 +0000 (11:32 -0800)]
anv: Skip BTI RT flush if we're doing an op that doesn't use render targets.
rt_flushes emitted on zink sauer.trace --loop=500 -2.02118% +/- 1.15992% (n=8).
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21508>
Emma Anholt [Tue, 21 Feb 2023 17:43:46 +0000 (09:43 -0800)]
anv: Skip the RT flush when doing depth-only rendering.
The spec citation says it's just for when the RT write message BTI might
point to a different RT, and if we don't have any color attachments then
we won't have one of those at all.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21508>
Mike Blumenkrantz [Mon, 27 Feb 2023 18:52:30 +0000 (13:52 -0500)]
aux/tc: only call tc_parse_draw() when parsing renderpass info
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21533>
Mike Blumenkrantz [Wed, 22 Feb 2023 19:58:44 +0000 (14:58 -0500)]
aux/tc: track whether queries have been terminated in a renderpass
on tilers it's important to know whether a query is ended mid-renderpass
so that the query begin can occur inside/outside of the renderpass
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21533>
Caio Oliveira [Mon, 27 Feb 2023 06:02:49 +0000 (22:02 -0800)]
panfrost: Use NIR scoped barriers instead of memory barriers
Now both GLSL and SPIR-V will produce the scoped barriers, so no
need to handle the old ones.
Control barriers are still present in some cases, so keep that
for now.
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3339>
Caio Oliveira [Mon, 27 Feb 2023 05:57:49 +0000 (21:57 -0800)]
pan/midgard: Handle nir_intrinsic_scoped_barrier in Midgard compiler
Behave the same as the existing more specific barrier intrinsics.
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3339>
Caio Oliveira [Mon, 27 Feb 2023 05:40:16 +0000 (21:40 -0800)]
pan/compiler: Fix handling of nir_intrinsic_scoped_barrier
Only emit anything if this is a control barrier, i.e. contains an
execution scope. Also change the assertion to look at that scope
instead of the memory scope.
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3339>
Caio Oliveira [Fri, 24 Feb 2023 10:25:44 +0000 (02:25 -0800)]
intel/compiler: Mark various memory barriers intrinsics unreachable
Now that both SPIR-V and GLSL are using scoped barriers, we can stop
handling the specialized ones.
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3339>
Caio Oliveira [Fri, 24 Feb 2023 10:25:44 +0000 (02:25 -0800)]
glsl: Implement use_scoped_barrier option for lowering memory barriers
When the option is enabled, lower memory barriers to the
unified nir_intrinsic_scoped_barrier.
The translation of the following is based on
https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_gl_spirv.txt
- memoryBarrier()
- memoryBarrierBuffer()
- memoryBarrierImage()
- memoryBarrierShared()
- groupMemoryBarrier()
Also use scoped barrier for the memory counterparts of the GLSL
(control) barrier() when the option is enabled. The execution
part of a (control) barrier() remains using the old intrinsic.
For memoryBarrierAtomicCounter() there's no corresponding
nir_var_atomic_counter mode. Since atomic counters are lowered
to SSBOs, use the nir_var_mem_ssbo mode in the scoped barrier
instead.
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Acked-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3339>
Caio Oliveira [Mon, 27 Feb 2023 04:59:05 +0000 (20:59 -0800)]
gallivm: Fix handling of nir_intrinsic_scoped_barrier
A scoped barrier only has a control barrier behavior if there's
an execution scope.
Fixes:
13d900de0dcf ("llvmpipe: set nir_shader_compiler_options::use_scoped_barrier")
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3339>
Caio Oliveira [Sun, 26 Feb 2023 22:11:04 +0000 (14:11 -0800)]
microsoft/compiler: Handle scoped barrier in Tess splitting
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3339>
Caio Oliveira [Fri, 24 Feb 2023 10:25:43 +0000 (02:25 -0800)]
nir: Support use_scoped_barrier in nir_lower_atomics_to_ssbo
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Acked-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3339>
Rob Clark [Sun, 26 Feb 2023 21:39:32 +0000 (13:39 -0800)]
Revert "freedreno: Account for multi-draw in num_draws"
autotune already divides draw-cost by # of draws, but only increments
the draw-cost once per multi-draw. We could either _also_ account for
draw-cost by multiply by # of draws for treat multi-draw as a single
draw. The latter saves an integer multiply per draw.
Fixes a performance regression triggered by transition from GMEM to
sysmem rendering.
This reverts commit
6bfee9e6697e286c82f36a15d0e8a7c1ec7d2a02.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21543>
Emma Anholt [Mon, 27 Feb 2023 17:49:27 +0000 (09:49 -0800)]
ci/crocus: Mark unvanquished as flaky.
It's started rendering something different again, with a similar sort of
bad rendering to what's linked in the bug report (though this time it's a
'P' that became a white square). Commit range
65b62db0..
964323fe has
nothing particularly likely in it, so I expect this is some sort of cache
flushing fail or something.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21565>
Emma Anholt [Mon, 27 Feb 2023 17:32:14 +0000 (09:32 -0800)]
ci/crocus: Add new tess xfails and a link to the regression bug report.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21565>
Samuel Pitoiset [Mon, 27 Feb 2023 17:23:38 +0000 (18:23 +0100)]
zink/ci: skip one more test that timeout with RADV
It usually takes more than 60s to run.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21564>
Karol Herbst [Mon, 27 Feb 2023 16:35:43 +0000 (17:35 +0100)]
ci/zink: move threading tests to flakes
We have some failed CI jobs where some of those tests randomly pass.
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21561>
Mike Blumenkrantz [Mon, 27 Feb 2023 16:27:14 +0000 (11:27 -0500)]
docs: add pipeline library support for tu
Acked-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21560>
Ryan Neph [Wed, 15 Feb 2023 22:37:32 +0000 (14:37 -0800)]
Revert "venus: temporarily redirect VkDrmFormatModifierPropertiesListEXT to "2" variant"
No longer need to redirect, since the renderer should use the fixed
decoder for VkDrmFormatModifierPropertiesListEXT::drmFormatModifierCount
by now.
This reverts commit
525b8c582f2e8e3e8f12589c1d384d683fee5dc4.
Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21395>
Ryan Neph [Sat, 11 Feb 2023 00:45:21 +0000 (16:45 -0800)]
venus: update venus-protocol headers to fix WA1
Follow-up to previous commit, this time to fix encoding/decoding for
VkDrmFormatModifierPropertiesListEXT::drmFormatModifierCount. Fixes a
workaround (WA1) in the venus-protocol.
Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21395>
Alyssa Rosenzweig [Mon, 27 Feb 2023 00:15:48 +0000 (19:15 -0500)]
nir/lower_blend: Don't dereference null
If a dual source blend colour is never written, src1 will be null and it will be
invalid to dereference it. src1 is dereferenced both for the f2fN instruction
but also if a dual blend factor is used... even if the latter isn't strictly
valid, segfaulting in the NIR pass seems a lot meaner than blending with zero.
The referenced commit hosed Asahi, causing anything that used blending to crash.
Panfrost is unaffected since it always supplies a dual colour due to our crude
construction of blend shaders.
Fixes:
83130165437 ("nir/lower_blend: Consume dual stores")
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21544>
Rhys Perry [Thu, 23 Feb 2023 17:09:40 +0000 (17:09 +0000)]
aco: always update orig_names in get_reg_phi()
No idea why this wasn't done if pc.first was a renamed temporary.
Fixes navi10 RA validation error with
dEQP-VK.binding_model.descriptor_buffer.multiple.graphics_geom_buffers1_sets3_imm_samplers
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8349
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21501>
Eric Engestrom [Fri, 24 Feb 2023 10:57:24 +0000 (10:57 +0000)]
radv: split linker script for android since it requires different symbols
Fixes:
4956f6d0bf477568731f ("radv: Add Android module info to linker script.")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8338
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21518>
Yonggang Luo [Fri, 17 Feb 2023 06:45:08 +0000 (14:45 +0800)]
meson: Use sse2_arg and sse2_args to replace usage of c and c_sse2_args
And now c_sse2_arg and c_sse2_args are remvoed
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21375>
Yonggang Luo [Fri, 17 Feb 2023 06:24:20 +0000 (14:24 +0800)]
meson: Split sse2_arg and sse2_args out of c_cpp_args
This is used to replace c_sse2_arg and c_sse2_args in latter commits
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21375>
Yonggang Luo [Fri, 17 Feb 2023 06:25:54 +0000 (14:25 +0800)]
meson: When sse2 enabled, both c and cpp using sse2 options
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21375>
Mike Blumenkrantz [Tue, 21 Feb 2023 13:42:58 +0000 (08:42 -0500)]
vulkan/wsi/x11: make 4 image minimum for xwayland driver-specific
this avoids adding extra frames of latency to drivers that don't need
it
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21447>
Mike Blumenkrantz [Tue, 21 Feb 2023 13:40:23 +0000 (08:40 -0500)]
vulkan/wsi: switch to using an options struct for last param
this makes adding values easier since the drivers won't need to be updated
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21447>
Georg Lehmann [Thu, 23 Feb 2023 10:35:13 +0000 (11:35 +0100)]
aco: use and swizzle mask in dpp quad perm
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21412>