Georg Lehmann [Sun, 26 Mar 2023 20:25:02 +0000 (22:25 +0200)]
aco/tests: run optimize.mad_mix.input_conv.modifiers on gfx11
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
Georg Lehmann [Sun, 26 Mar 2023 20:01:57 +0000 (22:01 +0200)]
aco: add test for min/max combining with opsel
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
Georg Lehmann [Sun, 26 Mar 2023 19:31:48 +0000 (21:31 +0200)]
aco: add tests for cmp ordering with opsel
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
Georg Lehmann [Sun, 26 Mar 2023 19:00:55 +0000 (21:00 +0200)]
aco: add tests for swap operand with opsel
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
Georg Lehmann [Sun, 26 Mar 2023 18:26:08 +0000 (20:26 +0200)]
aco: add tests for dpp with opsel
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
Georg Lehmann [Tue, 21 Mar 2023 13:24:28 +0000 (14:24 +0100)]
aco: add tests for fma with opsel
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
Georg Lehmann [Wed, 22 Mar 2023 18:58:28 +0000 (19:58 +0100)]
aco/optimizer: remove to_SDWA
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
Georg Lehmann [Thu, 9 Mar 2023 13:53:34 +0000 (14:53 +0100)]
aco: keep label_mul/usedef/minmax in apply_extract
16bit int mad/fma/minmax combining can work with opsel set.
All other optimizations should already check if the instruction uses sdwa,
because we don't check this when applying the label initially.
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
Georg Lehmann [Tue, 21 Mar 2023 12:29:15 +0000 (13:29 +0100)]
aco/optimizer: use opsel for VOP12C
Foz-DB GFX1100:
Totals from 11759 (8.72% of 134864) affected shaders:
VGPRs: 848288 -> 844556 (-0.44%); split: -0.44%, +0.00%
SpillSGPRs: 8527 -> 8543 (+0.19%)
SpillVGPRs: 1411 -> 1423 (+0.85%); split: -0.21%, +1.06%
CodeSize:
114337120 ->
113882472 (-0.40%); split: -0.40%, +0.01%
Scratch: 128768 -> 129024 (+0.20%); split: -0.20%, +0.40%
MaxWaves: 250962 -> 252014 (+0.42%)
Instrs:
22187426 ->
22062378 (-0.56%); split: -0.57%, +0.00%
Latency:
232655375 ->
232376977 (-0.12%); split: -0.20%, +0.08%
InvThroughput:
28292530 ->
28217699 (-0.26%); split: -0.45%, +0.18%
VClause: 352463 -> 352364 (-0.03%); split: -0.12%, +0.10%
SClause: 659282 -> 659354 (+0.01%); split: -0.02%, +0.04%
Copies: 1371369 -> 1342340 (-2.12%); split: -2.30%, +0.19%
Branches: 495903 -> 495941 (+0.01%); split: -0.00%, +0.01%
PreSGPRs: 867295 -> 863664 (-0.42%)
PreVGPRs: 793480 -> 790549 (-0.37%)
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
Georg Lehmann [Tue, 21 Mar 2023 12:26:19 +0000 (13:26 +0100)]
aco/gfx11: allow opsel for VOP12C
Foz-DB GFX1100:
Totals from 515 (0.38% of 134864) affected shaders:
CodeSize: 2768228 -> 2761076 (-0.26%)
Instrs: 520301 -> 518523 (-0.34%)
Latency: 5190860 -> 5187254 (-0.07%)
InvThroughput: 2120844 -> 2119447 (-0.07%)
Copies: 57238 -> 56101 (-1.99%)
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
Georg Lehmann [Fri, 24 Mar 2023 12:35:07 +0000 (13:35 +0100)]
aco: don't label mul with opsel as abs/neg
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
Georg Lehmann [Thu, 23 Mar 2023 12:14:05 +0000 (13:14 +0100)]
aco/ir: copy opsel when converting to DPP
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
Georg Lehmann [Thu, 23 Mar 2023 12:10:58 +0000 (13:10 +0100)]
aco: swap opsel when swapping VOP2/C operands
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
Georg Lehmann [Fri, 24 Mar 2023 16:08:56 +0000 (17:08 +0100)]
aco: return true in usesModifiers for VOP12C with opsel
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
Georg Lehmann [Fri, 24 Mar 2023 12:30:01 +0000 (13:30 +0100)]
aco: support neg(mul)/abs(mul) optimization in more cases
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
Georg Lehmann [Fri, 24 Mar 2023 10:13:45 +0000 (11:13 +0100)]
aco: support v_cvt_f32_f16 with opsel in combine_mad_mix
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
Georg Lehmann [Wed, 22 Mar 2023 18:31:17 +0000 (19:31 +0100)]
aco: update match_op3_for_vop3 for VOP12C opsel
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
Georg Lehmann [Tue, 28 Mar 2023 19:48:04 +0000 (21:48 +0200)]
aco: handle opsel in combine_constant_comparison_ordering
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
Georg Lehmann [Wed, 22 Mar 2023 18:52:10 +0000 (19:52 +0100)]
aco: handle opsel in combine_ordering_test
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
Georg Lehmann [Wed, 22 Mar 2023 18:41:21 +0000 (19:41 +0100)]
aco: handle opsel in combine_comparison_ordering
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
Georg Lehmann [Tue, 21 Mar 2023 12:19:59 +0000 (13:19 +0100)]
aco/optimizer: preserve opsel when fusing fma
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
Georg Lehmann [Tue, 21 Mar 2023 11:39:26 +0000 (12:39 +0100)]
aco/ra: prepare for VOP12C opsel
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
Georg Lehmann [Tue, 21 Mar 2023 11:27:28 +0000 (12:27 +0100)]
aco/to_hw_instr: use VOP1 opsel for v_mov_b16
Foz-DB GFX1100:
Totals from 4661 (3.46% of 134864) affected shaders:
CodeSize:
36500568 ->
36391704 (-0.30%)
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
Georg Lehmann [Tue, 21 Mar 2023 11:07:51 +0000 (12:07 +0100)]
aco: validate VOP12C opsel
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
Georg Lehmann [Tue, 21 Mar 2023 10:54:33 +0000 (11:54 +0100)]
aco/assembler: support VOP12C opsel
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
Georg Lehmann [Wed, 22 Mar 2023 10:32:04 +0000 (11:32 +0100)]
aco/vn: hash opsel for VOP12C
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
Georg Lehmann [Wed, 29 Mar 2023 15:59:15 +0000 (17:59 +0200)]
aco/ra: don't reallocate VOP3 instruction for non-vcc lane mask
This would need to copy opsel soon but we can just reuse the old instruction.
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
Friedrich Vock [Wed, 29 Mar 2023 14:51:24 +0000 (16:51 +0200)]
aco: Un-swap addressable VGPRs/SGPRs in RT prolog
Fixes:
6446b791681 ("aco: implement select_rt_prolog()")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22188>
Friedrich Vock [Wed, 29 Mar 2023 14:04:54 +0000 (16:04 +0200)]
radv/rt: Also adjust the SGPR count in postprocess_rt_config
Fixes:
bea022d1f6a ("radv/rt: Add shader config combination/postprocessing utils")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22188>
Emma Anholt [Thu, 16 Mar 2023 22:46:46 +0000 (15:46 -0700)]
perfetto: Move intel's cmdbuf/queue annotation code to the shared util.
This will let other drivers use the same way of presenting annotations
without duplicating the whole hash table thing.
Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22157>
Emma Anholt [Thu, 16 Mar 2023 20:21:44 +0000 (13:21 -0700)]
perfetto: Deduplicate clock sync packet emit from renderstage sources.
This is way more horrifying than I hoped -- I can't figure out a way to
have the method be on TraceContext, so it's a static method of the
datasource, but then you have to name the templated types over and over.
You have to pass in a TraceContext because intel emits the clock sync
packet within a Trace(), and perfetto just silently corrupts the trace if
you Trace() in a Trace().
Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22157>
Emma Anholt [Thu, 16 Mar 2023 18:44:27 +0000 (11:44 -0700)]
perfetto: Make a MesaRenderpassDataSource with common setup/start/stop.
Deduplicates some code from intel/tu/freedreno, and will be a common place
to put other shared code.
The downside I can see is this logging:
[013.129] tu_perfetto.cc:122 Tracing started
[013.129] intel_driver_ds.cc:133 Tracing started
("oh, huh, apparently data sources for both drivers are registered? wild")
becomes:
[142.906] erfetto_renderpass.h:50 Tracing started
[142.907] erfetto_renderpass.h:50 Tracing started
("huh, why is my driver's data source being started twice?").
Unfortunately we can't easily get a string for the data source type due to
not having rtti.
Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22157>
Emma Anholt [Mon, 27 Mar 2023 22:01:51 +0000 (15:01 -0700)]
intel/perfetto: Drop unused "pipelined" field.
Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22157>
Emma Anholt [Fri, 24 Mar 2023 00:33:13 +0000 (17:33 -0700)]
perfetto: Add a .clang-format for the directory.
I was frustrated trying to write code and not be able to just mash ^K^F to
format what I'd written. This .clang-format is just cargo-cult of turnip
with a few tweaks to reduce the diff to the current directory contents.
The remaining deltas in the reformat look decent to me, and mostly bring
things closer to mesa-vague-consensus style.
Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22157>
José Roberto de Souza [Tue, 23 Aug 2022 17:50:59 +0000 (10:50 -0700)]
anv: Add assert in functions not supported by Xe kmd
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22171>
José Roberto de Souza [Thu, 15 Sep 2022 13:46:23 +0000 (06:46 -0700)]
anv: Disable anv_bo_sync_type for Xe kmd
anv_bo_sync_type is only supported with i915, if necessary it will be
implemented for Xe kmd.
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22171>
José Roberto de Souza [Fri, 10 Feb 2023 16:00:16 +0000 (08:00 -0800)]
anv: Implement Xe version of anv_queue_exec_locked() and queue_exec_trace()
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22171>
José Roberto de Souza [Wed, 29 Mar 2023 16:08:33 +0000 (09:08 -0700)]
anv: Move to a function code to clflush batch buffers
This also need to be executed in Xe kmd, so moving it to a function.
No changes in behavior intended here.
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22171>
Juston Li [Thu, 23 Mar 2023 20:06:55 +0000 (13:06 -0700)]
util/disk_cache: use posix_fallocate() for index files
ftruncate() allocates disk space lazily. If the disk is full and it is
unable to allocate disk space when accesed via mmap(), it will crash
with a SIGBUS.
Switch to posix_fallocate(), which ensures disk space is allocated
otherwise it fails if there isn't enough disk space. The disk cache
won't be enabled in this case.
For normal cases, a small increase in disk usage as the 1.3MB index
file will be fully allocated when initialized now.
fallback to ftruncate() if posix_fallocate() isn't found.
Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22097>
Lionel Landwerlin [Tue, 28 Mar 2023 09:52:21 +0000 (12:52 +0300)]
anv: hash immutable sampler conversion data not pointers
The conversion pointer has a vk_object_base containing pointers.
Previous commits had a similar issue, storing an internal pointer to
the array of formats in anv_format.c
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22160>
Ian Romanick [Thu, 23 Mar 2023 23:01:13 +0000 (16:01 -0700)]
nir/algebraic: Undistribute fsat from fmax
To be helpful, the thing inside the fsat has to be used with and without
the fsat. Otherwise it just moves a saturate destination modifier
around. To not be harmful, the fsat has to only be used by the bcsel.
All Broadwell and newer Intel platforms had similar results. (Ice Lake shown)
total instructions in shared programs:
20174475 ->
20174449 (<.01%)
instructions in affected programs: 3913 -> 3887 (-0.66%)
helped: 13 / HURT: 0
total cycles in shared programs:
866844832 ->
866844719 (<.01%)
cycles in affected programs: 46037 -> 45924 (-0.25%)
helped: 10 / HURT: 1
All Intel platforms had similar results. (Ice Lake shown)
Instructions in all programs:
161491468 ->
161491372 (-0.0%)
helped: 31 / HURT: 8
Cycles in all programs:
10933090736 ->
10933024716 (-0.0%)
helped: 32 / HURT: 18
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22169>
Ian Romanick [Thu, 23 Mar 2023 21:19:29 +0000 (14:19 -0700)]
intel/fs: Don't copy propagate from saturate to sel
There are already NIR algebraic optimizations (see also
ac6646129f7
("nir: Move fsat outside of fmin/fmax if second arg is 0 to 1.") that
will try to remove the saturate from things like
fmax(0.5, fsat(x))
This basically reverts
40aeb558ce8 ("i965/fs: Allow propagation of
instructions with saturate flag to sel"). That commit message had no
shader-db information, so it's unclear whether this actually helped
anything ever.
No shader-db changes on any Intel platform.
One shader in Far Cry New Dawn was affected.
Cycles in all programs:
10933090738 ->
10933090736 (-0.0%)
Cycles helped: 1
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22169>
Rhys Perry [Wed, 29 Mar 2023 13:35:58 +0000 (14:35 +0100)]
radv: fix setting radv_shader_info::user_data_0 with rt
Fixes raytracing pipelines.
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes:
0e81ec98ce9 ("radv: move user_data_0 to the shader info pass")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22187>
Guilherme Gallo [Mon, 27 Mar 2023 22:52:25 +0000 (19:52 -0300)]
ci/zink: Reduce zink-tu-a618-traces parallelism
Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22155>
Guilherme Gallo [Mon, 27 Mar 2023 19:17:51 +0000 (16:17 -0300)]
ci/zink: Fix zink-tu-a618-traces perf job rules
The pipeline should create this job only when it is under performance
enabled workflow, represented by the presence of
MESA_CI_PERFORMANCE_ENABLED variable.
For example:
The following pipeline
https://gitlab.freedesktop.org/gallo/mesa/-/pipelines/840525 has
`zink-tu-a618-traces-performance` job, even if it was not triggered by
marge-bot, which means that performance jobs should be disabled.
This job should appear in pipelines with performance jobs enabled
https://gitlab.freedesktop.org/gallo/mesa/-/pipelines/840529
Fixes:
93e3d37b47c77b19b330e3d5c6d2440108636952
Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22155>
Marek Olšák [Wed, 22 Mar 2023 16:22:59 +0000 (12:22 -0400)]
radeonsi: simplify binning settings to work around GPU hangs
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22084>
Marek Olšák [Sun, 19 Mar 2023 21:05:40 +0000 (17:05 -0400)]
radeonsi/gfx11: reduce MSAA samples to 8 for no-attachment framebuffer
EQAA is unsupported
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22084>
Marek Olšák [Sun, 19 Mar 2023 20:07:00 +0000 (16:07 -0400)]
amd: set the correct LLVM processor name for gfx1036
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22084>
Marek Olšák [Sun, 19 Mar 2023 18:52:16 +0000 (14:52 -0400)]
amd: rename GFX1036 -> RAPHAEL_MENDOCINO
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22084>
Marek Olšák [Sun, 19 Mar 2023 17:34:44 +0000 (13:34 -0400)]
amd: update addrlib
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22084>
antonino [Mon, 20 Mar 2023 16:43:29 +0000 (17:43 +0100)]
zink/ci: remove `primitive-id-no-gs-quads` from radv-vangogh-fails
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
antonino [Thu, 9 Mar 2023 15:24:54 +0000 (16:24 +0100)]
zink: unbind generated gs in `bind_last_vertex_stage`
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
antonino [Wed, 8 Mar 2023 16:30:10 +0000 (17:30 +0100)]
zink: improve generated gs unbinding
Avoid looping by using the new `parent` field to check if a generaetd gs
is bound and use `bind_gs_state` insted of `bind_gfx_stage` so that
`bind_last_vertex_stage` is automatically called
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
antonino [Wed, 8 Mar 2023 15:13:47 +0000 (16:13 +0100)]
zink: zink: add `parent` to `zink_shader::non_fs`
For a generated gs this field will store a pointer to the shader that
"owns" it.
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
antonino [Wed, 8 Mar 2023 17:25:02 +0000 (18:25 +0100)]
zink: unified `zink_set_primitive_emulation_keys` and `zink_create_primitive_emulation_gs`
Those two functions shared most of the code
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
antonino [Wed, 22 Feb 2023 16:24:57 +0000 (17:24 +0100)]
zink: prevent crash when freeing
If the same vertex shader is used for more than one pipeline where for some a gs
is generated but not for others then the logic to free pipeline
libraries might use the incorrect stage_mask and try to free a non
existing gs.
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
antonino [Mon, 13 Feb 2023 11:50:16 +0000 (12:50 +0100)]
zink: advertise support for the quad primitive
Zink now exposes the `PIPE_PRIM_QUADS` among supported primitives and
handles them with geometry shaders.
Previously, while not exposing this capability, gallium would internally
generate an index buffer to draw them with triangles.
However the information necessary to avoid drawing the diagonal line
when using the line primitive was not preserved.
fails are added for wireframe xfb quads tests
xfb is expected to output tessellatated quads while showing a quad
without a diagonal, however there is no sane way of achieving this.
As part of the test quads will be rendered with and without xfb and the
results compared.
Now to avoid breaking xfb zink has to always split quads into triangles
when xfb is enabled. This means that the test will fail.
Previously the diagonal was always present so the test passed
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
antonino [Thu, 16 Feb 2023 15:57:02 +0000 (16:57 +0100)]
zink: keep xfb properties in quad emulation gs
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
antonino [Thu, 16 Feb 2023 15:56:40 +0000 (16:56 +0100)]
nir: keep xfb properties in nir_create_passthrough_gs
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
antonino [Mon, 20 Feb 2023 18:52:50 +0000 (19:52 +0100)]
zink: handle provoking vertex mode for filled quads
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
antonino [Mon, 20 Feb 2023 18:49:25 +0000 (19:49 +0100)]
nir/zink: handle provoking vertex mode in `nir_create_passthrough_gs`
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
antonino [Thu, 9 Feb 2023 13:12:43 +0000 (14:12 +0100)]
zink: implement flat shading using inlined uniforms
Zink will now handle flat interpolation correctly when line loops
are generated from primitives.
The flat shading information is passed to the emulation gs using constant
uniforms which get inlined.
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
antonino [Tue, 21 Feb 2023 17:03:08 +0000 (18:03 +0100)]
zink: add `needs_inlining` to `zink_shader`
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
antonino [Tue, 21 Feb 2023 09:29:25 +0000 (10:29 +0100)]
zink: add flags to `zink_gfx_program` and `zink_context`
Adds `optimal_keys` and `needs_inlining` to `zink_gfx_program` and
`is_generated_gs_bound` to `zink_context`
Those will be needed for shaders that rely on some uniforms to be
inlined
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
antonino [Tue, 7 Feb 2023 16:01:52 +0000 (17:01 +0100)]
zink: fix flat shading on filled quads
Quads emulated by zink will now have the correct provoking vertex.
Also outputs of the previous shader stage that would normally
not be passed down to the FS (when no GS is bound) will now be skipped.
Different provoking vertex modes are not handled yet.
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
antonino [Fri, 3 Feb 2023 17:35:42 +0000 (18:35 +0100)]
zink: handle quads
Zink can now handle the quad primitive by emulating it in a gs
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
antonino [Tue, 21 Feb 2023 09:37:57 +0000 (10:37 +0100)]
zink: add `zink_rast_prim` enum
Adds an enum with primitives that are natively by vulkan
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
antonino [Fri, 3 Feb 2023 17:12:54 +0000 (18:12 +0100)]
zink: filled quad emulation gs generation function
This change adds a function to generate a geometry shader that will take a quad
as an input (passed as a line strip with adjacency because quads are not
available as an input primitives for GS) and generate a triangle strip.
This can be used to emulate the quad primitive.
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
antonino [Fri, 3 Feb 2023 14:43:09 +0000 (15:43 +0100)]
zink: force line strip out when emulating stipple
Fixes a bug where, whenever a primtiive that has more than 2 vertices is rendered
with line stipple, the edge between the first and last vertex will have
stretched out stipple.
This happens because interpolation will occur between two non consecutive
stipple counters for the last edge
(which is between the last and first vertices).
Forcing `nir_create_passthrough_gs` to generate a line strip avoids
this because the last vertex will be duplicated and will have
the correct stipple counter for each edge.
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
antonino [Fri, 3 Feb 2023 14:42:20 +0000 (15:42 +0100)]
nir: allow to force line strip out in nir_create_passthrough_gs
`nir_create_passthrough_gs` now allows the user to force the generated GS
to always output a line strip from the primitive
regardless of whether edgeflags are present.
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
antonino [Fri, 3 Feb 2023 10:44:39 +0000 (11:44 +0100)]
zink: handle edgeflags
Vulkan has no support for edgeflags.
If the user has a geometry shader bound nothing needs to be done as edgeflags
don't work with them, otherwise a geometry shader that emulates them
is generated.
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
antonino [Tue, 21 Feb 2023 09:27:54 +0000 (10:27 +0100)]
zink: add `has_edgeflags` flag to zink_shader and zink_gfx_program
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
antonino [Thu, 2 Feb 2023 16:30:05 +0000 (17:30 +0100)]
nir: handle edge flags in nir_create_passthrough_gs
`nir_create_passthrough_gs` will now take a boolean argument to decide
whether it needs to handle edgeflags.
When true is passed it will output a line strip where edges that
shouldn't be visible are not emitted.
This is usefull because geometry shaders will generally throw away
edgeflags so for a passthrough GS to act transparently it needs to emulate them.
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
antonino [Fri, 3 Feb 2023 10:23:09 +0000 (11:23 +0100)]
nir: calculate number of vertices in nir_create_passthrough_gs
`nir_create_passthrough_gs` has been changed to take the type of primitive
as opposed to the number of vertices as an argument.
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
antonino [Mon, 20 Feb 2023 18:26:20 +0000 (19:26 +0100)]
nir: avoid generating conflicting output variables
Because not all vertex outputs can have corresponding fragment inputs
(eg. edgeflags) some logic is needed to correctly generate variables in
a passthough gs.
Before this change some output variables ened up with the same location.
Fixes:
d0342e28b32 ("nir: Add helper to create passthrough GS shader")
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
antonino [Mon, 13 Feb 2023 11:57:38 +0000 (12:57 +0100)]
nir: handle primitives with adjacency
`nir_create_passthrough_gs` can now handle primitives with adjacency where some
vertices need to be skipped.
Fixes:
d0342e28b32 ("nir: Add helper to create passthrough GS shader")
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
antonino [Fri, 3 Feb 2023 10:43:04 +0000 (11:43 +0100)]
zink: handle switching between primitives
Zink will generate geometry shaders to emulate certain features, however there
might be different variants of those depending on the primitive type.
This commits adds the logic to generate or bind the correct emulation GS
in the case where nothing changes except the primitive type.
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
Marcin Ślusarz [Mon, 18 Jul 2022 11:47:00 +0000 (13:47 +0200)]
intel/compiler: compactify locations of mesh outputs
Needed in support of anv code for Wa_14015590813.
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17622>
Marcin Ślusarz [Wed, 6 Jul 2022 15:17:42 +0000 (17:17 +0200)]
anv: work around for per-prim attributes corruption
Wa_14015590813 for gfx 12.5
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17622>
Eric Anholt [Tue, 28 Mar 2023 22:54:06 +0000 (15:54 -0700)]
ci/broadcom: Skip another texelfetch case.
This one has also flaked a pipeline recently with a timeout.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22177>
Eric Anholt [Tue, 28 Mar 2023 22:50:11 +0000 (15:50 -0700)]
ci/freedreno: Flake KHR-GL45.shader_image_load_store.basic-allTargets-store
It has UnexpectedPassed a couple of times recently.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22177>
Sil Vilerino [Mon, 27 Mar 2023 20:29:32 +0000 (16:29 -0400)]
nir: Fix use of alloca() without #include c99_alloca.h
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22150>
Emma Anholt [Thu, 16 Mar 2023 00:07:10 +0000 (17:07 -0700)]
glsl: Drop dead prototype.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21940>
Emma Anholt [Wed, 15 Mar 2023 23:26:38 +0000 (16:26 -0700)]
glsl: Remove the TessLevel lowering special case from xfb.
The NIR vectorized tess level pass applies later, and it leaves the name
as-is, so we don't need to mess around with
gl_TessLevelInnerMesa/OuterMesa.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21940>
Emma Anholt [Mon, 20 Mar 2023 17:12:18 +0000 (10:12 -0700)]
glsl: Delete the lower_tess_level pass.
NIR i/o lowering and sysval lowering can handle the compact var fine at
this point.
Affects: nouveau, virgl, svga, radeonsi, r600, llvmpipe. Does not affect
PIPE_CAP_NIR_COMPACT_ARRAYS drivers like crocus, iris, d3d12, freedreno,
zink.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21940>
Emma Anholt [Mon, 20 Mar 2023 21:09:22 +0000 (14:09 -0700)]
nir_to_tgsi: Handle stores to compact outputs.
We had been relying on glsl lowering to a vec4 output, but we can just do
a tiny override here to support compact variables and drop the lowering
pass.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21940>
Emma Anholt [Mon, 20 Mar 2023 17:10:42 +0000 (10:10 -0700)]
nir/lower_sysvals: Add support for un-lowered tess_level_inner/outer.
GLSL has been responsible for doing this, but we can just extract the
array index here.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21940>
Emma Anholt [Mon, 20 Mar 2023 17:57:37 +0000 (10:57 -0700)]
gallivm: Skip loads/stores that are definitely outside of compact vars.
As I reduce GLSL lowering code, OOB TessLevel accesses can end up making
it to the backend.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21940>
Ryan Neph [Tue, 28 Mar 2023 22:40:09 +0000 (15:40 -0700)]
venus: re-use VN_DEBUG_NO_ABORT to disable ring monitoring abort()
Useful to keep the hung guest process alive while debugging the renderer
process.
Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22176>
Timur Kristóf [Mon, 27 Mar 2023 23:35:08 +0000 (01:35 +0200)]
nir: Remove IB address and stride intrinsics.
RADV used these to emulate firstTask for NV_mesh_shader.
They are no longer needed.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22139>
Timur Kristóf [Mon, 27 Mar 2023 15:37:24 +0000 (17:37 +0200)]
ac/nir: Remove ac_nir_apply_first_task_to_task_shader.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22139>
Timur Kristóf [Mon, 27 Mar 2023 15:36:20 +0000 (17:36 +0200)]
ac/nir/ngg: Remove NV_mesh_shader support.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22139>
Timur Kristóf [Mon, 27 Mar 2023 23:07:39 +0000 (01:07 +0200)]
radv: Clean up emitting zero mesh shader draw id.
When task shaders are also used,
the draw id is undefined in mesh shaders.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22139>
Timur Kristóf [Mon, 27 Mar 2023 14:23:53 +0000 (16:23 +0200)]
radv: Remove first_task and ib_addr/ib_stride.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22139>
Timur Kristóf [Mon, 27 Mar 2023 14:09:08 +0000 (16:09 +0200)]
radv: Remove NV_mesh_shader API entrypoints.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22139>
Timur Kristóf [Mon, 27 Mar 2023 13:38:47 +0000 (15:38 +0200)]
radv: Don't expose NV_mesh_shader and don't use it in CI.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22139>
Lionel Landwerlin [Wed, 29 Mar 2023 08:12:01 +0000 (11:12 +0300)]
iris: implement recommended flush/wait of AUX-TT invalidation
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22183>
Lionel Landwerlin [Wed, 29 Mar 2023 08:06:13 +0000 (11:06 +0300)]
anv: implement recommended flush/wait of AUX-TT invalidation
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22183>
Jarred Davies [Mon, 6 Mar 2023 00:15:05 +0000 (00:15 +0000)]
pvr: Mark all normalized formats as supporting with_packed_usc_channel
Avoids assert seen in dEQP-VK.api.smoke.triangle
Signed-off-by: Jarred Davies <jarred.davies@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22174>
Erik Faye-Lund [Mon, 20 Mar 2023 10:02:55 +0000 (11:02 +0100)]
docs: drop reference to modindex
We don't render such a page, so there's no point in linking to it.
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22022>